summaryrefslogtreecommitdiff
path: root/lib/quotearg.h
Commit message (Collapse)AuthorAgeFilesLines
* quotearg: Tweak last commit.Bruno Haible2021-08-071-2/+1
| | | | * lib/quotearg.h: Don't include <stddef.h>. Remove stray semicolon.
* quotearg: improve -fanalyzer malloc checkingPaul Eggert2021-08-011-2/+7
|
* xalloc: add malloc-related function attributesPaul Eggert2021-07-311-2/+4
| | | | | | | | | | | * lib/quotearg.h, lib/xalloc.h: Include stdlib.h, for the benefit of _GL_ATTRIBUTE_DALLOC_FREE. * lib/quotearg.h (clone_quoting_options): * lib/xalloc.h (xmalloc, ximalloc, xzalloc, xizalloc, xcalloc) (xicalloc, xrealloc, xirealloc, xireallocarray, x2realloc) (x2nrealloc, xmemdup, ximemdup, xstrdup, xnmalloc, xcharalloc): Add _GL_ATTRIBUTE_DALLOC_FREE and _GL_ATTRIBUTE_RETURNS_NONNULL attributes as appropriate.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* quotearg: Use 'restrict'.Bruno Haible2020-02-231-1/+1
| | | | | * lib/quotearg.h (quotearg_buffer): Use 'restrict'. * m4/quotearg.m4 (gl_QUOTEARG): Require AC_C_RESTRICT.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* quotearg: add quotearg_n_style_colon()Pádraig Brady2015-11-041-0/+3
| | | | | | | | | | | | | This quotes with default options of the specified style, but with quoting enabled for instances of ':'. While this can be simulated by temporarily modifying the default quoting style, this is a little awkward, and care must be taken with such an implementation to avoid inlining leading to bloated text. * lib/quotearg.h (quotearg_n_style_colon): Description and declaration. * lib/quotearg.c (quotearg_n_style_colon): New function implementation.
* quotearg: constify get_quoting_style parametersPádraig Brady2015-11-031-1/+1
| | | | | * lib/quotearg.h (get_quoting_style): Mark parameter as const. * lib/quotearg.c (get_quoting_style): Likewise.
* quotearg: add support for $'' shell escapingPádraig Brady2015-11-021-0/+31
| | | | | | | | | | * lib/quotearg.h: Add "shell-escape" and "shell-escape-always" items and descriptions. * lib/quotearg.c (quotearg_buffer_restyled): Add support for the above types by quoting like "shell", but using $'...' syntax for non printable characters, which should provide unambiguous printable output for any input. * tests/test-quotearg-simple.c: Update accordingly.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* quotearg: fall back to Unicode single quotes in UTF-8 and GB-18030 localesPaolo Bonzini2012-01-071-2/+4
| | | | | | | | | | | | | | | | | | | Most programs do not have translation catalogs for English and much less separate catalogs for British and American English. Drop the suggestion to translators about these two, and provide it automatically for Unicode locales. Like most programs, even those using American English, we use single quotation marks. This conflicts with the American typographic convention, but works better when you cite the entire error message within double quotes. It also tries not to clash with established practice and with what non-gnulib programs will usually do. * lib/quotearg.c (gettext_quote): Hard-code U+2018 and U+2019 when using an UTF-8 or GB-18030 locale. The list of other locales with quotes was provided by Bruno Haible. (quotearg_buffer_restyled): Adjust instructions to translators. * lib/quotearg.h (locale_quoting_style): Do not put an example in the text, since this would be wrong when using Unicode. * modules/quotearg: Depend on c-strcaseeq.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-2/+2
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-2/+2
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* update nearly all FSF copyright year lists to include 2009Jim Meyering2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-15/+15
|
* quotearg: document limitations of quote_these_tooJoel E. Denny2009-08-231-2/+5
| | | | | | | | * lib/quotearg.c (quotearg_buffer_restyled): Add comments where those limitations are created. * lib/quotearg.h (set_char_quoting): Document that digits and letters that are special after backslash are not permitted. (quotearg_char): Cross-reference set_char_quoting documentation.
* quotearg: implement custom_quoting_styleJoel E. Denny2009-08-231-3/+84
| | | | | | | | | | | | | | | | | | | | | | * lib/quotearg.c: (struct quoting_options): Add left_quote and right_quote fields. (set_custom_quoting): New public function. (quotearg_buffer_restyled): Add left_quote and right_quote arguments, handle them very much like locale quoting, and update all uses. (quotearg_n_custom): New public function. (quotearg_n_custom_mem): New public function. (quotearg_custom): New public function. (quotearg_custom_mem): New public function. * lib/quotearg.h: Prototype and document new public functions. (enum quoting_style): For escape_quoting_style and clocale_quoting_style, comment that QA_SPLIT_TRIGRAPHS is ignored even though they're otherwise like c_quoting_style. Add custom_quoting_style member and document with comparison to clocale_quoting_style. * tests/test-quotearg.c (custom_quotes): New array. (custom_results): New array. (main): Extend to test custom quoting.
* Avoid doubling \ in common case of "c-maybe" quoting style.Eric Blake2008-02-161-1/+2
| | | | | | | | | | | | * lib/quotearg.c (quotearg_buffer_restyled): Don't escape \ when eliding outer quotes. * lib/quotearg.h: Document this. * tests/test-quotearg.c (result_strings, inputs, results_g) (flag_results, locale_results): Test it by adding a new string to each test group. (compare_strings): Test new string. Signed-off-by: Eric Blake <ebb9@byu.net>
* Avoid trigraph quoting in default output.Eric Blake2008-02-161-12/+17
| | | | | | | | | * lib/quotearg.h (enum quoting_flags): Add QA_SPLIT_TRIGRAPHS. * lib/quotearg.c (quotearg_buffer_restyled): Don't quote trigraphs unless explicitly requested. * tests/test-quotearg.c (flag_results, main): Add additional tests. Signed-off-by: Eric Blake <ebb9@byu.net>
* Quotearg part 4: add tests, fix c-maybe colon quoting.Eric Blake2008-02-121-9/+104
| | | | | | | | | | | | | | * lib/quotearg.h: Improve documentation. * lib/quotearg.c (quotearg_buffer_restyled): Don't add extra escapes when adding outer quotes. When quoting trigraphs, use valid C notation. When quoting NUL, omit extra characters if next character is not digit. Alter prototype. (quotearg_buffer, quotearg_alloc_mem, quotearg_n_options): Adjust callers. * modules/quotearg-tests: New module. * tests/test-quotearg.c: New test. Signed-off-by: Eric Blake <ebb9@byu.net>
* Quotearg part 3: add flag to control outer quote elision.Eric Blake2008-02-121-9/+31
| | | | | | | | | | | * lib/quotearg.h (c_maybe_quoting_style): New style. (enum quoting_flags): Better documentation of flags. * lib/quotearg.c (quoting_style_args, quoting_style_vals): Add c-maybe style. (quotearg_buffer_restyled): Handle new flag to elide outer quotes. Signed-off-by: Eric Blake <ebb9@byu.net>
* Quotearg part 2: add flag that can control NUL elision.Eric Blake2008-02-121-10/+26
| | | | | | | | | | | | | * lib/quotearg.h (set_quoting_flags): New prototype. * lib/quotearg.c (struct quoting_options): Add flag field. (set_quoting_flags): New function. (quotearg_buffer_restyled): Add flags parameter. (quotearg_alloc_mem): Set the flag if length cannot be returned. (quotearg_n_options): Set the flag, since length cannot be returned. (quoting_options_from_style): Default flags correctly. Signed-off-by: Eric Blake <ebb9@byu.net>
* Quotearg part 1: more wrappers, restore quotearg_char state.Eric Blake2008-02-121-2/+29
| | | | | | | | | | | | | * lib/quotearg.h (quotearg_alloc_mem, quotearg_n_mem) (quotearg_mem, quotearg_style_mem, quotearg_char_mem) (quotearg_colon_mem): New wrappers. * lib/quotearg.c (quotearg_alloc, quotearg_char): Rewrite... (quotearg_alloc_mem, quotearg_char_mem): ...in terms of these new functions. (quotearg_n_mem, quotearg_mem, quotearg_style_mem) (quotearg_colon_mem): New functions. Signed-off-by: Eric Blake <ebb9@byu.net>
* Change copyright notice from GPLv2+ to GPLv3+.Bruno Haible2007-10-071-5/+4
|
* * lib/quotearg.h (quotearg_free): New decl.Paul Eggert2006-11-081-2/+5
| | | | | | * lib/quotearg.c (quotearg_free): New function. (slot0, nslots, slotvec0, slotvec): Now file-scope so that quotearg_free can get at them.
* *** empty log message ***Paul Eggert2005-05-141-1/+1
|
* Merge from coreutils.Paul Eggert2004-08-071-1/+1
|
* New function quotearg_alloc. Treat { } = as special sometimes.Paul Eggert2004-02-051-8/+31
| | | | Work around bug in multibyte handling in older shells.
* Allow multiple inclusion by surrounding withPaul Eggert2002-11-231-29/+29
| | | | | | "#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t, so that we can be included first. (PARAMS): Remove; we now assume C89 or later. All uses removed.
* (quotearg_n_style_mem): New function.Jim Meyering2002-01-221-1/+6
|
* (quotearg_n, quotearg_n_style):Jim Meyering2001-11-281-3/+2
| | | | First arg is int, not unsigned.
* (enum quoting style): New enum clocale_quoting_style.Jim Meyering2000-07-141-1/+2
|
* update copyright dateJim Meyering2000-07-091-1/+1
|
* (locale_quoting_style): New enum value.Jim Meyering1999-08-101-3/+12
| | | | (quotearg_n_style, quotearg_style): New decls.
* (quoting_style_vals): New public array.Jim Meyering1999-01-011-4/+5
|
* Update from patch-2.5.3.Jim Meyering1998-03-211-14/+16
|
* .Jim Meyering1998-02-231-0/+97