summaryrefslogtreecommitdiff
path: root/src/od.c
AgeCommit message (Collapse)Author
2005-06-16Rather than this: error (..., "...`%s'...", arg);Jim Meyering
do this: error (..., "...%s...", quote (arg));
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-26Remove posixver.h and its uses.Paul Eggert
(short_options): New constant, which always supports -w[num]. (COMMON_SHORT_OPTIONS): Remove.
2005-04-11(check_and_close): Don't assume fopen does not return stdin.Paul Eggert
2005-03-17Use VERIFY macro in place of an equivalent open-coded declaration.Jim Meyering
2004-09-28(format_address_paren): c is optional, so don't output it if it's '\0'.Paul Eggert
2004-09-06Several changes for POSIX and FreeBSD compatibility.Paul Eggert
(COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X. (long_options, main): --strings is now -S, not -s. (usage): Reflect the usage changes. (parse_old_offset): Do not issue a diagnostic on failure; callers now do this as necessary. (main): Support POSIX syntax. Remove unused case 0 from getopt_long. Add support for new short options (many undocumented) for compatibility with FreeBSD. Remove FIXME for -s; it's now POSIX-compatible. Default format is now oS, not o2.
2004-08-03(FMT_BYTES_ALLOCATED): Now an enum, not a decimalPaul Eggert
constant. Do not assume PRIdMAX etc. are strings of length 3 or less. (struct tspec): Use it. fmt_string is now an array, not a pointer, as there's little point to the indirection here. (struct tspec, flag_dump_strings, traditional, flag_pseudo_start, limit_bytes_to_format, abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul, decode_one_format, open_next_file, check_and_close, decode_format_string, skip, write_block, read_char, read_block, parse_old_offset, dump, dump_strings, main): Use bool for booleans. (struct tspec): Use void *, not char *, for generic pointers. (bytes_to_oct_digits, bytes_to_signed_dec_digits, bytes_to_unsigned_dec_digits, bytes_to_hex_digits): Use char, not unsigned int, since char suffices. (print_s_char, print_char, print_s_short, print_short, print_int, print_long, print_long_long, print_float, print_double, print_long_double): Rewrite to avoid casts. These now take void * arguments, instead of char *. Use the same body for all functions, except for the choice of type. Assume C89 to simplify handling of signed char. (dump_hexl_mode_trailer, print_named_ascii, print_ascii): Rewrite to avoid casts. (print_named_ascii, print_ascii): Now takes void *, not char *. (decode_one_format): Use int for printf field widths, not unsigned int. Pass void * to subsidiary printers, not char *. Simplify handling of floating-point formats by factoring out common code dealing with precision and field width. (decode_format_string): Avoid need for temporary copy of each decoded struct tspec. (get_lcm): Remove unnecessary cast. (main): Fix bug where more than INT_MAX failed decodes were ignored.
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-05-13(print_ascii, dump_strings): Use e.g. '\a' rather thanJim Meyering
'\007', for portability to EBCDIC hosts.
2004-04-15(gcd, lcm): Remove; now in system.h.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(usage): Don't bother normalizing exit status since the arg is already the correct exit status now.
2003-11-18`od -c -w9999999' could segfaultJim Meyering
(dump): Use xnmalloc/free, not alloca.
2003-11-04(decode_format_string): Remove unnecessary casts.Jim Meyering
Use more maintainable `sizeof *var'. (main): Call decode_format_string rather than decode_one_format, now that `spec' may be NULL.
2003-11-04(decode_format_string, dump_strings): Use x2nrealloc rather than xrealloc.Jim Meyering
2003-11-04(main): Use `sizeof *var' rather than `sizeof EXPLICIT_TYPE'.Jim Meyering
The former is more maintainable and usually shorter.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-24(check_and_close, dump, dump_strings): Don't report bogus errno valueJim Meyering
after ferror discovers an output error. We don't know the proper errno value, since it might have been caused by any of a whole bunch of calls, and it might have been trashed in the meantime. Fixing this problem will require much more extensive changes; in the meantime just say "write error". (skip): If a read fails, don't retry it later, so that we report the proper errno.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-07-11(main): Enclose diagnostic in _(...).Jim Meyering
2003-06-17(main): Call initialize_main.Jim Meyering
2003-04-11Remove anachronistic casts of xmalloc,Jim Meyering
xrealloc, and xcalloc return values and of xrealloc's first argument.
2002-12-15Remove all uses of `PARAMS'.Jim Meyering
2002-09-21No longer include values.h.Jim Meyering
It was required solely for now-removed reference to BITSPERBYTE.
2002-09-17`od -t x8' used the wrong (`l'-prefixed) printf format.Jim Meyering
Likewise for the o8 and u8 formats. (ISPEC_TO_FORMAT): Define macro. (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG. Reported by Arun Sharma.
2002-09-02(skip): Add a cast to avoid warning about comparisonJim Meyering
between signed and unsigned.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-05-22[struct dummy]: Renamed. Don't rely on portability ofJim Meyering
zero-length arrays. Instead, use sizes of -1 or +1.
2002-05-14This bug was introduced with my change of 2000-10-22 (textutils-2.0.8).Jim Meyering
(ulonglong_t): Move declaration to precede new use. [enum size_spec] (N_SIZE_SPECS): New member. (width_bytes): Add initializer corresponding to ulonglong_t type. (struct assert_width_bytes_matches_size_spec_decl): Declare. Based on a patch from Tony Kocurko.
2002-02-16Include posixver.h.Jim Meyering
(usage): Document only the intersection of the old and new behaviors, to encourage portability. (short_options): Remove; no longer needed. (COMMON_SHORT_OPTIONS): New macro. (STRINGS_OPTION, WIDTH_OPTION): Remove; no longer needed. All uses changed to back to the corresponding short options. (main): Parse options using POSIX 1003.1-2001 rules if conforming to that standard. Do not warn of obsolete options.
2002-02-02Add more support for POSIX 1003.1-2001, which requires removal forJim Meyering
support of obsolete "-N" option syntax in expand, head, fold, split, tail, unexpand, uniq, and which prohibits options with optional arguments in od and pr. (usage): Document it. (main): Check for obsolete options. (short_options): New constant. New enum for long options.
2002-01-22(skip): Remove redundant check for overflow.Jim Meyering
fseeko's seek argument is already known to be in range, since it is less than the file size.
2002-01-22update copyright yearJim Meyering
2002-01-22(skip): Use fseeko rather than lseek.Jim Meyering
(Also, check for overflow when converting uintmax_t to off_t.)
2001-12-03(usage): Don't split translatable strings in the middle of a sentence.Jim Meyering
2001-12-01Reflect renaming to, and new usage of these macros:Jim Meyering
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
2001-12-01(usage): Use new macros, EMIT_HELP_DESCRIPTION and EMIT_VERSION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-23Factor out some common strings to make translation easier.Jim Meyering
Split usage strings so that --help and --version descriptions are alone in their own string. Likewise for the one that says: Mandatory arguments to long options are mandatory for short options too.
2001-11-11(struct tspec): Declare function pointer with prototype.Jim Meyering
2001-11-11(parse_old_offset): Declare to be static.Jim Meyering
2001-11-11(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-11-04(usage): Say thatJim Meyering
``Mandatory arguments to long options are mandatory for short options too.\n\''
2001-09-20(MAX_ADDRESS_LENGTH, pseudo_offset, format_address,Jim Meyering
n_bytes_to_skip, skip, format_address_none, format_address_std, format_address_paren, format_address_label, write_block, parse_old_offset, dump, dump_strings, main): Use uintmax_t, not off_t, for file addresses, so that we can handle multiple large files even if the sum of their sizes exceeds off_t limits. (print_s_char, print_char, print_s_short, print_short, print_int, print_long, print_long_long, print_float, print_double, print_long_double, dump_hexl_mode_trailer, print_named_ascii, print_ascii, decode_one_format): Use size_t, not off_t, for in-memory byte counts. (end_offset): New var. (dump, dump_strings): Use it. (main): Set it, but check for overflow while doing so. (skip): Report an error if an in-range lseek fails on a regular file, as something's seriously wrong. Check for negative regular file sizes (possible with some broken NFS implementations). (parse_old_offset): Now all offsets are valid, so return a success boolean and take a pointer to an offset as an argument. All callers changed. (dump_strings): Check for overflow when computing end_offset - string_min. (main): Remove OFF_T_MAX checks that are no longer needed. Don't bother assigning through temporary when there's no size limit to check.
2001-09-19(open_next_file): Use SETVBUF, not setbuf.Jim Meyering
(skip): Revert part of last change: use lseek, not fseek.
2001-09-19When --read-bytes=N (-N N) is used, disable input buffering inJim Meyering
the standard I/O library. Otherwise, od would read more input than requested. This could have caused problems when reading from pipes, character devices, and open file descriptors inherited from a parent process. * src/od.c (open_next_file): New function, factored out of... (skip): Adapt to use open_next_file. (read_char): Likewise. (read_block): Likewise. (main): Likewise. (dump): Fix an off-by-one error that could have made od fail to report a read error when reading from a named file (not stdin). (check_and_close): Account for the fact that in_stream may now be NULL. (usage): Correct descriptions of -j and -N options. Patch by Ian Bruce.
2001-01-02(ulonglong_t): Define place-holder type to avoid some #if directives.Jim Meyering
(LONGEST_INTEGRAL_TYPE): Remove definition. (MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of LONGEST_INTEGRAL_TYPE. (print_long_long): Compile this function even on systems without long long support. (decode_one_format): Remove #if directive.