comparison lib-src/etags.c @ 79467:a41c68c29da3

(default_C_help) [CTAGS]: differentiate the help string, as the defaults in ctags are different from etags. (default_C_help, Cplusplus_help, PHP_help, print_help): Remove text saying --members is the default: not true in Emacs 22.
author Francesco Potortì <pot@gnu.org>
date Thu, 22 Nov 2007 11:31:48 +0000
parents 24f4925384aa
children 4cdad67efc2d ec0ef12211d9
comparison
equal deleted inserted replaced
79466:826340875e93 79467:a41c68c29da3
499 static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */ 499 static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */
500 static bool update; /* -u: update tags */ 500 static bool update; /* -u: update tags */
501 static bool vgrind_style; /* -v: create vgrind style index output */ 501 static bool vgrind_style; /* -v: create vgrind style index output */
502 static bool no_warnings; /* -w: suppress warnings (undocumented) */ 502 static bool no_warnings; /* -w: suppress warnings (undocumented) */
503 static bool cxref_style; /* -x: create cxref style output */ 503 static bool cxref_style; /* -x: create cxref style output */
504 static bool cplusplus; /* .[hc] means C++, not C */ 504 static bool cplusplus; /* .[hc] means C++, not C (undocumented) */
505 static bool ignoreindent; /* -I: ignore indentation in C */ 505 static bool ignoreindent; /* -I: ignore indentation in C */
506 static bool packages_only; /* --packages-only: in Ada, only tag packages*/ 506 static bool packages_only; /* --packages-only: in Ada, only tag packages*/
507 507
508 /* STDIN is defined in LynxOS system headers */ 508 /* STDIN is defined in LynxOS system headers */
509 #ifdef STDIN 509 #ifdef STDIN
606 "In assembler code, labels appearing at the beginning of a line,\n\ 606 "In assembler code, labels appearing at the beginning of a line,\n\
607 followed by a colon, are tags."; 607 followed by a colon, are tags.";
608 608
609 609
610 /* Note that .c and .h can be considered C++, if the --c++ flag was 610 /* Note that .c and .h can be considered C++, if the --c++ flag was
611 given, or if the `class' or `template' keyowrds are met inside the file. 611 given, or if the `class' or `template' keywords are met inside the file.
612 That is why default_C_entries is called for these. */ 612 That is why default_C_entries is called for these. */
613 static char *default_C_suffixes [] = 613 static char *default_C_suffixes [] =
614 { "c", "h", NULL }; 614 { "c", "h", NULL };
615 #if CTAGS /* C help for Ctags */
616 static char default_C_help [] =
617 "In C code, any C function is a tag. Use -t to tag typedefs.\n\
618 Use -T to tag definitions of `struct', `union' and `enum'.\n\
619 Use -d to tag `#define' macro definitions and `enum' constants.\n\
620 Use --globals to tag global variables.\n\
621 You can tag function declarations and external variables by\n\
622 using `--declarations', and struct members by using `--members'.";
623 #else /* C help for Etags */
615 static char default_C_help [] = 624 static char default_C_help [] =
616 "In C code, any C function or typedef is a tag, and so are\n\ 625 "In C code, any C function or typedef is a tag, and so are\n\
617 definitions of `struct', `union' and `enum'. `#define' macro\n\ 626 definitions of `struct', `union' and `enum'. `#define' macro\n\
618 definitions and `enum' constants are tags unless you specify\n\ 627 definitions and `enum' constants are tags unless you specify\n\
619 `--no-defines'. Global variables are tags unless you specify\n\ 628 `--no-defines'. Global variables are tags unless you specify\n\
620 `--no-globals' and so are struct members unless you specify\n\ 629 `--no-globals'. Use of `--no-globals' and `--no-defines'\n\
621 `--no-members'. Use of `--no-globals', `--no-defines' and\n\ 630 can make the tags table file much smaller.\n\
622 `--no-members' can make the tags table file much smaller.\n\
623 You can tag function declarations and external variables by\n\ 631 You can tag function declarations and external variables by\n\
624 using `--declarations'."; 632 using `--declarations', and struct members by using `--members'.";
633 #endif /* C help for Ctags and Etags */
625 634
626 static char *Cplusplus_suffixes [] = 635 static char *Cplusplus_suffixes [] =
627 { "C", "c++", "cc", "cpp", "cxx", "H", "h++", "hh", "hpp", "hxx", 636 { "C", "c++", "cc", "cpp", "cxx", "H", "h++", "hh", "hpp", "hxx",
628 "M", /* Objective C++ */ 637 "M", /* Objective C++ */
629 "pdb", /* Postscript with C syntax */ 638 "pdb", /* Postscript with C syntax */
630 NULL }; 639 NULL };
631 static char Cplusplus_help [] = 640 static char Cplusplus_help [] =
632 "In C++ code, all the tag constructs of C code are tagged. (Use\n\ 641 "In C++ code, all the tag constructs of C code are tagged. (Use\n\
633 --help --lang=c --lang=c++ for full help.)\n\ 642 --help --lang=c --lang=c++ for full help.)\n\
634 In addition to C tags, member functions are also recognized. Member\n\ 643 In addition to C tags, member functions are also recognized. Member\n\
635 variables are recognized unless you use the `--no-members' option.\n\ 644 variables are also recognized if you use the `--members' option.\n\
636 Tags for variables and functions in classes are named `CLASS::VARIABLE'\n\ 645 Tags for variables and functions in classes are named `CLASS::VARIABLE'\n\
637 and `CLASS::FUNCTION'. `operator' definitions have tag names like\n\ 646 and `CLASS::FUNCTION'. `operator' definitions have tag names like\n\
638 `operator+'."; 647 `operator+'.";
639 648
640 static char *Cjava_suffixes [] = 649 static char *Cjava_suffixes [] =
725 defined in the default package is `main::SUB'."; 734 defined in the default package is `main::SUB'.";
726 735
727 static char *PHP_suffixes [] = 736 static char *PHP_suffixes [] =
728 { "php", "php3", "php4", NULL }; 737 { "php", "php3", "php4", NULL };
729 static char PHP_help [] = 738 static char PHP_help [] =
730 "In PHP code, tags are functions, classes and defines. Unless you use\n\ 739 "In PHP code, tags are functions, classes and defines. When using\n\
731 the `--no-members' option, vars are tags too."; 740 the `--members' option, vars are tags too.";
732 741
733 static char *plain_C_suffixes [] = 742 static char *plain_C_suffixes [] =
734 { "pc", /* Pro*C file */ 743 { "pc", /* Pro*C file */
735 NULL }; 744 NULL };
736 745
968 Create tag entries for global variables in some languages."); 977 Create tag entries for global variables in some languages.");
969 else 978 else
970 puts ("--no-globals\n\ 979 puts ("--no-globals\n\
971 Do not create tag entries for global variables in some\n\ 980 Do not create tag entries for global variables in some\n\
972 languages. This makes the tags file smaller."); 981 languages. This makes the tags file smaller.");
973 puts ("--no-members\n\ 982 puts ("--members\n\
974 Do not create tag entries for members of structures\n\ 983 Create tag entries for members of structures in some languages.");
975 in some languages.");
976 984
977 puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ 985 puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\
978 Make a tag for each line matching a regular expression pattern\n\ 986 Make a tag for each line matching a regular expression pattern\n\
979 in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ 987 in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\
980 files only. REGEXFILE is a file containing one REGEXP per line.\n\ 988 files only. REGEXFILE is a file containing one REGEXP per line.\n\
1208 is small. */ 1216 is small. */
1209 argbuffer = xnew (argc, argument); 1217 argbuffer = xnew (argc, argument);
1210 1218
1211 /* 1219 /*
1212 * If etags, always find typedefs and structure tags. Why not? 1220 * If etags, always find typedefs and structure tags. Why not?
1213 * Also default to find macro constants, enum constants, struct 1221 * Also default to find macro constants, enum constants and
1214 * members and global variables. 1222 * global variables.
1215 */ 1223 */
1216 if (!CTAGS) 1224 if (!CTAGS)
1217 { 1225 {
1218 typedefs = typedefs_or_cplusplus = constantypedefs = TRUE; 1226 typedefs = typedefs_or_cplusplus = constantypedefs = TRUE;
1219 globals = TRUE; 1227 globals = TRUE;
3400 } 3408 }
3401 else if (/* cplpl && */ *lp == '/') 3409 else if (/* cplpl && */ *lp == '/')
3402 { 3410 {
3403 c = '\0'; 3411 c = '\0';
3404 } 3412 }
3405 break; 3413 break;
3406 case '%': 3414 case '%':
3407 if ((c_ext & YACC) && *lp == '%') 3415 if ((c_ext & YACC) && *lp == '%')
3408 { 3416 {
3409 /* Entering or exiting rules section in yacc file. */ 3417 /* Entering or exiting rules section in yacc file. */
3410 lp++; 3418 lp++;