3 quotestrdup, quoterunestrdup, unquotestrdup, unquoterunestrdup, quotestrfmt, quoterunestrfmt, quotefmtinstall, doquote, needsrcquote \- quoted character strings
10 char *quotestrdup(char *s)
13 Rune *quoterunestrdup(Rune *s)
16 char *unquotestrdup(char *s)
19 Rune *unquoterunestrdup(Rune *s)
25 int quoterunestrfmt(Fmt*)
28 void quotefmtinstall(void)
34 int needsrcquote(int c)
37 These routines manipulate character strings, either adding or removing
39 In the quoted form, the strings are in the style of
41 with single quotes surrounding the string.
42 Embedded single quotes are indicated by a doubled single quote.
55 The empty string is represented by two quotes,
58 The first four functions act as variants of
63 freshly allocated copy of the string, created using
66 returns a quoted copy of
72 with the quotes evaluated.
75 versions of these functions do the same for
80 The string returned by
84 has the following properties:
87 If the original string
89 is empty, the returned string is
95 contains no quotes, blanks, or control characters,
96 the returned string is identical to
102 needs quotes to be added, the first character of the returned
103 string will be a quote.
116 If it is non-nil, characters are passed to that function to see if they should
118 This mechanism allows programs to specify that
119 characters other than blanks, control characters, or quotes be quoted.
120 Regardless of the return value of
122 blanks, control characters, and quotes are always quoted.
126 function that flags any character special to
134 formatting routines that produce quoted strings as output.
135 They may be installed by hand, but
137 installs them under the standard format characters
141 (They are not installed automatically.)
142 If the format string includes the alternate format character
146 the printed string will always be quoted; otherwise quotes will only be provided if necessary
152 statements so the compiler can type-check uses of
160 .B /usr/local/plan9/src/libc/port/quote.c
162 .B /usr/local/plan9/src/libc/fmt/fmtquote.c