summaryrefslogtreecommitdiffstats
path: root/src/mkid.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: update copyright year ranges to include 2011Jim Meyering2011-03-201-1/+1
| | | | Run "make update-copyright".
* mkid: use ftello (not ftell) and fail if an offset is 2^32 or largerJim Meyering2010-05-091-3/+12
| | | | | | | | | This is necessary because the internal layout requires that an offset be representable as a 4-byte quantity. * src/mkid.c (write_id_file): Use ftello, not ftell. The latter would fail on files larger than 4GiB. Now, we still fail for such files, but use ftello instead -- and give a diagnostic.
* maint: update all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+2
| | | | | | Use this command: git ls-files |grep -vE '^(\..*|COPYING|gnulib)$' |xargs \ env UPDATE_COPYRIGHT_USE_INTERVALS=1 build-aux/update-copyright
* build: accommodate new syntax-check testJim Meyering2009-10-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Use EXIT_FAILURE and EXIT_SUCCESS, not 1 and 0. Apply these commands: perl -pi -e 's/\berror \(1,/error (EXIT_FAILURE,/' \ $(git grep -l '\<error (1,') perl -pi -e 's/\bexit \(1\)/exit (EXIT_FAILURE)/' \ $(git grep -l '\<exit (1)') perl -pi -e 's/\bexit \(0\)/exit (EXIT_SUCCESS)/' \ $(git grep -l '\<exit (0)') * libidu/idread.c (read_id_file, maybe_read_id_file, io_read): * libidu/idu-hash.c (hash_init): * libidu/idwrite.c (io_write): * libidu/scanners.c (parse_language_map, parse_language_map_file): (read_language_map_file): * libidu/walker.c (include_languages, exclude_languages): (get_current_dir_link): * src/fid.c (usage, help_me, main): * src/fnid.c (usage, help_me, main): * src/lid.c (usage, help_me, main, report_grep, report_edit): (query_regexp): * src/mkid.c (main, assert_writeable, write_id_file): * src/xtokid.c (help_me):
* build: avoid warning exposed by gcc-4.4.1Jim Meyering2009-09-301-2/+1
| | | | | | | | * src/fid.c (help_me): Declare with noreturn attribute. * src/fnid.c (help_me): Likewise. * src/lid.c (help_me): Likewise. * src/mkid.c (help_me): Likewise. * src/xtokid.c (help_me): Likewise.
* maint: mkid, xtokid: remove unnecessary initializationJim Meyering2009-08-311-1/+0
| | | | | * src/xtokid.c (main): Don't set "skip_file" unnecessarily. * src/mkid.c (main): Likewise.
* maint: update copyright year lists to include 2009Jim Meyering2009-08-151-1/+1
|
* rename hash.? to idu-hash.? to avoid conflict with gnulib's hash.hJim Meyering2009-08-151-1/+1
| | | | | | | | | | | | | Now that gnulib's exclude module uses gnulib's hash module, which includes a hash.h file, idutils' use of a hash.h file conflicted. Rename the one here in idutils: * libidu/idu-hash.c: Rename from hash.c. * libidu/idu-hash.h: Rename from hash.h. * libidu/idfile.h: Reflect renaming. * libidu/idread.c: Likewise. * libidu/idwrite.c: Likewise. * src/mkid.c: Likewise. * libidu/Makefile.am: Likewise.
* mkid, xtokid: read and process --files0-from= input a name at a time,Jim Meyering2009-07-041-48/+74
| | | | | | | | | | | | rather than by reading the entire input into memory and *then* processing each file name. * src/mkid.c: Include "argv-iter.h", not "readtokens0.h". (main): Rewrite to use argv-iter. * src/xtokid.c: Likewise. Include <assert.h>. * bootstrap.conf (gnulib_modules): Add argv-iter. Remove readtokens0. * libidu/iduglobal.h (STREQ): Define. (bad_cast): Define.
* remove wc-related code that doesn't apply hereJim Meyering2009-07-041-11/+0
| | | | | | * src/mkid.c: Don't handle a file name of "-" specially. * src/xtokid.c: Likewise. * testsuite/files0-from: Don't test for it.
* tests: add testing framework, and tests for the new optionJim Meyering2009-07-041-1/+1
| | | | | | | | | | | | | | | | | * NEWS (New features): Mention the new option. * src/mkid.c (main): Adjust a diagnostic. * src/xtokid.c (main): Adjust a diagnostic. * bootstrap.conf (gnulib_modules): Add perl and posix_shell * build-aux/check.mk: New file, from coreutils. * testsuite/Coreutils.pm: Likewise. * testsuite/CuTmpdir.pm: Likewise. * testsuite/check.mk: Likewise. * testsuite/envvar-check: Likewise. * testsuite/files0-from: New test, based on one from coreutils. * testsuite/Makefile.am (TESTS): Add files0-from. (TESTS_ENVIRONMENT): Remove definition. Now it's in check.mk. (EXTRA_DIST): Add Coreutils.pm CuTmpdir.pm envvar-check and check.mk. Include $(srcdir)/check.mk.
* mkid, xtokid: accept a new option --files0-from=FILEPedro J. Ruiz Lopez2009-07-041-21/+109
| | | | | | | | | * bootstrap.conf (gnulib_modules): Add quote and readtokens0. * doc/idutils.texi: Document the option. * src/mkid.c (usage, FILES0_FROM_OPTION, long_options, help_me) (main): Implement. * src/xtokid.c (usage, FILES0_FROM_OPTION, long_options, help_me) (main): Likewise.
* maint: add const attribute to a few declarationsJim Meyering2009-06-071-3/+3
| | | | | | * libidu/hash.c (hash_print_stats, hash_dump): Add const. * libidu/hash.h: Likewise. * src/mkid.c (scan_files): Likewise.
* build: suppress more warningsJim Meyering2009-04-301-2/+2
| | | | | | | | | * src/fid.c (usage): Declare with __noreturn__ attribute. * src/fnid.c (usage): Likewise. * src/lid.c (usage): Likewise. * src/mkid.c (usage): Likewise. * src/xtokid.c: (usage): Likewise. * src/mkid.c (sum_files): Remove unused macro.
* accommodate gnulib header removalsPedro J. Ruiz Lopez2008-10-221-1/+1
| | | | | | | * libidu/idfile.c: Include <sys/stat.h>, not "lstat.h". * libidu/scanners.c: Likewise. * libidu/walker.c: Likewise. * src/mkid.c: Likewise.
* avoid warnings, adjust for const-correctnessJim Meyering2008-06-241-3/+5
| | | | | | | | | | | | | | * libidu/scanners.c (long_options_c, long_options_asm) (long_options_text, long_options_perl): Add initializers. * src/fid.c (long_options): Add initializers. * src/fnid.c (long_options): Add initializers. * src/lid.c (ATTRIBUTE_UNUSED): Define. (long_options): Add initializers. (report_nothing): Mark parameter as unused. (get_editor_argv, report_edit): Adjust for const-correctness. * src/mkid.c (long_options): Add initializers. (report_statistics): Don't subtract "void*" pointers. Cast to "char*". * src/xtokid.c (long_options): Add initializers.
* remove redundant "const" in declarationsJim Meyering2008-06-241-1/+1
| | | | | | | | | | * libidu/scanners.c (languages_0, long_options_c): Likewise. (long_options_asm, long_options_text, long_options_perl): Likewise. * src/fid.c (long_options): Likewise. * src/fnid.c (long_options): Likewise. * src/lid.c (long_options): Likewise. * src/mkid.c (long_options): Likewise. * src/xtokid.c (long_options): Likewise.
* use gnulib's progname moduleJim Meyering2008-06-041-3/+2
| | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add progname. * src/mkid.c: Include "progname.h". (program_name): Remove declaration. (main): Call set_program_name rather than setting program_name. * src/fid.c: Likewise. * src/fnid.c: Likewise. * src/lid.c: Likewise. * src/xtokid.c: Likewise.
* don't ignore pre-fclose ID-file write errorJim Meyering2008-05-221-1/+1
| | | | * src/mkid.c (write_id_file): Test ferror, too.
* detect write error on stdoutJim Meyering2008-05-201-1/+3
| | | | | | | | | | * src/fid.c: Include "closeout.h". (main): Use it via atexit. * src/fnid.c (main): Likewise. * src/lid.c (main): Likewise. * src/mkid.c (main): Likewise. * src/xtokid.c (main): Likewise. * NEWS: Mention the bug fixes.
* declare many global variable to be "static"Jim Meyering2008-05-171-28/+27
| | | | | Remove the few that were thus exposed as being unused. Remove some unused prototypes.
* make functions staticJim Meyering2008-05-171-49/+53
|
* Avoid printf-format-vs-arg type mismatch warnings.Jim Meyering2008-01-301-3/+5
| | | | * src/mkid.c (report_statistics): Cast ptrdiff_t to unsigned long long.
* Replace uses of xrealloc with uses of safer variants.Jim Meyering2008-01-141-7/+11
| | | | | | | * src/mkid.c (write_id_file): Avoid risk of overflow. (make_sibling_summary, add_token_to_summary): Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
* src/mkid.c: Remove now-unused declaration of dirname.Jim Meyering2008-01-141-2/+0
| | | | Signed-off-by: Jim Meyering <meyering@redhat.com>
* Mark diagnostics for translation.Jim Meyering2008-01-141-1/+1
| | | | | | | | * 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>
* Put at least two spaces between an option and its description.Jim Meyering2008-01-141-2/+2
| | | | | | | | | help2man requires this. * src/lid.c: Add another space before the description. * src/mkid.c: Likewise. * src/xtokid.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/+1
| | | | to workaround AC_REPLACE_FUNC / gnulib shortcomings
* * fix sbrk portability issueClaudio Fontana2006-07-221-6/+15
|
* *** empty log message ***Claudio Fontana2006-07-051-1/+1
|
* * add bug report string to the help outputClaudio Fontana2006-03-051-0/+1
| | | | * src/lid.c: fix bug in pattern recognition in is_number()
* * small fixesClaudio Fontana2006-01-111-8/+7
|
* * fix bad offtostr usage (now uses return value)Claudio Fontana2006-01-081-2/+2
|
* * started to address portability problems in the id-utils-4.0 releaseClaudio Fontana2005-12-271-7/+9
|
* * implemented fix for savannah support request sr #104712 andClaudio Fontana2005-12-151-1/+16
| | | | added test case
* * added inttostr module from gnulib, used in src/mkid.c to print anClaudio Fontana2005-12-111-3/+8
| | | | off_t portably using offtostr()
* * fixed small issues and integrated perl patch.Claudio Fontana2005-12-111-2/+3
| | | | Added some missing files in po/ and updated intl/
* *** empty log message ***Claudio Fontana2005-11-011-50/+53
|
* * src/mkid.c (write_id_file): Complain if fclose fails.Greg McGary1999-04-081-1/+2
| | | | [From jbb6@acpub.duke.edu]
* * libidu/idfile.h (largest_member_file): Add variable decl.Greg McGary1999-04-061-2/+7
| | | | | | | | | | | | | | | | (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
|
* (name_tokens, number_tokens, string_tokens, literal_tokens,Greg McGary1999-04-041-12/+12
| | | | | | comment_tokens, occurrences, hits_length, tokens_length, output_length): Change type from size_t to unsigned long. (report_statistics): Fix printf formats.
* * Version 3.2c released.Greg McGary1999-04-041-6/+58
| | | | | | | | | | | | | * 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-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/fnprint.c (print_filenames): Move ALLOCA outside loop.Greg McGary1998-11-201-2/+1
| | | | | | | | 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.
* assorted bug fixesGreg McGary1997-07-231-2/+3
|
* imported from id-utils-3.1r3_1Greg McGary1997-04-181-89/+124
|
* Initial revisionGreg McGary1997-04-181-0/+794