annotate doc/quote.texi @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6252
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node Quoting
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section Quoting
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16236
diff changeset
4 @c Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc.
7134
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
5
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
6 @c Permission is granted to copy, distribute and/or modify this document
10762
d67664a4e01c Change license to GFDLv1.3+.
Simon Josefsson <simon@josefsson.org>
parents: 7134
diff changeset
7 @c under the terms of the GNU Free Documentation License, Version 1.3 or
7134
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
8 @c any later version published by the Free Software Foundation; with no
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
9 @c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
10 @c Texts. A copy of the license is included in the ``GNU Free
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
11 @c Documentation License'' file as part of this distribution.
0ec466622052 * check-module: Add copyright notice.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6252
diff changeset
12
6252
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 @cindex Quoting
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 @findex quote
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 @findex quotearg
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 Gnulib provides @samp{quote} and @samp{quotearg} modules to help with
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 quoting text, such as file names, in messages to the user. Here's an
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 example of using @samp{quote}:
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 @example
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <quote.h>
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 ...
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 error (0, errno, _("cannot change owner of %s"), quote (fname));
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 @end example
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 This differs from
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 @example
16236
8d0c35a0ae1d doc: fix minor quoting issues, mostly with `
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
30 error (0, errno, _("cannot change owner of '%s'"), fname);
6252
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 @end example
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 @noindent in that @code{quote} escapes unusual characters in
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 @code{fname}, e.g., @samp{'} and control characters like @samp{\n}.
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 @findex quote_n
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 However, a caveat: @code{quote} reuses the storage that it returns.
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 Hence if you need more than one thing quoted at the same time, you
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 need to use @code{quote_n}.
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 @findex quotearg_alloc
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 Also, the quote module is not suited for multithreaded applications.
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 In that case, you have to use @code{quotearg_alloc}, defined in the
038c6bc7d60a Documentation about quote and quotearg modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 @samp{quotearg} module, which is decidedly less convenient.