295 |
exit(0); |
exit(0); |
296 |
} else if (do_sort) { |
} else if (do_sort) { |
297 |
/* |
/* |
298 |
* This code and the makedupindex() in htags(1) compose |
* A special version of sort command. |
|
* a pipeline 'global -x ".*" | gtags --sort'. |
|
|
* The 'gtags --sort' is equivalent with 'sort -k 1,1 -k 3,3 -k 2,2n -u' |
|
|
* but the latter is ineffective and needs a lot of temporary |
|
|
* files when applied to a huge file. (According to circumstances, |
|
|
* hundreds of files are generated.) |
|
299 |
* |
* |
300 |
* Utilizing the feature that the output of 'global -x ".*"' |
* As long as the input meets the undermentioned requirement, |
301 |
* is already sorted in alphabetical order by tag name, |
* you can use this special sort command as a sort filter for |
302 |
* we splited the output into relatively small unit and |
* global(1) instead of external sort command. |
303 |
* execute sort for each unit. |
* 'gtags --sort' is equivalent with |
304 |
|
* 'sort -k 1,1 -k 3,3 -k 2,2n -u', but does not need temporary |
305 |
|
* files. |
306 |
|
* |
307 |
|
* - Requirement - |
308 |
|
* 1. input must be ctags -x format. |
309 |
|
* 2. input must be sorted in alphabetical order by tag name. |
310 |
*/ |
*/ |
311 |
STRBUF *ib = strbuf_open(MAXBUFLEN); |
STRBUF *ib = strbuf_open(MAXBUFLEN); |
312 |
STRBUF *sb = strbuf_open(MAXBUFLEN); |
STRBUF *sb = strbuf_open(MAXBUFLEN); |