503 |
if (!(ip = popen(strbuf_value(sb), "r"))) |
if (!(ip = popen(strbuf_value(sb), "r"))) |
504 |
die("cannot execute '%s'.", strbuf_value(sb)); |
die("cannot execute '%s'.", strbuf_value(sb)); |
505 |
while ((ctags_x = strbuf_fgets(ib, ip, STRBUF_NOCRLF)) != NULL) { |
while ((ctags_x = strbuf_fgets(ib, ip, STRBUF_NOCRLF)) != NULL) { |
506 |
char *tag, *p; |
char tag[MAXTOKEN], *p; |
507 |
|
|
508 |
strbuf_trim(ib); |
strbuf_trim(ib); |
509 |
#ifdef DEBUG |
#ifdef DEBUG |
510 |
if (flags & GTAGS_DEBUG) |
if (flags & GTAGS_DEBUG) |
511 |
formatcheck(ctags_x, gtop->format); |
formatcheck(ctags_x, gtop->format); |
512 |
#endif |
#endif |
513 |
tag = strmake(ctags_x, " \t"); /* tag = $1 */ |
/* tag = $1 */ |
514 |
|
strlimcpy(tag, strmake(ctags_x, " \t"), sizeof(tag)); |
515 |
/* |
/* |
516 |
* extract method when class method definition. |
* extract method when class method definition. |
517 |
* |
* |
520 |
* key = 'method' |
* key = 'method' |
521 |
* data = 'Class::method 103 ./class.cpp ...' |
* data = 'Class::method 103 ./class.cpp ...' |
522 |
*/ |
*/ |
523 |
|
p = tag; |
524 |
if (flags & GTAGS_EXTRACTMETHOD) { |
if (flags & GTAGS_EXTRACTMETHOD) { |
525 |
if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL) |
if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL) |
526 |
tag = p + 1; |
p++; |
527 |
else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL) |
else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL) |
528 |
tag = p + 2; |
p += 2; |
529 |
} |
} |
530 |
gtags_put(gtop, tag, ctags_x, fid); |
gtags_put(gtop, p, ctags_x, fid); |
531 |
} |
} |
532 |
if (pclose(ip) < 0) |
if (pclose(ip) < 0) |
533 |
die("terminated abnormally."); |
die("terminated abnormally."); |