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

Diff of /global/htags/dupindex.c

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

revision 1.24 by shigio, Fri Nov 11 08:04:05 2005 UTC revision 1.25 by shigio, Sat Nov 19 00:14:09 2005 UTC
# Line 94  int Line 94  int
94  makedupindex(void)  makedupindex(void)
95  {  {
96          STRBUF *sb = strbuf_open(0);          STRBUF *sb = strbuf_open(0);
97            STRBUF *command = strbuf_open(0);
98          int definition_count = 0;          int definition_count = 0;
99          char srcdir[MAXPATHLEN];          char srcdir[MAXPATHLEN];
100          int db;          int db;
# Line 108  makedupindex(void) Line 109  makedupindex(void)
109                  int writing = 0;                  int writing = 0;
110                  int count = 0;                  int count = 0;
111                  int entry_count = 0;                  int entry_count = 0;
112                  char *ctags_x, tag[IDENTLEN], prev[IDENTLEN], first_line[MAXBUFLEN], command[MAXFILLEN];                  char *ctags_x, tag[IDENTLEN], prev[IDENTLEN], first_line[MAXBUFLEN];
113    
114                  if (!symbol && db == GSYMS)                  if (!symbol && db == GSYMS)
115                          continue;                          continue;
116                  prev[0] = 0;                  prev[0] = 0;
117                  first_line[0] = 0;                  first_line[0] = 0;
118                  snprintf(command, sizeof(command), "global -xn%s%s \".*\"%s",                  /*
119                           dynamic ? "n" : "", option,                   * construct command line.
120                           (!dynamic || db == GSYMS) ? " | gtags --sort --unique" : "");                   */
121                  if ((ip = popen(command, "r")) == NULL)                  strbuf_reset(command);
122                    strbuf_puts(command, "global -xn");
123                    strbuf_puts(command, option);
124                    if (dynamic)
125                            strbuf_puts(command, " --nosource");
126                    strbuf_puts(command, " \".*\"");
127                    if (!dynamic || db == GSYMS)
128                             strbuf_puts(command, " | gtags --sort --unique");
129                    if ((ip = popen(strbuf_value(command), "r")) == NULL)
130                          die("cannot execute command '%s'.", command);                          die("cannot execute command '%s'.", command);
131                  while ((ctags_x = strbuf_fgets(sb, ip, STRBUF_NOCRLF)) != NULL) {                  while ((ctags_x = strbuf_fgets(sb, ip, STRBUF_NOCRLF)) != NULL) {
132                          SPLIT ptable;                          SPLIT ptable;
# Line 217  makedupindex(void) Line 226  makedupindex(void)
226                  }                  }
227          }          }
228          strbuf_close(sb);          strbuf_close(sb);
229            strbuf_close(command);
230          return definition_count;          return definition_count;
231  }  }

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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