/[global]/global/htags/defineindex.c
ViewVC logotype

Diff of /global/htags/defineindex.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by shigio, Thu Apr 7 10:20:07 2005 UTC revision 1.22 by shigio, Fri Apr 8 06:49:19 2005 UTC
# Line 55  makedefineindex(file, total, defines) Line 55  makedefineindex(file, total, defines)
55          FILE *DEFINES, *old, *STDOUT, *TAGS, *ALPHA = NULL;          FILE *DEFINES, *old, *STDOUT, *TAGS, *ALPHA = NULL;
56          STRBUF *sb = strbuf_open(0);          STRBUF *sb = strbuf_open(0);
57          STRBUF *url = strbuf_open(0);          STRBUF *url = strbuf_open(0);
         char *_;  
         char command[1024], buf[1024], alpha[32], alpha_f[32];  
58          /* Index link */          /* Index link */
59          char *target = (Fflag) ? "mains" : "_top";          const char *target = (Fflag) ? "mains" : "_top";
60          char *indexlink;          const char *indexlink;
61          char *index_string = "Index Page";          const char *index_string = "Index Page";
62            char command[1024], buf[1024], alpha[32], alpha_f[32], *_;
63    
64          if (!aflag && !Fflag)          if (!aflag && !Fflag)
65                  indexlink = "mains";                  indexlink = "mains";
# Line 106  makedefineindex(file, total, defines) Line 105  makedefineindex(file, total, defines)
105                  die("cannot fork.");                  die("cannot fork.");
106          alpha[0] = '\0';          alpha[0] = '\0';
107          while ((_ = strbuf_fgets(sb, TAGS, STRBUF_NOCRLF)) != NULL) {          while ((_ = strbuf_fgets(sb, TAGS, STRBUF_NOCRLF)) != NULL) {
108                  char *line, *tag;                  const char *tag, *line;
109                  char guide[1024], url_for_map[1024];                  char guide[1024], url_for_map[1024];
110    
111                  count++;                  count++;
112                  tag = _;                  tag = _;
113                  message(" [%d/%d] adding %s", count, total, tag);                  message(" [%d/%d] adding %s", count, total, tag);
114                  if (aflag && (alpha[0] == '\0' || strncmp(tag, alpha, strlen(alpha)))) {                  if (aflag && (alpha[0] == '\0' || strncmp(tag, alpha, strlen(alpha)))) {
115                          char *msg = (alpha_count == 1) ? "definition is contained." : "definitions are contained.";                          const char *msg = (alpha_count == 1) ? "definition is contained." : "definitions are contained.";
116                          int c;                          int c;
117    
118                          if (alpha[0]) {                          if (alpha[0]) {
# Line 212  makedefineindex(file, total, defines) Line 211  makedefineindex(file, total, defines)
211                          die("internal error in makedefineindex().");                          die("internal error in makedefineindex().");
212                  if (*line == ' ') {                  if (*line == ' ') {
213                          SPLIT ptable;                          SPLIT ptable;
214                          char *fid, *enumber;                          const char *fid, *enumber;
215    
216                          if (split(line + 1, 2, &ptable) < 2) {                          if (split((char *)line + 1, 2, &ptable) < 2) {
217                                  recover(&ptable);                                  recover(&ptable);
218                                  die("too small number of parts in makedefineindex().\n'%s'", line);                                  die("too small number of parts in makedefineindex().\n'%s'", line);
219                          }                          }
# Line 239  makedefineindex(file, total, defines) Line 238  makedefineindex(file, total, defines)
238                          recover(&ptable);                          recover(&ptable);
239                  } else {                  } else {
240                          SPLIT ptable;                          SPLIT ptable;
241                          char *lno, *fid, *path;                          const char *lno, *fid, *path;
242    
243                          if (split(line, 3, &ptable) < 3) {                          if (split((char *)line, 3, &ptable) < 3) {
244                                  recover(&ptable);                                  recover(&ptable);
245                                  die("too small number of parts in makedefineindex().\n'%s'", line);                                  die("too small number of parts in makedefineindex().\n'%s'", line);
246                          }                          }
# Line 276  makedefineindex(file, total, defines) Line 275  makedefineindex(file, total, defines)
275          STDOUT = old;          STDOUT = old;
276          if (aflag && alpha[0]) {          if (aflag && alpha[0]) {
277                  char tmp[128];                  char tmp[128];
278                  char *msg = (alpha_count == 1) ? "definition is contained." : "definitions are contained.";                  const char *msg = (alpha_count == 1) ? "definition is contained." : "definitions are contained.";
279    
280                  snprintf(tmp, sizeof(tmp), "%d %s", alpha_count, msg);                  snprintf(tmp, sizeof(tmp), "%d %s", alpha_count, msg);
281                  strbuf_puts(defines, gen_href_begin_with_title("defines", alpha_f, HTML, NULL, tmp));                  strbuf_puts(defines, gen_href_begin_with_title("defines", alpha_f, HTML, NULL, tmp));

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26