annotate lib/sh-quote.h @ 7581:45c727466eb8

Move stat.h-substitute stuff from lib/stat-macros.h to lib/stat_.h. stat-macros.h is now for our own macros, whereas stat_h is for macros in the <sys/stat.h> name space. * lib/stat-macros.h: Remove copyright notice, as this file is now tiny. (STAT_MACROS_H): Remove. (S_IFMT, S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISLNK, S_ISNAM): (S_ISMPB, S_ISMPC, S_ISNWK, S_ISREG, S_ISSOCK, S_ISDOOR, S_ISPORT): (S_TYPEISMQ, S_TYPEISTMO, S_TYPEISSEM, S_TYPEISSHM, S_ISCTG, S_ISOFD): (S_ISOFL, S_ISWHT, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IRGRP): (S_IROTH, S_IWUSR, S_IWGRP, S_IWOTH, S_IXUSR, S_IXGRP, S_IXOTH): (S_IRWXU, S_IRWXG, S_IRWXO, S_IXUGO, S_IRWXUGO): Move these macros to ... * lib/stat_.h: here. Don't include stat-macros.h. * lib/canonicalize.c: Don't include stat-macros.h. * lib/chown.c: Likewise. * lib/euidaccess.c: Likewise. * lib/file-type.c: Likewise. * lib/filemode.c: Likewise. * lib/glob.c: Likewise. * lib/isapipe.c: Likewise. * lib/lchown.c: Likewise. * lib/lstat.c: Likewise. * lib/mkdir-p.c: Likewise. * lib/rmdir.c: Likewise. * m4/lchown.m4 (gl_FUNC_LCHOWN): Don't require gl_STAT_MACROS. * m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Don't check for io.h unless mkdir isn't declared, to speed up 'configure'. Always create sys/stat.h, since it's unlikely any real sys/stat.h would define all the S_* symbols. * modules/canonicalize (Depends-on): Depend on sys_stat, not stat-macros. * modules/chown: Likewise. * modules/euidaccess: Likewise. * modules/filemode: Likewise. * modules/file-type: Likewise. * modules/glob: Likewise. * modules/isapipe: Likewise. * modules/lchown: Likewise. * modules/lstat: Likewise. * modules/mkancesdirs: Likewise. * modules/rmdir: Likewise. * modules/mkdir-p (Depends-on): Also depend on sys_stat. * modules/modechange: Likewise. * modules/stat-macros (Files): Remove m4/stat-macros.m4. (configure.ac): Remove gl_STAT_MACROS. * modules/sys_stat (Depends-on): Remove stat-macros.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 27 Oct 2006 20:46:43 +0000
parents a48fb0e98c8c
children bbbbbf4cd1c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5598
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Shell quoting.
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 Copyright (C) 2001-2002, 2004 Free Software Foundation, Inc.
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <haible@clisp.cons.org>, 2001.
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 any later version.
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
5848
a48fb0e98c8c *** empty log message ***
Paul Eggert <eggert@cs.ucla.edu>
parents: 5598
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
5598
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 /* When passing a command to a shell, we must quote the program name and
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 arguments, since Unix shells interpret characters like " ", "'", "<", ">",
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 "$" etc. in a special way. */
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <stddef.h>
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 /* Returns the number of bytes needed for the quoted string. */
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 extern size_t shell_quote_length (const char *string);
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 /* Copies the quoted string to p and returns the incremented p.
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 There must be room for shell_quote_length (string) + 1 bytes at p. */
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 extern char * shell_quote_copy (char *p, const char *string);
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 /* Returns the freshly allocated quoted string. */
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 extern char * shell_quote (const char *string);
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 /* Returns a freshly allocated string containing all argument strings, quoted,
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 separated through spaces. */
09d49a2e321b New module 'sh-quote'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 extern char * shell_quote_argv (char **argv);