Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 /* goption.h - Option parser
3 * Copyright (C) 2004 Anders Carlsson <andersca@gnome.org>
4 * Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __G_OPTION_H__
23 #define __G_OPTION_H__
26 #include <glib/gerror.h>
27 #include <glib/gquark.h>
31 typedef struct _GOptionContext GOptionContext;
32 typedef struct _GOptionGroup GOptionGroup;
33 typedef struct _GOptionEntry GOptionEntry;
37 G_OPTION_FLAG_HIDDEN = 1 << 0,
38 G_OPTION_FLAG_IN_MAIN = 1 << 1,
39 G_OPTION_FLAG_REVERSE = 1 << 2,
40 G_OPTION_FLAG_NO_ARG = 1 << 3,
41 G_OPTION_FLAG_FILENAME = 1 << 4,
42 G_OPTION_FLAG_OPTIONAL_ARG = 1 << 5,
43 G_OPTION_FLAG_NOALIAS = 1 << 6
51 G_OPTION_ARG_CALLBACK,
52 G_OPTION_ARG_FILENAME,
53 G_OPTION_ARG_STRING_ARRAY,
54 G_OPTION_ARG_FILENAME_ARRAY
57 typedef gboolean (*GOptionArgFunc) (const gchar *option_name,
62 typedef gboolean (*GOptionParseFunc) (GOptionContext *context,
67 typedef void (*GOptionErrorFunc) (GOptionContext *context,
72 #define G_OPTION_ERROR (g_option_error_quark ())
76 G_OPTION_ERROR_UNKNOWN_OPTION,
77 G_OPTION_ERROR_BAD_VALUE,
81 IMPORT_C GQuark g_option_error_quark (void);
86 const gchar *long_name;
93 const gchar *description;
94 const gchar *arg_description;
97 #define G_OPTION_REMAINING ""
99 IMPORT_C GOptionContext *g_option_context_new (const gchar *parameter_string);
100 IMPORT_C void g_option_context_free (GOptionContext *context);
101 IMPORT_C void g_option_context_set_help_enabled (GOptionContext *context,
102 gboolean help_enabled);
103 IMPORT_C gboolean g_option_context_get_help_enabled (GOptionContext *context);
104 IMPORT_C void g_option_context_set_ignore_unknown_options (GOptionContext *context,
105 gboolean ignore_unknown);
106 IMPORT_C gboolean g_option_context_get_ignore_unknown_options (GOptionContext *context);
108 IMPORT_C void g_option_context_add_main_entries (GOptionContext *context,
109 const GOptionEntry *entries,
110 const gchar *translation_domain);
111 IMPORT_C gboolean g_option_context_parse (GOptionContext *context,
116 IMPORT_C void g_option_context_add_group (GOptionContext *context,
117 GOptionGroup *group);
118 IMPORT_C void g_option_context_set_main_group (GOptionContext *context,
119 GOptionGroup *group);
120 IMPORT_C GOptionGroup *g_option_context_get_main_group (GOptionContext *context);
123 IMPORT_C GOptionGroup *g_option_group_new (const gchar *name,
124 const gchar *description,
125 const gchar *help_description,
127 GDestroyNotify destroy);
128 IMPORT_C void g_option_group_set_parse_hooks (GOptionGroup *group,
129 GOptionParseFunc pre_parse_func,
130 GOptionParseFunc post_parse_func);
131 IMPORT_C void g_option_group_set_error_hook (GOptionGroup *group,
132 GOptionErrorFunc error_func);
133 IMPORT_C void g_option_group_free (GOptionGroup *group);
134 IMPORT_C void g_option_group_add_entries (GOptionGroup *group,
135 const GOptionEntry *entries);
136 IMPORT_C void g_option_group_set_translate_func (GOptionGroup *group,
139 GDestroyNotify destroy_notify);
140 IMPORT_C void g_option_group_set_translation_domain (GOptionGroup *group,
141 const gchar *domain);
146 #endif /* __G_OPTION_H__ */