summaryrefslogtreecommitdiff
path: root/src/join.c
AgeCommit message (Collapse)Author
2004-09-21Remove unused "case 0".Paul Eggert
2004-06-21Standardize 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. (add_file_name, main): Likewise.
2004-04-17(add_file_name): Declare function to be `static'.Jim Meyering
2004-04-17(string_to_join_field): Declare function to be `static'.Jim Meyering
2004-03-10`join -1 x' would give a misleading diagnosticJim Meyering
(string_to_join_field): Report that a non-numeric field number is invalid, rather than `so large that it is not representable'.
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-12-30Include posixver.h.Jim Meyering
(obsolete_usage): New var. (longopts): Put obsolete options first. (OBSOLETE_LONG_OPTIONS): New constant. (get_option, add_file_name): New functions. (main): Use them to support new behavior. (usage): Remove documentation for -j1 FIELD and -j2 FIELD. Do not mark -j FIELD as obsolescent; it is longstanding UNIX tradition and is a valid extension to POSIX.
2003-12-30remove trailing blankJim Meyering
2003-12-30(add_field_list): Don't use alloca with unboundedJim Meyering
size; just modify the argument, which is no longer const *. Various other minor cleanups, mostly to avoid the need for casts. (extract_field): Renamed from ADD_FIELD, as it's now a function. (struct field.beg): Now char *, not unsigned char const *. All uses changed. It shouldn't be const since xmemcoll writes on its arguments. (extract_field): Likewise, for 2nd arg. (keycmp): Remove now-unnecessary cast of xmemcoll args. (is_blank): New function, to avoid need to cast arg to unsigned char. (extract_field): Use it. (xfields): Rewrite pretty much from scratch. (hard_LC_COLLATE): Now bool, not int. (get_line, getseq, add_field_list): Now returns bool, not int. (decode_field_spec, add_field_list): Return true on success (not false), for consistency with the rest of the code. All uses changed. (tab): Now char, not unsigned char. This wasn't 100% necessary but is slightly cleaner. (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler. (empty_filler): Now const *. (make_blank): Remove; wasn't needed. Remove all calls. (main): Don't set uni_blank.nfields; zero is fine.
2003-12-27Include "quote.h".Jim Meyering
(min, max): Remove definitions. Make a few function parameters and corresponding locals `const'. Use bool for boolean variables. Use size_t (not int) for all counters and related index variables. (prjoin): Remove now-useless assertion. (string_to_join_field): New function. (main): Accept join fields as large as SIZE_MAX. (keycmp): Rename `min' to MIN and max to MAX.
2003-12-20[struct seq]: Change types of members count and allocJim Meyering
from `int' to `size_t'.
2003-11-19(usage): Mention that FILE1 and FILE2 must be sortedJim Meyering
on the join fields. Suggestion from Bruce Robertson.
2003-11-04(ADD_FIELD, initseq, getseq): Use x2nrealloc rather than xrealloc.Jim Meyering
2003-11-04(initseq, add_field, make_blank): Use `sizeof *var' ratherJim Meyering
than `sizeof EXPLICIT_TYPE'. 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 cast of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-23(get_line): Report error right away if I/O fails,Jim Meyering
so that the proper errno value is used.
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-06-18Reflect renaming: readline -> readlinebuffer.Jim Meyering
2003-06-17(main): Call initialize_main.Jim Meyering
2003-05-13(delseq, freeline): Don't apply cast to argument of free.Jim Meyering
2003-04-11Remove anachronistic casts of xmalloc,Jim Meyering
xrealloc, and xcalloc return values and of xrealloc's first argument.
2003-02-19(usage): Change wording in --help output:Jim Meyering
use FILENUM instead of `SIDE' and say what FILENUM means.
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-04-30(keycmp): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).Jim Meyering
(hard_LC_COLLATE): Define even if ! ENABLE_NLS. (main): Always initialize hard_LC_COLLATE. Put initialization next to other locale-related stuff.
2002-01-22Include xmemcoll.h, not memcoll.h.Jim Meyering
Use xmemcoll instead of memcoll.
2002-01-21(keycmp): Don't assume that the difference between two size_t values can beJim Meyering
stored in an int; this doesn't work, for example, on 64-bit Solaris. Also, fix the type of two locals to be size_t instead of int.
2001-12-03(usage): Merge lone "\n" into adjacent string.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(make_blank): Declare to be static.Jim Meyering
(prfield): Declare local to be of type size_t, not int.
2001-11-11(make_blank): Declare to be static.Jim Meyering
2001-11-11(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2000-11-18revert mysteriously-applied last delta!Jim Meyering
2000-11-17Declare global `tab' to be of type *unsigned* char,Jim Meyering
so join works with 8-bit delimiter characters.
2000-11-16Declare global `tab' to be of type *unsigned* char,Jim Meyering
so join works with 8-bit delimiter characters. Reported by Antonio Rendas.
2000-05-20Arrange to call close_stdout upon exit. Don't close stdout explicitly.Jim Meyering
2000-02-29(make_blank): Add an explicit cast to `unsigned char *'Jim Meyering
to placate HPUX's C compiler. Reported by Bob Proulx.
1999-07-04reinclude memcoll.h (mistakenly removed by me)Jim Meyering
1999-07-04Add support for LC_COLLATE locale.Jim Meyering
Include hard-locale.h, linebuffer.h, memcoll.h. (struct line): New member `buf', replacing `beg' and `lim'. All uses changed. (hard_LC_COLLATE): New var. (main): Initialize it. (get_line): Use readline to read the line, instead of doing it by hand. That way, we get a buffer that we can pass to memcoll. (keycmp): Use memcoll to compare lines if hard_LC_COLLATE is nonzero.
1999-07-04(xfields): Only <blank>s separate fields, not <space>s.Jim Meyering
1999-05-15(xfields): Don't interpret a trailing blank as aJim Meyering
delimiter when e.g. -t: was specified. From Tim Smithers.
1999-05-03(TOLOWER): Remove definition.Jim Meyering
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