diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 7 | ||||
| -rw-r--r-- | lib-src/etags.c | 72 |
2 files changed, 46 insertions, 33 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 76a0dcf1b9e..ebf6f27a610 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-01-02 Francesco Potort,Al(B <pot@gnu.org> | ||
| 2 | |||
| 3 | * etags.c: (longopts): New undocumented option --no-duplicates. | ||
| 4 | (no_duplicates): Static variables for the above option. | ||
| 5 | (print_help): Do not print help for --no-warn, now undocumented. | ||
| 6 | (add_node): Allow duplicate tags in ctags mode unless --no-duplicates. | ||
| 7 | |||
| 1 | 2006-12-28 Francesco Potort,Al(B <pot@gnu.org> | 8 | 2006-12-28 Francesco Potort,Al(B <pot@gnu.org> |
| 2 | 9 | ||
| 3 | * etags.c (readline): When creating a relative file name from a | 10 | * etags.c (readline): When creating a relative file name from a |
diff --git a/lib-src/etags.c b/lib-src/etags.c index c4f7fdc4d69..bab09d77bac 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | * configuration file containing regexp definitions for etags. | 41 | * configuration file containing regexp definitions for etags. |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | char pot_etags_version[] = "@(#) pot revision number is 17.25"; | 44 | char pot_etags_version[] = "@(#) pot revision number is 17.26"; |
| 45 | 45 | ||
| 46 | #define TRUE 1 | 46 | #define TRUE 1 |
| 47 | #define FALSE 0 | 47 | #define FALSE 0 |
| @@ -456,9 +456,10 @@ static bool globals; /* create tags for global variables */ | |||
| 456 | static bool declarations; /* --declarations: tag them and extern in C&Co*/ | 456 | static bool declarations; /* --declarations: tag them and extern in C&Co*/ |
| 457 | static bool members; /* create tags for C member variables */ | 457 | static bool members; /* create tags for C member variables */ |
| 458 | static bool no_line_directive; /* ignore #line directives (undocumented) */ | 458 | static bool no_line_directive; /* ignore #line directives (undocumented) */ |
| 459 | static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */ | ||
| 459 | static bool update; /* -u: update tags */ | 460 | static bool update; /* -u: update tags */ |
| 460 | static bool vgrind_style; /* -v: create vgrind style index output */ | 461 | static bool vgrind_style; /* -v: create vgrind style index output */ |
| 461 | static bool no_warnings; /* -w: suppress warnings */ | 462 | static bool no_warnings; /* -w: suppress warnings (undocumented) */ |
| 462 | static bool cxref_style; /* -x: create cxref style output */ | 463 | static bool cxref_style; /* -x: create cxref style output */ |
| 463 | static bool cplusplus; /* .[hc] means C++, not C */ | 464 | static bool cplusplus; /* .[hc] means C++, not C */ |
| 464 | static bool ignoreindent; /* -I: ignore indentation in C */ | 465 | static bool ignoreindent; /* -I: ignore indentation in C */ |
| @@ -477,39 +478,40 @@ static bool need_filebuf; /* some regexes are multi-line */ | |||
| 477 | 478 | ||
| 478 | static struct option longopts[] = | 479 | static struct option longopts[] = |
| 479 | { | 480 | { |
| 480 | { "append", no_argument, NULL, 'a' }, | 481 | { "append", no_argument, NULL, 'a' }, |
| 481 | { "packages-only", no_argument, &packages_only, TRUE }, | 482 | { "packages-only", no_argument, &packages_only, TRUE }, |
| 482 | { "c++", no_argument, NULL, 'C' }, | 483 | { "c++", no_argument, NULL, 'C' }, |
| 483 | { "declarations", no_argument, &declarations, TRUE }, | 484 | { "declarations", no_argument, &declarations, TRUE }, |
| 484 | { "no-line-directive", no_argument, &no_line_directive, TRUE }, | 485 | { "no-line-directive", no_argument, &no_line_directive, TRUE }, |
| 485 | { "help", no_argument, NULL, 'h' }, | 486 | { "no-duplicates", no_argument, &no_duplicates, TRUE }, |
| 486 | { "help", no_argument, NULL, 'H' }, | 487 | { "help", no_argument, NULL, 'h' }, |
| 487 | { "ignore-indentation", no_argument, NULL, 'I' }, | 488 | { "help", no_argument, NULL, 'H' }, |
| 488 | { "language", required_argument, NULL, 'l' }, | 489 | { "ignore-indentation", no_argument, NULL, 'I' }, |
| 489 | { "members", no_argument, &members, TRUE }, | 490 | { "language", required_argument, NULL, 'l' }, |
| 490 | { "no-members", no_argument, &members, FALSE }, | 491 | { "members", no_argument, &members, TRUE }, |
| 491 | { "output", required_argument, NULL, 'o' }, | 492 | { "no-members", no_argument, &members, FALSE }, |
| 492 | { "regex", required_argument, NULL, 'r' }, | 493 | { "output", required_argument, NULL, 'o' }, |
| 493 | { "no-regex", no_argument, NULL, 'R' }, | 494 | { "regex", required_argument, NULL, 'r' }, |
| 494 | { "ignore-case-regex", required_argument, NULL, 'c' }, | 495 | { "no-regex", no_argument, NULL, 'R' }, |
| 496 | { "ignore-case-regex", required_argument, NULL, 'c' }, | ||
| 495 | { "parse-stdin", required_argument, NULL, STDIN }, | 497 | { "parse-stdin", required_argument, NULL, STDIN }, |
| 496 | { "version", no_argument, NULL, 'V' }, | 498 | { "version", no_argument, NULL, 'V' }, |
| 497 | 499 | ||
| 498 | #if CTAGS /* Ctags options */ | 500 | #if CTAGS /* Ctags options */ |
| 499 | { "backward-search", no_argument, NULL, 'B' }, | 501 | { "backward-search", no_argument, NULL, 'B' }, |
| 500 | { "cxref", no_argument, NULL, 'x' }, | 502 | { "cxref", no_argument, NULL, 'x' }, |
| 501 | { "defines", no_argument, NULL, 'd' }, | 503 | { "defines", no_argument, NULL, 'd' }, |
| 502 | { "globals", no_argument, &globals, TRUE }, | 504 | { "globals", no_argument, &globals, TRUE }, |
| 503 | { "typedefs", no_argument, NULL, 't' }, | 505 | { "typedefs", no_argument, NULL, 't' }, |
| 504 | { "typedefs-and-c++", no_argument, NULL, 'T' }, | 506 | { "typedefs-and-c++", no_argument, NULL, 'T' }, |
| 505 | { "update", no_argument, NULL, 'u' }, | 507 | { "update", no_argument, NULL, 'u' }, |
| 506 | { "vgrind", no_argument, NULL, 'v' }, | 508 | { "vgrind", no_argument, NULL, 'v' }, |
| 507 | { "no-warn", no_argument, NULL, 'w' }, | 509 | { "no-warn", no_argument, NULL, 'w' }, |
| 508 | 510 | ||
| 509 | #else /* Etags options */ | 511 | #else /* Etags options */ |
| 510 | { "no-defines", no_argument, NULL, 'D' }, | 512 | { "no-defines", no_argument, NULL, 'D' }, |
| 511 | { "no-globals", no_argument, &globals, FALSE }, | 513 | { "no-globals", no_argument, &globals, FALSE }, |
| 512 | { "include", required_argument, NULL, 'i' }, | 514 | { "include", required_argument, NULL, 'i' }, |
| 513 | #endif | 515 | #endif |
| 514 | { NULL } | 516 | { NULL } |
| 515 | }; | 517 | }; |
| @@ -976,9 +978,13 @@ Relative ones are stored relative to the output file's directory.\n"); | |||
| 976 | Print on the standard output an index of items intended for\n\ | 978 | Print on the standard output an index of items intended for\n\ |
| 977 | human consumption, similar to the output of vgrind. The index\n\ | 979 | human consumption, similar to the output of vgrind. The index\n\ |
| 978 | is sorted, and gives the page number of each item."); | 980 | is sorted, and gives the page number of each item."); |
| 981 | # if PRINT_UNDOCUMENTED_OPTIONS_HELP | ||
| 982 | puts ("-w, --no-duplicates\n\ | ||
| 983 | Do not create duplicate tag entries, for compatibility with\n\ | ||
| 984 | traditional ctags."); | ||
| 979 | puts ("-w, --no-warn\n\ | 985 | puts ("-w, --no-warn\n\ |
| 980 | Suppress warning messages about entries defined in multiple\n\ | 986 | Suppress warning messages about duplicate tag entries."); |
| 981 | files."); | 987 | # endif /* PRINT_UNDOCUMENTED_OPTIONS_HELP */ |
| 982 | puts ("-x, --cxref\n\ | 988 | puts ("-x, --cxref\n\ |
| 983 | Like --vgrind, but in the style of cxref, rather than vgrind.\n\ | 989 | Like --vgrind, but in the style of cxref, rather than vgrind.\n\ |
| 984 | The output uses line numbers instead of page numbers, but\n\ | 990 | The output uses line numbers instead of page numbers, but\n\ |
| @@ -2168,7 +2174,7 @@ add_node (np, cur_node_p) | |||
| 2168 | * If this tag name matches an existing one, then | 2174 | * If this tag name matches an existing one, then |
| 2169 | * do not add the node, but maybe print a warning. | 2175 | * do not add the node, but maybe print a warning. |
| 2170 | */ | 2176 | */ |
| 2171 | if (!dif) | 2177 | if (no_duplicates && !dif) |
| 2172 | { | 2178 | { |
| 2173 | if (np->fdp == cur_node->fdp) | 2179 | if (np->fdp == cur_node->fdp) |
| 2174 | { | 2180 | { |