diff options
author | Jim Meyering <jim@meyering.net> | 2004-04-04 06:51:11 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-04-04 06:51:11 +0000 |
commit | 8c5584a1513cdbf62e8ed51c69053db4aae44682 (patch) | |
tree | 33f6842b5ab8d3e40869af4574990cfe15c3e50e /lib/quotearg.h | |
parent | fef16409575921ce744f360ed21800a6207d9f8f (diff) | |
download | coreutils-8c5584a1513cdbf62e8ed51c69053db4aae44682.tar.xz |
Sync from gnulib.
Diffstat (limited to 'lib/quotearg.h')
-rw-r--r-- | lib/quotearg.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/lib/quotearg.h b/lib/quotearg.h index efc933173..2bbf38d92 100644 --- a/lib/quotearg.h +++ b/lib/quotearg.h @@ -1,6 +1,6 @@ /* quotearg.h - quote arguments for output - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -27,13 +27,31 @@ /* Basic quoting styles. */ enum quoting_style { - literal_quoting_style, /* --quoting-style=literal */ - shell_quoting_style, /* --quoting-style=shell */ - shell_always_quoting_style, /* --quoting-style=shell-always */ - c_quoting_style, /* --quoting-style=c */ - escape_quoting_style, /* --quoting-style=escape */ - locale_quoting_style, /* --quoting-style=locale */ - clocale_quoting_style /* --quoting-style=clocale */ + /* Output names as-is (ls --quoting-style=literal). */ + literal_quoting_style, + + /* Quote names for the shell if they contain shell metacharacters + or would cause ambiguous output (ls --quoting-style=shell). */ + shell_quoting_style, + + /* Quote names for the shell, even if they would normally not + require quoting (ls --quoting-style=shell-always). */ + shell_always_quoting_style, + + /* Quote names as for a C language string (ls --quoting-style=c). */ + c_quoting_style, + + /* Like c_quoting_style except omit the surrounding double-quote + characters (ls --quoting-style=escape). */ + escape_quoting_style, + + /* Like clocale_quoting_style, but quote `like this' instead of + "like this" in the default C locale (ls --quoting-style=locale). */ + locale_quoting_style, + + /* Like c_quoting_style except use quotation marks appropriate for + the locale (ls --quoting-style=clocale). */ + clocale_quoting_style }; /* For now, --quoting-style=literal is the default, but this may change. */ @@ -81,6 +99,11 @@ size_t quotearg_buffer (char *buffer, size_t buffersize, char const *arg, size_t argsize, struct quoting_options const *o); +/* Like quotearg_buffer, except return the result in a newly allocated + buffer. It is the caller's responsibility to free the result. */ +char *quotearg_alloc (char const *arg, size_t argsize, + struct quoting_options const *o); + /* Use storage slot N to return a quoted version of the string ARG. Use the default quoting options. The returned value points to static storage that can be |