Blame lib/sh-quote.h

Packit 33f14e
/* Shell quoting.
Packit 33f14e
   Copyright (C) 2001-2002, 2004, 2009-2017 Free Software Foundation, Inc.
Packit 33f14e
   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
Packit 33f14e
Packit 33f14e
   This program is free software: you can redistribute it and/or modify
Packit 33f14e
   it under the terms of the GNU General Public License as published by
Packit 33f14e
   the Free Software Foundation; either version 3 of the License, or
Packit 33f14e
   (at your option) any later version.
Packit 33f14e
Packit 33f14e
   This program is distributed in the hope that it will be useful,
Packit 33f14e
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 33f14e
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 33f14e
   GNU General Public License for more details.
Packit 33f14e
Packit 33f14e
   You should have received a copy of the GNU General Public License
Packit 33f14e
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 33f14e
Packit 33f14e
#ifndef _SH_QUOTE_H
Packit 33f14e
#define _SH_QUOTE_H
Packit 33f14e
Packit 33f14e
/* When passing a command to a shell, we must quote the program name and
Packit 33f14e
   arguments, since Unix shells interpret characters like " ", "'", "<", ">",
Packit 33f14e
   "$", '*', '?' etc. in a special way.  */
Packit 33f14e
Packit 33f14e
#include <stddef.h>
Packit 33f14e
Packit 33f14e
#ifdef __cplusplus
Packit 33f14e
extern "C" {
Packit 33f14e
#endif
Packit 33f14e
Packit 33f14e
/* Returns the number of bytes needed for the quoted string.  */
Packit 33f14e
extern size_t shell_quote_length (const char *string);
Packit 33f14e
Packit 33f14e
/* Copies the quoted string to p and returns the incremented p.
Packit 33f14e
   There must be room for shell_quote_length (string) + 1 bytes at p.  */
Packit 33f14e
extern char * shell_quote_copy (char *p, const char *string);
Packit 33f14e
Packit 33f14e
/* Returns the freshly allocated quoted string.  */
Packit 33f14e
extern char * shell_quote (const char *string);
Packit 33f14e
Packit 33f14e
/* Returns a freshly allocated string containing all argument strings, quoted,
Packit 33f14e
   separated through spaces.  */
Packit 33f14e
extern char * shell_quote_argv (char * const *argv);
Packit 33f14e
Packit 33f14e
#ifdef __cplusplus
Packit 33f14e
}
Packit 33f14e
#endif
Packit 33f14e
Packit 33f14e
#endif /* _SH_QUOTE_H */