849 |
{ |
{ |
850 |
GTOP *gtop; |
GTOP *gtop; |
851 |
STRBUF *comline = strbuf_open(0); |
STRBUF *comline = strbuf_open(0); |
|
int flags; |
|
852 |
int seqno; |
int seqno; |
853 |
|
|
854 |
/* |
/* |
882 |
} |
} |
883 |
if (deleteset->max > 0) |
if (deleteset->max > 0) |
884 |
gtags_delete(gtop, deleteset); |
gtags_delete(gtop, deleteset); |
885 |
flags = 0; |
gtop->flags = 0; |
886 |
if (extractmethod) |
if (extractmethod) |
887 |
flags |= GTAGS_EXTRACTMETHOD; |
gtop->flags |= GTAGS_EXTRACTMETHOD; |
888 |
if (debug) |
if (debug) |
889 |
flags |= GTAGS_DEBUG; |
gtop->flags |= GTAGS_DEBUG; |
890 |
|
/* |
891 |
|
* Compact format requires the tag records of the same file are |
892 |
|
* consecutive. |
893 |
|
* |
894 |
|
* We assume that the output of gtags-parser is consecutive for each |
895 |
|
* file. About the other parsers, it is not guaranteed, so we sort it |
896 |
|
* using external sort command (gnusort). |
897 |
|
*/ |
898 |
|
if (gtop->format & GTAGS_COMPACT) { |
899 |
|
if (locatestring(strbuf_value(comline), "gtags-parser", MATCH_FIRST) == NULL) { |
900 |
|
if (locatestring(strbuf_value(comline), "%s", MATCH_FIRST) == NULL) |
901 |
|
strbuf_puts(comline, " %s"); |
902 |
|
strbuf_sprintf(comline, "| %s -k 3,3", POSIX_SORT); |
903 |
|
} |
904 |
|
} |
905 |
/* |
/* |
906 |
* If the --max-args option is not specified, we pass the parser |
* If the --max-args option is not specified, we pass the parser |
907 |
* the source file as a lot as possible to decrease the invoking |
* the source file as a lot as possible to decrease the invoking |
929 |
* data = 'Class::method 103 ./class.cpp ...' |
* data = 'Class::method 103 ./class.cpp ...' |
930 |
*/ |
*/ |
931 |
p = tag; |
p = tag; |
932 |
if (flags & GTAGS_EXTRACTMETHOD) { |
if (gtop->flags & GTAGS_EXTRACTMETHOD) { |
933 |
if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL) |
if ((p = locatestring(tag, ".", MATCH_LAST)) != NULL) |
934 |
p++; |
p++; |
935 |
else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL) |
else if ((p = locatestring(tag, "::", MATCH_LAST)) != NULL) |