58
58
<div class="refsynopsisdiv" title="Synopsis">
59
59
<a name="glib-Commandline-option-parser.synopsis"></a><h2>Synopsis</h2>
60
60
<pre class="synopsis">
61
62
#include <glib.h>
63
64
enum <a class="link" href="glib-Commandline-option-parser.html#GOptionError" title="enum GOptionError">GOptionError</a>;
64
#define <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ERROR:CAPS" title="G_OPTION_ERROR">G_OPTION_ERROR</a>
65
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc" title="GOptionArgFunc ()">*GOptionArgFunc</a>) (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *option_name,
66
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *value,
67
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> data,
68
<a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
65
#define <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ERROR--CAPS" title="G_OPTION_ERROR">G_OPTION_ERROR</a>
66
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc" title="GOptionArgFunc ()">*GOptionArgFunc</a>) (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *option_name,
67
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *value,
68
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
69
<a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
69
70
<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a>;
70
<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-new" title="g_option_context_new ()">g_option_context_new</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *parameter_string);
71
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary" title="g_option_context_set_summary ()">g_option_context_set_summary</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
72
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *summary);
73
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-summary" title="g_option_context_get_summary ()">g_option_context_get_summary</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context);
74
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description" title="g_option_context_set_description ()">g_option_context_set_description</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
75
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *description);
76
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-description" title="g_option_context_get_description ()">g_option_context_get_description</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context);
77
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * (<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">*GTranslateFunc</a>) (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *str,
78
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> data);
79
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func" title="g_option_context_set_translate_func ()">g_option_context_set_translate_func</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
80
<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()"><span class="returnvalue">GTranslateFunc</span></a> func,
81
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> data,
82
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()"><span class="returnvalue">GDestroyNotify</span></a> destroy_notify);
83
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translation-domain" title="g_option_context_set_translation_domain ()">g_option_context_set_translation_domain</a>
84
(<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
85
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *domain);
86
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free" title="g_option_context_free ()">g_option_context_free</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context);
87
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()">g_option_context_parse</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
88
<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a> *argc,
89
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> ***argv,
90
<a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
91
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled" title="g_option_context_set_help_enabled ()">g_option_context_set_help_enabled</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
92
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> help_enabled);
93
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-help-enabled" title="g_option_context_get_help_enabled ()">g_option_context_get_help_enabled</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context);
94
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options" title="g_option_context_set_ignore_unknown_options ()">g_option_context_set_ignore_unknown_options</a>
95
(<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
96
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> ignore_unknown);
97
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-ignore-unknown-options" title="g_option_context_get_ignore_unknown_options ()">g_option_context_get_ignore_unknown_options</a>
98
(<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context);
99
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-help" title="g_option_context_get_help ()">g_option_context_get_help</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
100
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> main_help,
101
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group);
71
<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-new" title="g_option_context_new ()">g_option_context_new</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *parameter_string);
72
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary" title="g_option_context_set_summary ()">g_option_context_set_summary</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
73
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *summary);
74
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-summary" title="g_option_context_get_summary ()">g_option_context_get_summary</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);
75
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description" title="g_option_context_set_description ()">g_option_context_set_description</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
76
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *description);
77
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-description" title="g_option_context_get_description ()">g_option_context_get_description</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);
78
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * (<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">*GTranslateFunc</a>) (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *str,
79
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
80
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func" title="g_option_context_set_translate_func ()">g_option_context_set_translate_func</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
81
<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">GTranslateFunc</a> func,
82
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
83
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy_notify);
84
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translation-domain" title="g_option_context_set_translation_domain ()">g_option_context_set_translation_domain</a>
85
(<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
86
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain);
87
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free" title="g_option_context_free ()">g_option_context_free</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);
88
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()">g_option_context_parse</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
89
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *argc,
90
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> ***argv,
91
<a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
92
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled" title="g_option_context_set_help_enabled ()">g_option_context_set_help_enabled</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
93
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> help_enabled);
94
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-help-enabled" title="g_option_context_get_help_enabled ()">g_option_context_get_help_enabled</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);
95
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options" title="g_option_context_set_ignore_unknown_options ()">g_option_context_set_ignore_unknown_options</a>
96
(<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
97
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> ignore_unknown);
98
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-ignore-unknown-options" title="g_option_context_get_ignore_unknown_options ()">g_option_context_get_ignore_unknown_options</a>
99
(<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);
100
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-help" title="g_option_context_get_help ()">g_option_context_get_help</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
101
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> main_help,
102
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
102
103
enum <a class="link" href="glib-Commandline-option-parser.html#GOptionArg" title="enum GOptionArg">GOptionArg</a>;
103
104
enum <a class="link" href="glib-Commandline-option-parser.html#GOptionFlags" title="enum GOptionFlags">GOptionFlags</a>;
104
#define <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING:CAPS" title="G_OPTION_REMAINING">G_OPTION_REMAINING</a>
105
#define <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING--CAPS" title="G_OPTION_REMAINING">G_OPTION_REMAINING</a>
105
106
<a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a>;
106
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-main-entries" title="g_option_context_add_main_entries ()">g_option_context_add_main_entries</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
107
const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry"><span class="returnvalue">GOptionEntry</span></a> *entries,
108
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *translation_domain);
107
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-main-entries" title="g_option_context_add_main_entries ()">g_option_context_add_main_entries</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
108
const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a> *entries,
109
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *translation_domain);
109
110
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a>;
110
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-group" title="g_option_context_add_group ()">g_option_context_add_group</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
111
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group);
112
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-main-group" title="g_option_context_set_main_group ()">g_option_context_set_main_group</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
113
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group);
114
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-main-group" title="g_option_context_get_main_group ()">g_option_context_get_main_group</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context);
115
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()">g_option_group_new</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *name,
116
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *description,
117
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *help_description,
118
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> user_data,
119
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()"><span class="returnvalue">GDestroyNotify</span></a> destroy);
120
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-group-free" title="g_option_group_free ()">g_option_group_free</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group);
121
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-group-add-entries" title="g_option_group_add_entries ()">g_option_group_add_entries</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
122
const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry"><span class="returnvalue">GOptionEntry</span></a> *entries);
123
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">*GOptionParseFunc</a>) (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
124
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
125
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> data,
126
<a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
127
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-parse-hooks" title="g_option_group_set_parse_hooks ()">g_option_group_set_parse_hooks</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
128
<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()"><span class="returnvalue">GOptionParseFunc</span></a> pre_parse_func,
129
<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()"><span class="returnvalue">GOptionParseFunc</span></a> post_parse_func);
130
<span class="returnvalue">void</span> (<a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc" title="GOptionErrorFunc ()">*GOptionErrorFunc</a>) (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="returnvalue">GOptionContext</span></a> *context,
131
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
132
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> data,
133
<a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="returnvalue">GError</span></a> **error);
134
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-error-hook" title="g_option_group_set_error_hook ()">g_option_group_set_error_hook</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
135
<a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc" title="GOptionErrorFunc ()"><span class="returnvalue">GOptionErrorFunc</span></a> error_func);
136
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translate-func" title="g_option_group_set_translate_func ()">g_option_group_set_translate_func</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
137
<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()"><span class="returnvalue">GTranslateFunc</span></a> func,
138
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a> data,
139
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()"><span class="returnvalue">GDestroyNotify</span></a> destroy_notify);
140
<span class="returnvalue">void</span> <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain" title="g_option_group_set_translation_domain ()">g_option_group_set_translation_domain</a>
141
(<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> *group,
142
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *domain);
111
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-group" title="g_option_context_add_group ()">g_option_context_add_group</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
112
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
113
void <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-main-group" title="g_option_context_set_main_group ()">g_option_context_set_main_group</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
114
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
115
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-main-group" title="g_option_context_get_main_group ()">g_option_context_get_main_group</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);
116
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> * <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()">g_option_group_new</a> (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *name,
117
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *description,
118
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *help_description,
119
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
120
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy);
121
void <a class="link" href="glib-Commandline-option-parser.html#g-option-group-free" title="g_option_group_free ()">g_option_group_free</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
122
void <a class="link" href="glib-Commandline-option-parser.html#g-option-group-add-entries" title="g_option_group_add_entries ()">g_option_group_add_entries</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
123
const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a> *entries);
124
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">*GOptionParseFunc</a>) (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
125
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
126
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
127
<a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
128
void <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-parse-hooks" title="g_option_group_set_parse_hooks ()">g_option_group_set_parse_hooks</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
129
<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">GOptionParseFunc</a> pre_parse_func,
130
<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">GOptionParseFunc</a> post_parse_func);
131
void (<a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc" title="GOptionErrorFunc ()">*GOptionErrorFunc</a>) (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
132
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
133
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
134
<a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
135
void <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-error-hook" title="g_option_group_set_error_hook ()">g_option_group_set_error_hook</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
136
<a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc" title="GOptionErrorFunc ()">GOptionErrorFunc</a> error_func);
137
void <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translate-func" title="g_option_group_set_translate_func ()">g_option_group_set_translate_func</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
138
<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">GTranslateFunc</a> func,
139
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
140
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy_notify);
141
void <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain" title="g_option_group_set_translation_domain ()">g_option_group_set_translation_domain</a>
142
(<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
143
const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain);
145
146
<div class="refsect1" title="Description">
962
1006
G_OPTION_FLAG_IN_MAIN = 1 << 1,
963
1007
G_OPTION_FLAG_REVERSE = 1 << 2,
964
1008
G_OPTION_FLAG_NO_ARG = 1 << 3,
965
G_OPTION_FLAG_FILENAME = 1 << 4,
1009
G_OPTION_FLAG_FILENAME = 1 << 4,
966
1010
G_OPTION_FLAG_OPTIONAL_ARG = 1 << 5,
967
1011
G_OPTION_FLAG_NOALIAS = 1 << 6
971
1015
Flags which modify individual options.</p>
972
1018
<div class="variablelist"><table border="0">
973
1019
<col align="left" valign="top">
976
<td><p><a name="G-OPTION-FLAG-HIDDEN:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_HIDDEN</code></span></p></td>
1022
<td><p><a name="G-OPTION-FLAG-HIDDEN--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_HIDDEN</code></span></p></td>
977
1023
<td> The option doesn't appear in <code class="option">--help</code>
982
<td><p><a name="G-OPTION-FLAG-IN-MAIN:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_IN_MAIN</code></span></p></td>
1028
<td><p><a name="G-OPTION-FLAG-IN-MAIN--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_IN_MAIN</code></span></p></td>
983
1029
<td> The option appears in the main section of the
984
1030
<code class="option">--help</code> output, even if it is defined in a group.
988
<td><p><a name="G-OPTION-FLAG-REVERSE:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_REVERSE</code></span></p></td>
989
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-NONE:CAPS"><code class="literal">G_OPTION_ARG_NONE</code></a> kind, this flag
1034
<td><p><a name="G-OPTION-FLAG-REVERSE--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_REVERSE</code></span></p></td>
1035
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-NONE--CAPS"><code class="literal">G_OPTION_ARG_NONE</code></a> kind, this flag
990
1036
indicates that the sense of the option is reversed.
994
<td><p><a name="G-OPTION-FLAG-NO-ARG:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_NO_ARG</code></span></p></td>
995
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a> kind,
1040
<td><p><a name="G-OPTION-FLAG-NO-ARG--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_NO_ARG</code></span></p></td>
1041
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a> kind,
996
1042
this flag indicates that the callback does not take any argument
997
(like a <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-NONE:CAPS"><code class="literal">G_OPTION_ARG_NONE</code></a> option). Since 2.8
1043
(like a <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-NONE--CAPS"><code class="literal">G_OPTION_ARG_NONE</code></a> option). Since 2.8
1001
<td><p><a name="G-OPTION-FLAG-FILENAME:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_FILENAME</code></span></p></td>
1002
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>
1047
<td><p><a name="G-OPTION-FLAG-FILENAME--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_FILENAME</code></span></p></td>
1048
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>
1003
1049
kind, this flag indicates that the argument should be passed to the
1004
1050
callback in the GLib filename encoding rather than UTF-8. Since 2.8
1008
<td><p><a name="G-OPTION-FLAG-OPTIONAL-ARG:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_OPTIONAL_ARG</code></span></p></td>
1009
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>
1054
<td><p><a name="G-OPTION-FLAG-OPTIONAL-ARG--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_OPTIONAL_ARG</code></span></p></td>
1055
<td> For options of the <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>
1010
1056
kind, this flag indicates that the argument supply is optional. If no argument
1011
1057
is given then data of <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()"><code class="literal">GOptionParseFunc</code></a> will be set to NULL. Since 2.8
1015
<td><p><a name="G-OPTION-FLAG-NOALIAS:CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_NOALIAS</code></span></p></td>
1061
<td><p><a name="G-OPTION-FLAG-NOALIAS--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_NOALIAS</code></span></p></td>
1016
1062
<td> This flag turns off the automatic conflict resolution
1017
1063
which prefixes long option names with <code class="literal">groupname-</code> if
1018
1064
there is a conflict. This option should only be used in situations where
1101
1152
<col align="left" valign="top">
1104
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-NONE:CAPS"><code class="literal">G_OPTION_ARG_NONE</code></a></span></p></td>
1155
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-NONE--CAPS"><code class="literal">G_OPTION_ARG_NONE</code></a></span></p></td>
1105
1156
<td><p><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><code class="literal">gboolean</code></a></p></td>
1108
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING:CAPS"><code class="literal">G_OPTION_ARG_STRING</code></a></span></p></td>
1159
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING--CAPS"><code class="literal">G_OPTION_ARG_STRING</code></a></span></p></td>
1109
1160
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>*</p></td>
1112
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-INT:CAPS"><code class="literal">G_OPTION_ARG_INT</code></a></span></p></td>
1163
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-INT--CAPS"><code class="literal">G_OPTION_ARG_INT</code></a></span></p></td>
1113
1164
<td><p><a class="link" href="glib-Basic-Types.html#gint" title="gint"><code class="literal">gint</code></a></p></td>
1116
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME:CAPS"><code class="literal">G_OPTION_ARG_FILENAME</code></a></span></p></td>
1167
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME--CAPS"><code class="literal">G_OPTION_ARG_FILENAME</code></a></span></p></td>
1117
1168
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>*</p></td>
1120
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING-ARRAY:CAPS"><code class="literal">G_OPTION_ARG_STRING_ARRAY</code></a></span></p></td>
1121
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>**</p></td>
1124
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME-ARRAY:CAPS"><code class="literal">G_OPTION_ARG_FILENAME_ARRAY</code></a></span></p></td>
1125
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>**</p></td>
1128
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-DOUBLE:CAPS"><code class="literal">G_OPTION_ARG_DOUBLE</code></a></span></p></td>
1171
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING-ARRAY--CAPS"><code class="literal">G_OPTION_ARG_STRING_ARRAY</code></a></span></p></td>
1172
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>**</p></td>
1175
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME-ARRAY--CAPS"><code class="literal">G_OPTION_ARG_FILENAME_ARRAY</code></a></span></p></td>
1176
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>**</p></td>
1179
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-DOUBLE--CAPS"><code class="literal">G_OPTION_ARG_DOUBLE</code></a></span></p></td>
1129
1180
<td><p><a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><code class="literal">gdouble</code></a></p></td>
1133
If <em class="parameter"><code>arg</code></em> type is <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING:CAPS"><code class="literal">G_OPTION_ARG_STRING</code></a> or <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME:CAPS"><code class="literal">G_OPTION_ARG_FILENAME</code></a> the location
1184
If <em class="parameter"><code>arg</code></em> type is <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING--CAPS"><code class="literal">G_OPTION_ARG_STRING</code></a> or <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME--CAPS"><code class="literal">G_OPTION_ARG_FILENAME</code></a> the location
1134
1185
will contain a newly allocated string if the option was given. That string
1135
1186
needs to be freed by the callee using <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>. Likewise if <em class="parameter"><code>arg</code></em> type is
1136
<a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING-ARRAY:CAPS"><code class="literal">G_OPTION_ARG_STRING_ARRAY</code></a> or <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME-ARRAY:CAPS"><code class="literal">G_OPTION_ARG_FILENAME_ARRAY</code></a>, the data should
1187
<a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-STRING-ARRAY--CAPS"><code class="literal">G_OPTION_ARG_STRING_ARRAY</code></a> or <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-FILENAME-ARRAY--CAPS"><code class="literal">G_OPTION_ARG_FILENAME_ARRAY</code></a>, the data should
1137
1188
be freed using <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a>.
1141
<td><p><span class="term">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GOptionEntry.description"></a>description</code></em>;</span></p></td>
1192
<td><p><span class="term">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *<em class="structfield"><code>description</code></em>;</span></p></td>
1142
1193
<td> the description for the option in <code class="option">--help</code>
1143
1194
output. The <em class="parameter"><code>description</code></em> is translated using the <em class="parameter"><code>translate_func</code></em> of the
1144
1195
group, see <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain" title="g_option_group_set_translation_domain ()"><code class="function">g_option_group_set_translation_domain()</code></a>.
1148
<td><p><span class="term">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GOptionEntry.arg-description"></a>arg_description</code></em>;</span></p></td>
1199
<td><p><span class="term">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *<em class="structfield"><code>arg_description</code></em>;</span></p></td>
1149
1200
<td> The placeholder to use for the extra argument parsed
1150
1201
by the option in <code class="option">--help</code>
1151
1202
output. The <em class="parameter"><code>arg_description</code></em> is translated using the <em class="parameter"><code>translate_func</code></em> of the