summaryrefslogtreecommitdiff
path: root/src/od.c
AgeCommit message (Collapse)Author
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.
2001-01-02(decode_one_format): Guard use of print_long_long withJim Meyering
`#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt. Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
2000-12-07(address_base): Declare to be static.Jim Meyering
2000-12-07(address_base, address_pad_len): New var.Jim Meyering
(output_address_fmt_string, address_fmt_buffer, address_pad): Remove. (flag_pseudo_start): Now int, not long int. (pseudo_offset): Now off_t, not long int. (n_specs, n_specs_allocated): Now size_t, not unsigned int. (format_address, format_address_none, format_address_std, format_address_label): Now accepts an extra char argument (an extra char to print if nonzero), and prints instead of returning a string. All callers changed. (bytes_per_block): Now size_t, not int. (format_address_none): Do not even print the extra char argument. This simplifies the callers. (format_address_std, format_address_label): Print off_t ourself instead of trying to use autoconfigured format. This is faster and more portable. (format_address_paren): New function. (dump): Remove unnecessary cast. (expand_address_fmt): Remove. (main): Use size_t, off_t, etc. instead of builtin types where this is advisable. Adjust to above changes. Remove unnecessary cast.
2000-12-03use CHAR_BIT, not BITSPERBYTEJim Meyering
2000-12-03Make od print valid addresses for offsets of 2^32 and larger. (cont'd)Jim Meyering
(MAX_ADDRESS_LENGTH): Don't hard-code as a literal. Rather, define in terms of the type, off_t. (string_min): Declare to be of type size_t. (flag_dump_strings): Declare to be of type int. (print_s_char): Declare the n_bytes parameter and the local, `i', to be of type off_t. (print_char): Likewise. (print_s_short): Likewise. (print_short): Likewise. (print_int): Likewise. (print_long): Likewise. (print_long_long): Likewise. (print_float): Likewise. (print_double): Likewise. (print_long_double): Likewise. (dump_hexl_mode_trailer): Likewise. (print_named_ascii): Likewise. (print_ascii): Likewise. (write_block): Likewise. (print_ascii): Declare local, `print_function' with a prototype. Change a few `>' comparisons to the equivalent `<' form. (parse_options): Declare `tmp' to be of type uintmax_t. Use xstrtoumax, not xstrtoul. Fail if the specified offset if larger than OFF_T_MAX. (dump_strings): Declare local `i' to be of type size_t. Remove the now-unnecessary cast-to-off_t. (main) [IF_LINT]: Initialize desired_width to avoid a warning. Declare `tmp' to be of type uintmax_t. Use xstrtoumax, not xstrtoul. Fail if minimum string length is larger than SIZE_MAX. Fail if specified width is larger than ULONG_MAX.
2000-12-03Make od print valid addresses for offsets of 2^32 and larger.Jim Meyering
(format_address): Use off_t, not long unsigned_int as the parameter type. (format_address_none): Likewise. Mark parameter as unused. (format_address_std): Likewise. (format_address_label): Likewise. (print_ascii): Mark format string parameter as unused. (write_block): Use off_t, not long unsigned_int as offset type. (expand_address_fmt): New function. (main): Use it to expand each address format string template. Reported by Mark Nudelman, via Andreas Jaeger.
2000-12-02(skip): Use lseek instead of worrying about fseeko or fseek.Jim Meyering
This should be portable, as we seek before doing any I/O. (fseeko): Remove; no longer used.
2000-11-06(skip): st_size is not defined for directories.Jim Meyering
2000-10-22Support 8-byte integers, assuming they're printable with e.g., %lld.Jim Meyering
Add support for printing data as unsigned long long integers.
2000-05-20Arrange to call close_stdout upon exit. Don't close stdout explicitly.Jim Meyering
1999-08-22(dump): Use IF_LINT macro instead of #ifdef lint...Jim Meyering
(main): Likewise.
1999-04-24Include new "xstrtol.h", not "xstrtoul.h".Jim Meyering
1999-04-13* src/od.c (MIN, MAX): Remove definitions.Jim Meyering
* src/sys2.h (MIN, MAX): Define here instead.
1999-04-04Standardize --help and --version processing.Jim Meyering
1999-04-03Use AUTHORS in place of string in parse_long_options call.Jim Meyering
1999-04-03Insert AUTHORS definition.Jim Meyering
1999-04-03Use PROGRAM_NAME in place of string in parse_long_options call.Jim Meyering
1999-04-03define PROGRAM_NAMEJim Meyering
1999-03-04Include long-options.hJim Meyering
[long_options]: Remove the "help" and "version" entries. Remove declarations of show_help and show_version. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
1999-02-16update copyright datesJim Meyering
1999-01-14Don't prototype usage as static.Jim Meyering
1999-01-01(skip, read_char, read_block) [O_BINARY]: Switch inputJim Meyering
stream to binary mode.
1998-09-19update bug-reporting addressJim Meyering
1998-06-29revert back to using lower case _unlocked wrapper namesJim Meyering
1998-06-29Change all uses of unlocked-wrapped functions to their upper case wrapper names.Jim Meyering
1998-01-10CHAR_BIT SCHAR_MAX UCHAR_MAX SHRT_MAX INT_MAX UINT_MAX LONG_MAX ULONG_MAXJim Meyering
Remove definitions of those symbols. * src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h since it now includes limit.h which defines RE_DUP_MAX. * src/nl.c: Likewise. * src/tac.c: Likewise.
1997-12-21s/__P/PARAMS/Jim Meyering
1997-11-08(fseeko): Define a stub if ! HAVE_FSEEKO.Jim Meyering
(skip): Use fseeko if available. Don't use lseek; it causes the stdio stream to become out of sync with respect to the underyling file descriptor. From Paul Eggert.
1997-10-25Remove old-style xmalloc and xrealloc decls.Jim Meyering
(decode_format_string): Cast first arg of xrealloc to char*.
1997-10-18(LONG_MAX): Define if not defined.Jim Meyering
1997-10-14(STREQ): Remove definition.Jim Meyering
1997-10-07update bug-reporting addressJim Meyering
1997-09-22[struct tspec] (hexl_mode_trailer): Rename from `trailer.'Jim Meyering
(dump_hexl_mode_trailer): Rename from dump_string_trailer. Use fputs and putchar instead of trivial or %-less printfs. (decode_one_format): Parenthesize each field_width assignment in an argument list to make the side effect a little more apparent. (write_block): Use fputs and putchar instead of trivial or %-less printfs. (dump_strings): Cast string_min to off_t to avoid long-standing warning.
1997-09-21Patch from John Kodis.Jim Meyering
1997-09-15tweak message stringsJim Meyering
1997-09-15tweak message stringsJim Meyering
1997-09-14(main) [--traditional]: Don't give diagnostic about thereJim Meyering
being more than three arguments if there are *no* arguments specified. Reported by Jochen Hein.
1997-02-09update copyrights for 1997Jim Meyering