(libintl.h): Include this if _LIBC. Otherwise include gettext.h.
(wchar.h): Include, maybe.
(attribute_hidden): Define if not defind.
(__getopt_initialized): Use attribute_hidden.
(__libc_argc, __libc_argv): Renamed from original_argc, etc.
(__getopt_nonoption_flags, nonoption_flags_max_len, nonoption_flags_len):
Conditional on USE_NONOPTION_FLAGS.
(SWAP_FLAGS): New definitions.
(exchange): Test USE_NONOPTION_FLAGS.
(_getopt_initialize): Test USE_NONOPTION_FLAGS.
(_getopt_internal): Error if argc < 1. New local var print_errors.
Improve test for ambiguous long option.
Add LIBIO support for error message output.
(NONOPTION_P): Test USE_NONOPTION_FLAGS.
(eval, display): New vars.
(longopts): Add --eval and --display.
(decode_options): Add -e and -d processing.
(print_help_and_exit): Update the usage string.
(main): Add support for --eval and --display.
auto-detection is enabled and the `::' qualifier is met.
(consider_token, C_entries): Several bugs corrected that tagged
some declarations even though --declarations was not used.
(plainc): New macro.
(C_entries): Use it.
(C_entries): Several cosmetic changes.
(C_entries): Invalidate the token is some cases.
(Ada_funcs): Do not tag "use type Xxxx;".
New language HTML.
(make_tag): Never generate null length tag names.
(linebuffer_init): Renamed from initbuffer. All callers changed.
(pattern): Structure renamed to `regexp', member regex renamed to
pattern.
(node_st): Member pat renamed to regex.
(pattern); New member force_explicit_name, for future use. Now
always set to true, cannot be reset.
(add_regex, regex_tag_multiline, readline): Use it.
(main): Free some global structures.
(fdesc): New member `written'.
(readline, process_file): Initialise it.
(put_entries): Set it.
(main): Use it to create entries for files without tags.
(total_size_of_entries): Do not count invalid tags.
(etags_strcasecmp): Like BSD's, for compatibility.
(strcaseeq): Make it into a macro.
which are almost always unnamed. etags.el looks for an explicit
tag name, then for an implicit one. See make_tag for details.
The change is both forwards and backwards compatible.
(make_tag): New function (was the disabled function new_pfnote).
(make_C_tag): Use it.
(arg_type): at_icregexp label removed (obsolete).
(pattern): New member multi_line for multi-line regexps.
(filebuf): A global buffer containing the whole file as a string
for multi-line regexp matching.
(need_filebuf): Global flag raised if multi-line regexps used.
(print_help): Document new regexp modifiers, remove references to
obsolete option --ignore-case-regexp.
(main): Do not set regexp syntax and translation table here.
(main): Treat -c option as a backward compatibility hack.
(main, find_entries): Init and free filebuf.
(find_entries): Call regex_tag_multiline after the regular parser.
(scan_separators): Check for untermintaed regexp and return NULL.
(analyse_regex, add_regex): Remove the ignore_case argument, which
is now a modifier to the regexp. All callers changed.
(add_regex): Manage the regexp modifiers.
(regex_tag_multiline): New function. Reads from filebuf.
(readline_internal): If necessary, copy the whole file into filebuf.
(readline): Skip multi-line regexps, leave them to regex_tag_multiline.
(add_regex): Better check for null regexps.
(readline): Check for regex matching null string.
(find_entries): Reorganisation.
sequences supported by gcc.
(find_entries): rewind unconditionally.
(find_entries): Do not call language functions directly, now calls
itself.
(find_entries): Do general initialisations here.
(CNL_SAVE_DEFINEDEF, C_entries, LOOP_ON_INPUT_LINES, F_getit)
(Ada_getit, Pascal_functions, Pascal_functions)
(prolog_skip_comment): Do not do them here.
(readline_internal): Increment lineno here.
(readline): Conditionally undo readline_internal increment.
(readline): Do not return a value.
(STDIN): New constant.
(parsing_stdin): New flag.
(longopts): New option --parse-stdin=NAME.
(print_help): Document it.
(main): Handle it.
(process_file): Split into process_file and process_file_name.
(process_file_name): New function.
(TEX_defenv): Now contains more contructs.
(TEX_cmt): Make it a static char and move it before TeX_commands.
(TeX_commands): Shorten the tag to the brace after the name.
(TeX_commands): Names now include the initial backslash.
(TeX_commands): Names do not include numeric args #n.
(TeX_commands): Correct line char number in tags.
(TEX_tabent, TEX_token): Deleted.
(TeX_commands, TEX_decode_env): Streamlined.
inadvertently lost on 2002-04-13.
* etags.c (main): Use `sort -o TAGFILE TAGFILE' instead of
`sort TAGFILE -o TAGFILE', as POSIX 1003.1-2001 disallows
the latter usage.
inadvertently lost on 2002-04-13.
(main): Use `sort -o TAGFILE TAGFILE' instead of `sort TAGFILE -o
TAGFILE', as POSIX 1003.1-2001 disallows the latter usage.
(main): New argument -d, for specifying directory.
(usage): Document.
(get_user_id): Compute
(get_home_dir): Deleted.
(get_prefix): New function, taken from main.
(main): Check whether or not we are running setuid. Move prefix
computation to get_prefix. Don't call getpwent; we don't need to
any more. Instead, move it to get_user_id().
(process_file): Print the tags from the nodes as soon as
possible, and delete the nodes. This brings down the memory
occupancy as etags to almost the same level as when the #line
directives were not parsed.
(free_fdesc): New function.
(find_entries): Use it.
(invalidate_nodes): In etags mode, do not just mark the nodes as
invalid, do delete them.
(strcaseeq): New function.
(get_language_from_filename): Use it to do a case insenstitive
comparison if called with appropriate args.
(find_entries): Try with case insensitive match.
(process_file): Bug fixed.
the command line, in either order.
* etags.c (find_entries): Delete tags previously obtained from
file xxx.c's #line directives when parsing file xxx.y. This is
generally done for automatically generated files containing
#line directives. This handles the case when xxx.y is tagged
before xxx.c, and the entries of xxx.c pointing to xxx.y should
be discarded.
(language): Added the metasource member. Initializers changed.
(invalidate_nodes): New function.
(readline): Discard lines after having found a #line
directive pointing to an already tagged file. This handles the
case when xxx.y is tagged before xxx.c, and the entries of
xxx.c pointing to xxx.y should be discarded.
(fdesc): New structure for keeping track of input files.
(fdesc): Remove `file' member (a string) and use instead a pointer
to a file description structure.
(curfile, curfiledir, curtagfname, curlang, nocharno,
forced_lang): Global variables removed in favor of fdhead and
curfdp, pointers to file description strucures.
(longopts, main, print_help): Use the CTAGS conditional to include
or exclude options that work on etags or ctags only.
(process_file, find_entries, pfnote, add_node, put_entries,
readline): Use fdhead and curfdp.
(process_file, find_entries): Do not take an arg string, all
callers changed.
* etags.c (longopts, print_help, main): Test CTAGS to disallow
options that are not right for either etags or ctags.
* etags.c (number_len, total_size_of_entries): Define them also
in CTAGS mode, because gcc does not compile all refs away.
(MAX_DATA_LEN, MAX_SCORES): New.
(SCORE_FILE_PREFIX): If HAVE_SHARED_GAME_DIR is not defined,
default to ~/.emacs.d/games.
(get_user_id): Don't zero uid in the case where we can't get the
username.
(lose): New function.
(main): Actually use `max', and default it to MAX_SCORES.
Correctly handle new default for SCORE_FILE_PREFIX. Use `lose'
function.
(read_score): Handle the case of reading unamelen characters, then
finishing. Use mktemp if mkstemp isn't available.
(lock_file, unlock_file): Delete unused versions.
(lock_file): Always sleep, even if we unlinked the lock file.
(get_user_id): Take struct passwd as an argument.
(get_home_dir): New function.
(main): Read in user information here. Discover home directory if
necessary.
(read_score): Trim newline only in `getline' case.
(struct score_entry): Add username field.
(push_score): Use it.
(get_user_id): New function.
(main): Don't malloc excessively.
(main): Use username field.
(read_score): Read it.
(push_score): Handle it.
(write_scores) Write it.
(read_score): Handle arbitrary length data.
(Python_functions, PHP_functions): Name tags, for ctags' sake.
(TeX_commands): Name tags. Correction of old disabled code.
* etags.c (curfiledir, curtagfname): New global variables.
(process_file): Initialise them.
(readline): Canonicalize the name found in #line directive.
(no_line_directive): New global var; set it for old behaviour.
(main): Remove some #ifdef in the getopt switch.
(add_node, put_entries): Code added to merge different chunks of
nodes referring to the same file. Currently the tags are just
appended, without any check for duplicates.
(Perl_functions): Do not special case ctags.
(readline): Identify #line directives and do the right thing.
(nocharno, invalidcharno): New global vars.
(process_file): Reset nocharno.
(readline): Set nocharno.
(pfnote): Read nocharno and maybe put invalidcharno in node.
(total_size_of_entries, put_entries): Use invalidcharno.
* etags.c: Keep the whole tag table in memory, even in etags mode.
(main): Call put_entries here even in CTAGS mode.
(main, process_file): Check the return values of fclose and pclose.
(process_file): Do not call put_entries after parsing each file.
(process_file): Canonicalise file names even for ctags.
(process_file): Set curfile here...
(find_entries): ... not here any more.
(add_node): In etags mode, build a linked list of entries (on
right pointer) for each file, and link the first entry of each
file on left nodes.
(put_entries): Print here the name of the file.
(put_entries): Print the entries starting from the first file.
(number_len, total_size_of_entries): Define these only iin etags
mode, make the second work only on the right nodes.
* etags.c: Make all global variables static.
(AWK, TMPDIR): Work around portability problem in broken shells that
don't understand `: ${VAR=val}'.
(SORT_K_OPTIONS): New var, for hosts that conform to POSIX 1003.1-2001.
Prefer the new -k option to the traditional +M -N option.
(AWK, TMPDIR): Work around portability problem in broken shells that
don't understand `: ${VAR=val}'.
(SORT_K_OPTIONS): New var, for hosts that conform to POSIX 1003.1-2001.
Prefer the new -k option to the traditional +M -N option.
* etags.c (Perl_functions): Tag packages and use them in sub tags.
(get_tag): Return a pointer to the tag that is found.
general cleanup and streamlining
* etags.c (LOOKING_AT): Use !intoken instead of iswhite.
(F_takeprec): Renamed from takeprec. All callers changed.
(F_getit): Renamed from getit. All callers changed.
(nocase_tail): Renamed from tail. All callers changed.
(Ada_getit): Renamed from adagetit. All callers changed.
(L_getit): Simplified by using get_tag.
(Perl_functions, Postscript_functions, erlang_attribute): Use the
modified LOOKING_AT.
(notinname): Removed '[' and added ')' to the recognised chars.
(LOOKING_AT, get_tag, PHP_functions): Use notinname.
(Ada_getit, Ada_funcs, Python_functions, Scheme_functions):
Clarified, using strneq or notinname.
(L_isdef, L_isquote): Removed.
(Lisp_functions, L_getit): Clarified.
changes for standalone compilation
* etags.c: (P_): Renamed to __P for consistency with config.h.
[HAVE_CONFIG_H]: Let config.h deal with __P.
[__STDC__] [!HAVE_CONFIG_H]: Define PTR as in config.h.
[!__STDC__] [!HAVE_CONFIG_H]: Do not undefine static, because
gperf code needs it.
[HAVE_CONFIG_H] [!PTR]: Define PTR (for use with Xemacs).
[HAVE_CONFIG_H] [!__P]: Define __P (for use with Xemacs).
(xmalloc, xrealloc): Use PTR instead of long *.
(bool): Make it a define, not a typedef, for C++ compilers.
(pattern): Members renamed to avoid name clash in some C++ compilers.
(get_language_from_langname): Use const argument.