Deleted Added
full compact
quotearg.h (131447) quotearg.h (133543)
1/* quotearg.h - quote arguments for output
2
1/* quotearg.h - quote arguments for output
2
3 Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software
3 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software
4 Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,

--- 10 unchanged lines hidden (view full) ---

22#ifndef QUOTEARG_H_
23# define QUOTEARG_H_ 1
24
25# include <stddef.h>
26
27/* Basic quoting styles. */
28enum quoting_style
29 {
4 Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,

--- 10 unchanged lines hidden (view full) ---

22#ifndef QUOTEARG_H_
23# define QUOTEARG_H_ 1
24
25# include <stddef.h>
26
27/* Basic quoting styles. */
28enum quoting_style
29 {
30 literal_quoting_style, /* --quoting-style=literal */
31 shell_quoting_style, /* --quoting-style=shell */
32 shell_always_quoting_style, /* --quoting-style=shell-always */
33 c_quoting_style, /* --quoting-style=c */
34 escape_quoting_style, /* --quoting-style=escape */
35 locale_quoting_style, /* --quoting-style=locale */
36 clocale_quoting_style /* --quoting-style=clocale */
30 /* Output names as-is (ls --quoting-style=literal). */
31 literal_quoting_style,
32
33 /* Quote names for the shell if they contain shell metacharacters
34 or would cause ambiguous output (ls --quoting-style=shell). */
35 shell_quoting_style,
36
37 /* Quote names for the shell, even if they would normally not
38 require quoting (ls --quoting-style=shell-always). */
39 shell_always_quoting_style,
40
41 /* Quote names as for a C language string (ls --quoting-style=c). */
42 c_quoting_style,
43
44 /* Like c_quoting_style except omit the surrounding double-quote
45 characters (ls --quoting-style=escape). */
46 escape_quoting_style,
47
48 /* Like clocale_quoting_style, but quote `like this' instead of
49 "like this" in the default C locale (ls --quoting-style=locale). */
50 locale_quoting_style,
51
52 /* Like c_quoting_style except use quotation marks appropriate for
53 the locale (ls --quoting-style=clocale). */
54 clocale_quoting_style
37 };
38
39/* For now, --quoting-style=literal is the default, but this may change. */
40# ifndef DEFAULT_QUOTING_STYLE
41# define DEFAULT_QUOTING_STYLE literal_quoting_style
42# endif
43
44/* Names of quoting styles and their corresponding values. */

--- 31 unchanged lines hidden (view full) ---

76 size of the output, not counting the terminating null.
77 If BUFFERSIZE is too small to store the output string, return the
78 value that would have been returned had BUFFERSIZE been large enough.
79 If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
80size_t quotearg_buffer (char *buffer, size_t buffersize,
81 char const *arg, size_t argsize,
82 struct quoting_options const *o);
83
55 };
56
57/* For now, --quoting-style=literal is the default, but this may change. */
58# ifndef DEFAULT_QUOTING_STYLE
59# define DEFAULT_QUOTING_STYLE literal_quoting_style
60# endif
61
62/* Names of quoting styles and their corresponding values. */

--- 31 unchanged lines hidden (view full) ---

94 size of the output, not counting the terminating null.
95 If BUFFERSIZE is too small to store the output string, return the
96 value that would have been returned had BUFFERSIZE been large enough.
97 If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
98size_t quotearg_buffer (char *buffer, size_t buffersize,
99 char const *arg, size_t argsize,
100 struct quoting_options const *o);
101
102/* Like quotearg_buffer, except return the result in a newly allocated
103 buffer. It is the caller's responsibility to free the result. */
104char *quotearg_alloc (char const *arg, size_t argsize,
105 struct quoting_options const *o);
106
84/* Use storage slot N to return a quoted version of the string ARG.
85 Use the default quoting options.
86 The returned value points to static storage that can be
87 reused by the next call to this function with the same value of N.
88 N must be nonnegative. */
89char *quotearg_n (int n, char const *arg);
90
91/* Equivalent to quotearg_n (0, ARG). */

--- 23 unchanged lines hidden ---
107/* Use storage slot N to return a quoted version of the string ARG.
108 Use the default quoting options.
109 The returned value points to static storage that can be
110 reused by the next call to this function with the same value of N.
111 N must be nonnegative. */
112char *quotearg_n (int n, char const *arg);
113
114/* Equivalent to quotearg_n (0, ARG). */

--- 23 unchanged lines hidden ---