summaryrefslogtreecommitdiffstats
path: root/libidu/walker.c
Commit message (Collapse)AuthorAgeFilesLines
* tighten scope in libidu/, tooJim Meyering2008-05-171-1/+2
| | | | | | | | | | | | | | | | | | Mark with "extern" the symbols that belong that way. Make the others static. * libidu/dynvec.h (dv_fill): * libidu/fnprint.c (cw_dlink): * libidu/hash.h (qsort_cmp_t): * libidu/idfile.h (io_func_t): * libidu/scanners.c (lang_args_obstack, languages_0, languages_N): (language_help_me, language_getopt, get_language): (lang_args_index): * libidu/walker.c (largest_member_file): * maint.mk (extract_char, today): * src/fid.c (long_options): * src/fnid.c (cw_dlink): * src/lid.c (cw_dlink): * src/xtokid.c (cw_dlink):
* make more functions staticJim Meyering2008-05-171-62/+76
|
* Remove unnecessary test before "free".Jim Meyering2008-01-301-2/+1
| | | | | * libidu/walker.c (get_current_dir_link): Remove "if (xcwd)" just before "free (xcwd);".
* Allocate safely.Jim Meyering2008-01-301-4/+5
| | | | | | | | * libidu/dynvec.c (make_dynvec, dynvec_freeze, dynvec_append): Use xnmalloc, not xmalloc (n * sizeof T). Use xnrealloc, not xrealloc (p, n * sizeof T). * libidu/walker.c (append_strings_to_vector, vectorize_string): Likewise. * libidu/scanners.c (tokenize_args_string): Likewise.
* Use xstrdup, not strdup.Jim Meyering2008-01-301-1/+1
| | | | | | | | | * src/lid.c (get_editor_argv): Use xstrdup, not strdup. * libidu/walker.c (get_current_dir_link): Likewise. * libidu/idfile.c: Include "xalloc.h". (locate_id_file_name): Handle failed strdup. * libidu/scanners.c (parse_args_text, parse_args_perl): Likewise. (parse_args_c, parse_args_asm): Likewise.
* Mark diagnostics for translation.Jim Meyering2008-01-141-2/+2
| | | | | | | | * src/mkid.c (main): Mark with _(...). * libidu/walker.c (exclude_languages, include_languages): Likewise. * src/lid.c (report_grep): Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
* Don't include <strsep.h>. Now it's guaranteed to be in <string.h>.Jim Meyering2008-01-041-2/+1
| | | | | | | | * libidu/walker.c: Don't include <strsep.h>. * libidu/idfile.c: Likewise. * libidu/scanners.c: Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
* License upgrade to "GPL-3 or later"Pedro J. Ruiz Lopez2007-08-171-4/+4
|
* * add missing checks for terminal-related include filesClaudio Fontana2006-07-221-1/+1
|
* * provide replacement for lstat in a convoluted way,Claudio Fontana2006-07-221-1/+9
| | | | to workaround AC_REPLACE_FUNC / gnulib shortcomings
* * applied savannah patch #5165, fix for when HAVE_LINK is 0.Claudio Fontana2006-06-261-1/+7
|
* * started to address portability problems in the id-utils-4.0 releaseClaudio Fontana2005-12-271-4/+6
|
* *** empty log message ***Claudio Fontana2005-11-011-70/+66
|
* Declare strsep if necessary.Jim Meyering2000-06-061-1/+8
|
* * lib/strsep.c: Add file.Greg McGary1999-04-121-8/+15
| | | | | | | | | * lib/strtok.c: Remove file. * configure.in: Check for strsep instead of strtok. * libidu/idfile.c (locate_id_file_name): Use strsep instead of strtok. * libidu/scanners.c (language_save_arg, language_save_arg, tokenize_args_string): Ditto. * libidu/walker.c (append_strings_to_vector, vectorize_string): Ditto.
* * walker.c (classify_link): Only return 0 for zero-length files.Greg McGary1999-04-111-3/+3
| | | | | | Keep directories, no matter what their size. DOS always returns zero size for directories. [From tbisp@uswest.net]
* Add __P to declGreg McGary1999-04-061-1/+1
|
* * libidu/idfile.h (largest_member_file): Add variable decl.Greg McGary1999-04-061-5/+11
| | | | | | | | | | | | | | | | (MAX_LARGEST_MEMBER_FILE): Add constant. * libidu/scanners.h (scanner_buffer): Add variable decl. * libidu/scanners.c (scanner_buffer): Rename from id_0. * libidu/walker.c (largest_member_file): Add veriable defn. (walk_flink): Maintain largest_member_file. Call print_member_file. (maybe_get_member_file): Don't call print_member_file. (classify_link): Return 0 if file size is zero. * src/mkid.c (scan_files): Report size of largest file. Cap scanner_buffer size at MAX_LARGEST_MEMBER_FILE. Allocate scanner_buffer. * src/xtokid.c (scan_files): Cap scanner_buffer size at MAX_LARGEST_MEMBER_FILE. Allocate scanner_buffer.
* Update copyright notices for 1999Greg McGary1999-04-041-1/+1
|
* * Version 3.2c released.Greg McGary1999-04-041-0/+14
| | | | | | | | | | | | | * libidu/id-file.h (walker_verbose_flag): Add extern variable decl. * libidu/scanners.c (SCAN_CPP_DIRECTIVE): Add macro. (get_token_c, get_token_asm): Call SCAN_CPP_DIRECTIVE. * libidu/walker.c (walker_verbose_flag): Add variable defn. (print_member_file): Add function. (maybe_get_member_file): Call print_member_file in verbose mode. * src/mkid.c: Add coments. (ceil_log_2): Add function. (main): Handle 'V' option for extra verbosity. (scan_files): Use MAX (1M, n*lg(n)*64) to estimate initial size of token hash table.
* * libidu/idfile.h (struct member_file) [mf_index]: ChangeGreg McGary1999-03-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type to long. * libidu/scanners.h (MAX_LEVELS): Remove constant. (struct token) [tok_hits, tok_name]: Remove members. [tok_hits_name]: Add member. (TOKEN_HITS, TOKEN_NAME, OFFSETOF_TOKEN_NAME): Add macros. * libidu/scanners.c (log_8_member_files): Add variable definition. (get_token_c, get_token_asm, get_token_text): Use OFFSETOF_TOKEN_NAME. * libidu/walker.c (mark_member_file_links) [new_index]: Change variable type to long. * src/idx.c (scan_member_file): Use TOKEN_NAME. * src/mkid.c (ceil_log_8) Add function. (current_hits_signature): Change variable type to (char *). (main) [log_8_member_files]: Initialize new variable. [current_hits_signature] Allocate storage. (scan_member_file): Print member->mf_index as long. (scan_member_file_1, write_id_file, token_hash_1, token_hash_2, token_hash_cmp, token_qsort_cmp, summarize, write_hits): use TOKEN_NAME & TOKEN_HITS. (init_hits_signature, write_hits): Replace MAX_LEVELS with log_8_member_files. * src/xtokid.c (scan_member_file): Use TOKEN_NAME. * libidu/idfile.h (vectorize_string) [delimiter_class]: Declare as pointer to const. * libidu/walker.c (append_strings_to_vector, vectorize_string) [delimiter_class]: Declare as pointer to const. (white_space): Declare as array of const.
* * libidu/hash.c (hash_insert): hash_insert_at no longerGreg McGary1999-03-281-3/+5
| | | | | | | | | returns old contents, but rather the new slot address. (hash_insert_at): Return slot address of inserted item. * libidu/walker.c (get_member_file): return member. (get_link_from_dirent, get_link_from_string): Conform to new hash_insert_at API, where return value is slot address of newly inserted item.
* * libidu/fnprint.c (print_filenames): Move ALLOCA outside loop.Greg McGary1998-11-201-4/+3
| | | | | | | | libidu/walker.c (get_lang_args): Ditto. src/fnid.c (main): Ditto. src/lid.c (report_grep, search_flinkv): Ditto. src/mkid.c (scan_member_file): Consolidate two ALLOCA buffers at inner scopes to a single buffer at an outer scope.
* Initial revisionGreg McGary1997-04-181-0/+1130