0f7fd1f3bd700bc2bf17df129cee9a36947fe07a
[platform/upstream/glib.git] / glib / gshell.h
1 /* gshell.h - Shell-related utilities
2  *
3  *  Copyright 2000 Red Hat, Inc.
4  *
5  * GLib is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * GLib is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with GLib; see the file COPYING.LIB.  If not, write
17  * to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GSHELL_H__
22 #define __GSHELL_H__
23
24 #include <gerror.h>
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
31 #define G_SHELL_ERROR g_shell_error_quark ()
32
33 typedef enum
34 {
35   /* mismatched or otherwise mangled quoting */
36   G_SHELL_ERROR_BAD_QUOTING,
37   /* string to be parsed was empty */
38   G_SHELL_ERROR_EMPTY_STRING,
39   G_SHELL_ERROR_FAILED
40 } GShellError;
41
42 GQuark g_shell_error_quark (void);
43
44 gchar*   g_shell_quote      (const gchar   *unquoted_string);
45 gchar*   g_shell_unquote    (const gchar   *quoted_string,
46                              GError       **error);
47 gboolean g_shell_parse_argv (const gchar   *command_line,
48                              gint          *argc,
49                              gchar       ***argv,
50                              GError       **error);
51
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57 #endif /* __GSHELL_H__ */
58
59