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; |
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; |
226 |
} |
} |
227 |
} |
} |
228 |
strbuf_close(sb); |
strbuf_close(sb); |
229 |
|
strbuf_close(command); |
230 |
return definition_count; |
return definition_count; |
231 |
} |
} |