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