1 | /* gshell.h - Shell-related utilities |
2 | * |
3 | * Copyright 2000 Red Hat, Inc. |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Lesser General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2.1 of the License, or (at your option) any later version. |
9 | * |
10 | * This library 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 License |
16 | * along with this library; if not, see <http://www.gnu.org/licenses/>. |
17 | */ |
18 | |
19 | #ifndef __G_SHELL_H__ |
20 | #define __G_SHELL_H__ |
21 | |
22 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) |
23 | #error "Only <glib.h> can be included directly." |
24 | #endif |
25 | |
26 | #include <glib/gerror.h> |
27 | |
28 | G_BEGIN_DECLS |
29 | |
30 | #define G_SHELL_ERROR g_shell_error_quark () |
31 | |
32 | typedef enum |
33 | { |
34 | /* mismatched or otherwise mangled quoting */ |
35 | G_SHELL_ERROR_BAD_QUOTING, |
36 | /* string to be parsed was empty */ |
37 | G_SHELL_ERROR_EMPTY_STRING, |
38 | G_SHELL_ERROR_FAILED |
39 | } GShellError; |
40 | |
41 | GLIB_AVAILABLE_IN_ALL |
42 | GQuark g_shell_error_quark (void); |
43 | |
44 | GLIB_AVAILABLE_IN_ALL |
45 | gchar* g_shell_quote (const gchar *unquoted_string); |
46 | GLIB_AVAILABLE_IN_ALL |
47 | gchar* g_shell_unquote (const gchar *quoted_string, |
48 | GError **error); |
49 | GLIB_AVAILABLE_IN_ALL |
50 | gboolean g_shell_parse_argv (const gchar *command_line, |
51 | gint *argcp, |
52 | gchar ***argvp, |
53 | GError **error); |
54 | |
55 | G_END_DECLS |
56 | |
57 | #endif /* __G_SHELL_H__ */ |
58 | |