~ubuntu-branches/debian/jessie/glib2.0/jessie

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Commandline-option-parser.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mto: (1.4.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 70.
  • Revision ID: james.westby@ubuntu.com-20090215130043-6snh45flhit8oalb
Tags: upstream-2.18.4
Import upstream version 2.18.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Commandline option parser</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GLib Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
9
9
<link rel="prev" href="glib-Shell-related-Utilities.html" title="Shell-related Utilities">
10
10
<link rel="next" href="glib-Glob-style-pattern-matching.html" title="Glob-style pattern matching">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
26
26
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
27
27
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
28
28
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
 
29
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
29
30
</head>
30
31
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
31
32
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Glob-style-pattern-matching.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
39
</tr>
39
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3182473" class="shortcut">Top</a>
40
 
                  &#160;|&#160;
41
 
                  <a href="#id3183551" class="shortcut">Description</a></nobr></td></tr>
 
40
<tr><td colspan="5" class="shortcuts">
 
41
<a href="#glib-Commandline-option-parser.synopsis" class="shortcut">Top</a>
 
42
                 | 
 
43
                <a href="#glib-Commandline-option-parser.description" class="shortcut">Description</a>
 
44
</td></tr>
42
45
</table>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Commandline-option-parser"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
46
49
<td valign="top">
47
 
<h2>
48
 
<a name="id3182473"></a><span class="refentrytitle">Commandline option parser</span>
49
 
</h2>
50
 
<p>Commandline option parser &#8212; parses commandline options</p>
 
50
<h2><span class="refentrytitle"><a name="glib-Commandline-option-parser.top_of_page"></a>Commandline option parser</span></h2>
 
51
<p>Commandline option parser — parses commandline options</p>
51
52
</td>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
55
 
<h2>Synopsis</h2>
 
56
<a name="glib-Commandline-option-parser.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
57
58
 
58
59
#include &lt;glib.h&gt;
59
60
 
60
 
 
61
 
enum                <a class="link" href="glib-Commandline-option-parser.html#GOptionError">GOptionError</a>;
62
 
#define             <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ERROR:CAPS">G_OPTION_ERROR</a>
63
 
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (<a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc">*GOptionArgFunc</a>)                   (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *option_name,
64
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *value,
65
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
66
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);
67
 
                    <a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a>;
68
 
<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a>*     <a class="link" href="glib-Commandline-option-parser.html#g-option-context-new">g_option_context_new</a>                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *parameter_string);
69
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary">g_option_context_set_summary</a>        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
70
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *summary);
71
 
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-summary">g_option_context_get_summary</a>        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);
72
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description">g_option_context_set_description</a>    (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
73
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *description);
74
 
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-description">g_option_context_get_description</a>    (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);
75
 
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        (<a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc">*GTranslateFunc</a>)                   (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
76
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
77
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func">g_option_context_set_translate_func</a> (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
78
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc">GTranslateFunc</a> func,
79
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
80
 
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_notify);
81
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translation-domain">g_option_context_set_translation_domain</a>
82
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
83
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain);
84
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free">g_option_context_free</a>               (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);
85
 
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse">g_option_context_parse</a>              (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
86
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *argc,
87
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> ***argv,
88
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);
89
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled">g_option_context_set_help_enabled</a>   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
90
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> help_enabled);
91
 
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-help-enabled">g_option_context_get_help_enabled</a>   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);
92
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options">g_option_context_set_ignore_unknown_options</a>
93
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
94
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> ignore_unknown);
95
 
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-ignore-unknown-options">g_option_context_get_ignore_unknown_options</a>
96
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);
97
 
<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-help">g_option_context_get_help</a>           (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
98
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> main_help,
99
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);
100
 
enum                <a class="link" href="glib-Commandline-option-parser.html#GOptionArg">GOptionArg</a>;
101
 
enum                <a class="link" href="glib-Commandline-option-parser.html#GOptionFlags">GOptionFlags</a>;
102
 
#define             <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING:CAPS">G_OPTION_REMAINING</a>
103
 
                    <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry">GOptionEntry</a>;
104
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-main-entries">g_option_context_add_main_entries</a>   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
105
 
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry">GOptionEntry</a> *entries,
106
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *translation_domain);
107
 
                    <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a>;
108
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-group">g_option_context_add_group</a>          (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
109
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);
110
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-main-group">g_option_context_set_main_group</a>     (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
111
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);
112
 
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a>*       <a class="link" href="glib-Commandline-option-parser.html#g-option-context-get-main-group">g_option_context_get_main_group</a>     (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);
113
 
<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a>*       <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new">g_option_group_new</a>                  (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *name,
114
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *description,
115
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *help_description,
116
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data,
117
 
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy);
118
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-group-free">g_option_group_free</a>                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);
119
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-group-add-entries">g_option_group_add_entries</a>          (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
120
 
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry">GOptionEntry</a> *entries);
121
 
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (<a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc">*GOptionParseFunc</a>)                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
122
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
123
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
124
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);
125
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-parse-hooks">g_option_group_set_parse_hooks</a>      (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
126
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc">GOptionParseFunc</a> pre_parse_func,
127
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc">GOptionParseFunc</a> post_parse_func);
128
 
void                (<a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc">*GOptionErrorFunc</a>)                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
129
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
130
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
131
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);
132
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-error-hook">g_option_group_set_error_hook</a>       (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
133
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc">GOptionErrorFunc</a> error_func);
134
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translate-func">g_option_group_set_translate_func</a>   (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
135
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc">GTranslateFunc</a> func,
136
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
137
 
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_notify);
138
 
void                <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain">g_option_group_set_translation_domain</a>
139
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
140
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain);
141
 
 
 
61
enum                <a class="link" href="glib-Commandline-option-parser.html#GOptionError" title="enum GOptionError">GOptionError</a>;
 
62
#define             <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ERROR--CAPS" title="G_OPTION_ERROR">G_OPTION_ERROR</a>
 
63
<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,
 
64
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *value,
 
65
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
66
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
67
                    <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a>;
 
68
<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);
 
69
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,
 
70
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *summary);
 
71
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);
 
72
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,
 
73
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *description);
 
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-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);
 
75
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,
 
76
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
 
77
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,
 
78
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">GTranslateFunc</a> func,
 
79
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
80
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy_notify);
 
81
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>
 
82
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
83
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain);
 
84
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);
 
85
<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,
 
86
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *argc,
 
87
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> ***argv,
 
88
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
89
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,
 
90
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> help_enabled);
 
91
<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);
 
92
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>
 
93
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
94
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> ignore_unknown);
 
95
<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>
 
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#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,
 
98
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> main_help,
 
99
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
 
100
enum                <a class="link" href="glib-Commandline-option-parser.html#GOptionArg" title="enum GOptionArg">GOptionArg</a>;
 
101
enum                <a class="link" href="glib-Commandline-option-parser.html#GOptionFlags" title="enum GOptionFlags">GOptionFlags</a>;
 
102
#define             <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING--CAPS" title="G_OPTION_REMAINING">G_OPTION_REMAINING</a>
 
103
                    <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a>;
 
104
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,
 
105
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a> *entries,
 
106
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *translation_domain);
 
107
                    <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a>;
 
108
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,
 
109
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
 
110
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,
 
111
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);
 
112
<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);
 
113
<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,
 
114
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *description,
 
115
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *help_description,
 
116
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
117
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy);
 
118
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);
 
119
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,
 
120
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a> *entries);
 
121
<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,
 
122
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
123
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
124
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
125
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,
 
126
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">GOptionParseFunc</a> pre_parse_func,
 
127
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">GOptionParseFunc</a> post_parse_func);
 
128
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,
 
129
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
130
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
131
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);
 
132
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,
 
133
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc" title="GOptionErrorFunc ()">GOptionErrorFunc</a> error_func);
 
134
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,
 
135
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">GTranslateFunc</a> func,
 
136
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
137
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy_notify);
 
138
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>
 
139
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
140
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain);
142
141
</pre>
143
142
</div>
144
143
<div class="refsect1" lang="en">
145
 
<a name="id3183551"></a><h2>Description</h2>
 
144
<a name="glib-Commandline-option-parser.description"></a><h2>Description</h2>
146
145
<p>
147
146
The GOption commandline parser is intended to be a simpler replacement for the
148
 
popt library. It supports short and long commandline options, as shown in the 
 
147
popt library. It supports short and long commandline options, as shown in the
149
148
following example:
150
149
</p>
151
150
<p>
163
162
  Long options are prefixed by two consecutive dashes.
164
163
</p></li>
165
164
<li><p>
166
 
  Options can have an extra argument, which can be a number, a string or a 
167
 
  filename. For long options, the extra argument can be appended with an 
 
165
  Options can have an extra argument, which can be a number, a string or a
 
166
  filename. For long options, the extra argument can be appended with an
168
167
  equals sign after the option name.
169
168
</p></li>
170
169
<li><p>
171
170
  Non-option arguments are returned to the application as rest arguments.
172
171
</p></li>
173
172
<li><p>
174
 
  An argument consisting solely of two dashes turns off further parsing, 
175
 
  any remaining arguments (even those starting with a dash) are returned 
 
173
  An argument consisting solely of two dashes turns off further parsing,
 
174
  any remaining arguments (even those starting with a dash) are returned
176
175
  to the application as rest arguments.
177
176
</p></li>
178
177
</ul></div>
179
178
<p>
180
179
</p>
181
180
<p>
182
 
Another important feature of GOption is that it can automatically generate 
183
 
nicely formatted help output. Unless it is explicitly turned off with 
184
 
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled"><code class="function">g_option_context_set_help_enabled()</code></a>, GOption will recognize the 
 
181
Another important feature of GOption is that it can automatically generate
 
182
nicely formatted help output. Unless it is explicitly turned off with
 
183
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled" title="g_option_context_set_help_enabled ()"><code class="function">g_option_context_set_help_enabled()</code></a>, GOption will recognize the
185
184
<code class="option">--help</code>, <code class="option">-?</code>, <code class="option">--help-all</code>
186
 
and <code class="option">--help-</code><em class="replaceable"><code>groupname</code></em> options 
187
 
(where <em class="replaceable"><code>groupname</code></em> is the name of a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>) 
 
185
and <code class="option">--help-</code><em class="replaceable"><code>groupname</code></em> options
 
186
(where <em class="replaceable"><code>groupname</code></em> is the name of a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>)
188
187
and write a text similar to the one shown in the following example to stdout.
189
188
</p>
190
189
<div class="informalexample"><pre class="screen">
191
190
Usage:
192
191
  testtreemodel [OPTION...] - test tree model performance
193
 
 
194
192
Help Options:
195
193
  -?, --help               Show help options
196
194
  --help-all               Show all help options
197
195
  --help-gtk               Show GTK+ Options
198
 
 
199
196
Application Options:
200
197
  -r, --repeats=N          Average over N repetitions
201
198
  -m, --max-size=M         Test up to 2^M items
202
199
  --display=DISPLAY        X display to use
203
200
  -v, --verbose            Be verbose
204
 
  -b, --beep               Beep when done   
 
201
  -b, --beep               Beep when done
205
202
  --rand                   Randomize the data
206
203
</pre></div>
207
204
<p>
208
 
GOption groups options in <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>s, which makes it easy to
 
205
GOption groups options in <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>s, which makes it easy to
209
206
incorporate options from multiple sources. The intended use for this is
210
207
to let applications collect option groups from the libraries it uses,
211
 
add them to their <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>, and parse all options by a single call
212
 
to <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a>. See <a
 
208
add them to their <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>, and parse all options by a single call
 
209
to <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()"><code class="function">g_option_context_parse()</code></a>. See <a
213
210
href="/usr/share/gtk-doc/html/gtk/gtk-General.html#gtk-get-option-group"
214
211
><code class="function">gtk_get_option_group()</code></a> for an example.
215
212
</p>
217
214
If an option is declared to be of type string or filename, GOption takes
218
215
care of converting it to the right encoding; strings are returned in UTF-8,
219
216
filenames are returned in the GLib filename encoding. Note that this only
220
 
works if <a class="link" href="glib-running.html#setlocale" title="Locale"><code class="function">setlocale()</code></a> has been called before <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a>.
 
217
works if <a class="link" href="glib-running.html#setlocale" title="Locale"><code class="function">setlocale()</code></a> has been called before <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()"><code class="function">g_option_context_parse()</code></a>.
221
218
</p>
222
219
<p>
223
220
Here is a complete example of setting up GOption to parse the example
229
226
static gboolean verbose = FALSE;
230
227
static gboolean beep = FALSE;
231
228
static gboolean rand = FALSE;
232
 
 
233
 
static GOptionEntry entries[] = 
 
229
static GOptionEntry entries[] =
234
230
{
235
231
  { "repeats", 'r', 0, G_OPTION_ARG_INT, &amp;repeats, "Average over N repetitions", "N" },
236
232
  { "max-size", 'm', 0, G_OPTION_ARG_INT, &amp;max_size, "Test up to 2^M items", "M" },
239
235
  { "rand", 0, 0, G_OPTION_ARG_NONE, &amp;rand, "Randomize the data", NULL },
240
236
  { NULL }
241
237
};
242
 
 
243
 
int 
 
238
int
244
239
main (int argc, char *argv[])
245
240
{
246
241
  GError *error = NULL;
247
242
  GOptionContext *context;
248
 
 
249
243
  context = g_option_context_new ("- test tree model performance");
250
244
  g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
251
245
  g_option_context_add_group (context, gtk_get_option_group (TRUE));
254
248
      g_print ("option parsing failed: %s\n", error-&gt;message);
255
249
      exit (1);
256
250
    }
257
 
 
258
251
  /* ... */
259
 
 
260
252
}
261
253
</pre></div>
262
254
</div>
263
255
<div class="refsect1" lang="en">
264
 
<a name="id3183810"></a><h2>Details</h2>
 
256
<a name="glib-Commandline-option-parser.details"></a><h2>Details</h2>
265
257
<div class="refsect2" lang="en">
266
 
<a name="id3183820"></a><h3>
267
 
<a name="GOptionError"></a>enum GOptionError</h3>
268
 
<a class="indexterm" name="id3183833"></a><pre class="programlisting">typedef enum
 
258
<a name="GOptionError"></a><h3>enum GOptionError</h3>
 
259
<pre class="programlisting">typedef enum
269
260
{
270
261
  G_OPTION_ERROR_UNKNOWN_OPTION,
271
262
  G_OPTION_ERROR_BAD_VALUE,
279
270
<col align="left" valign="top">
280
271
<tbody>
281
272
<tr>
282
 
<td><p><span class="term"><a name="G-OPTION-ERROR-UNKNOWN-OPTION:CAPS"></a><code class="literal">G_OPTION_ERROR_UNKNOWN_OPTION</code></span></p></td>
 
273
<td><p><a name="G-OPTION-ERROR-UNKNOWN-OPTION--CAPS"></a><span class="term"><code class="literal">G_OPTION_ERROR_UNKNOWN_OPTION</code></span></p></td>
283
274
<td>An option was not known to the parser.
284
275
  This error will only be reported, if the parser hasn't been instructed
285
 
  to ignore unknown options, see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options"><code class="function">g_option_context_set_ignore_unknown_options()</code></a>.
 
276
  to ignore unknown options, see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options" title="g_option_context_set_ignore_unknown_options ()"><code class="function">g_option_context_set_ignore_unknown_options()</code></a>.
286
277
</td>
287
278
</tr>
288
279
<tr>
289
 
<td><p><span class="term"><a name="G-OPTION-ERROR-BAD-VALUE:CAPS"></a><code class="literal">G_OPTION_ERROR_BAD_VALUE</code></span></p></td>
 
280
<td><p><a name="G-OPTION-ERROR-BAD-VALUE--CAPS"></a><span class="term"><code class="literal">G_OPTION_ERROR_BAD_VALUE</code></span></p></td>
290
281
<td>A value couldn't be parsed.
291
282
</td>
292
283
</tr>
293
284
<tr>
294
 
<td><p><span class="term"><a name="G-OPTION-ERROR-FAILED:CAPS"></a><code class="literal">G_OPTION_ERROR_FAILED</code></span></p></td>
295
 
<td>A <a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc"><span class="type">GOptionArgFunc</span></a> callback failed.
296
 
 
 
285
<td><p><a name="G-OPTION-ERROR-FAILED--CAPS"></a><span class="term"><code class="literal">G_OPTION_ERROR_FAILED</code></span></p></td>
 
286
<td>A <a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc" title="GOptionArgFunc ()"><span class="type">GOptionArgFunc</span></a> callback failed.
297
287
</td>
298
288
</tr>
299
289
</tbody>
301
291
</div>
302
292
<hr>
303
293
<div class="refsect2" lang="en">
304
 
<a name="id3183946"></a><h3>
305
 
<a name="G-OPTION-ERROR:CAPS"></a>G_OPTION_ERROR</h3>
306
 
<a class="indexterm" name="id3183959"></a><pre class="programlisting">#define G_OPTION_ERROR (g_option_error_quark ())
 
294
<a name="G-OPTION-ERROR--CAPS"></a><h3>G_OPTION_ERROR</h3>
 
295
<pre class="programlisting">#define G_OPTION_ERROR (g_option_error_quark ())
307
296
</pre>
308
297
<p>
309
298
Error domain for option parsing. Errors in this domain will
310
 
be from the <a class="link" href="glib-Commandline-option-parser.html#GOptionError"><span class="type">GOptionError</span></a> enumeration. See <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for information on 
 
299
be from the <a class="link" href="glib-Commandline-option-parser.html#GOptionError" title="enum GOptionError"><span class="type">GOptionError</span></a> enumeration. See <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> for information on
311
300
error domains.
312
301
</p>
313
302
</div>
314
303
<hr>
315
304
<div class="refsect2" lang="en">
316
 
<a name="id3183992"></a><h3>
317
 
<a name="GOptionArgFunc"></a>GOptionArgFunc ()</h3>
318
 
<a class="indexterm" name="id3184005"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (*GOptionArgFunc)                   (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *option_name,
319
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *value,
320
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
321
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre>
 
305
<a name="GOptionArgFunc"></a><h3>GOptionArgFunc ()</h3>
 
306
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            (*GOptionArgFunc)                   (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *option_name,
 
307
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *value,
 
308
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
309
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
322
310
<p>
323
 
The type of function to be passed as callback for <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>
 
311
The type of function to be passed as callback for <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>
324
312
options.
325
313
</p>
326
314
<div class="variablelist"><table border="0">
327
315
<col align="left" valign="top">
328
316
<tbody>
329
317
<tr>
330
 
<td><p><span class="term"><em class="parameter"><code>option_name</code></em>&#160;:</span></p></td>
 
318
<td><p><span class="term"><em class="parameter"><code>option_name</code></em> :</span></p></td>
331
319
<td>The name of the option being parsed. This will be either a 
332
320
  single dash followed by a single letter (for a short name) or two dashes
333
321
  followed by a long option name.
334
322
</td>
335
323
</tr>
336
324
<tr>
337
 
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
 
325
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
338
326
<td>The value to be parsed.
339
327
</td>
340
328
</tr>
341
329
<tr>
342
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
343
 
<td>User data added to the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> containing the option when it
344
 
  was created with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new"><code class="function">g_option_group_new()</code></a>
345
 
</td>
346
 
</tr>
347
 
<tr>
348
 
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
349
 
<td>A return location for errors. The error code <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ERROR-FAILED:CAPS"><code class="literal">G_OPTION_ERROR_FAILED</code></a>
350
 
  is intended to be used for errors in <a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc"><span class="type">GOptionArgFunc</span></a> callbacks.
351
 
</td>
352
 
</tr>
353
 
<tr>
354
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
355
 
<td>
356
 
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the option was successfully parsed, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if an error 
357
 
  occurred, in which case <em class="parameter"><code>error</code></em> should be set with <a class="link" href="glib-Error-Reporting.html#g-set-error"><code class="function">g_set_error()</code></a>
358
 
 
359
 
 
 
330
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
 
331
<td>User data added to the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> containing the option when it
 
332
  was created with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()"><code class="function">g_option_group_new()</code></a>
 
333
</td>
 
334
</tr>
 
335
<tr>
 
336
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
 
337
<td>A return location for errors. The error code <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ERROR-FAILED--CAPS"><code class="literal">G_OPTION_ERROR_FAILED</code></a>
 
338
  is intended to be used for errors in <a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc" title="GOptionArgFunc ()"><span class="type">GOptionArgFunc</span></a> callbacks.
 
339
</td>
 
340
</tr>
 
341
<tr>
 
342
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
343
<td>%TRUE if the option was successfully parsed, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error 
 
344
  occurred, in which case <em class="parameter"><code>error</code></em> should be set with <a class="link" href="glib-Error-Reporting.html#g-set-error" title="g_set_error ()"><code class="function">g_set_error()</code></a>
360
345
</td>
361
346
</tr>
362
347
</tbody>
364
349
</div>
365
350
<hr>
366
351
<div class="refsect2" lang="en">
367
 
<a name="id3184221"></a><h3>
368
 
<a name="GOptionContext"></a>GOptionContext</h3>
369
 
<a class="indexterm" name="id3184234"></a><pre class="programlisting">typedef struct _GOptionContext GOptionContext;</pre>
 
352
<a name="GOptionContext"></a><h3>GOptionContext</h3>
 
353
<pre class="programlisting">typedef struct _GOptionContext GOptionContext;</pre>
370
354
<p>
371
355
A <span class="structname">GOptionContext</span> struct defines which options
372
 
are accepted by the commandline option parser. The struct has only private 
 
356
are accepted by the commandline option parser. The struct has only private
373
357
fields and should not be directly accessed.
374
358
</p>
375
359
</div>
376
360
<hr>
377
361
<div class="refsect2" lang="en">
378
 
<a name="id3184255"></a><h3>
379
 
<a name="g-option-context-new"></a>g_option_context_new ()</h3>
380
 
<a class="indexterm" name="id3184270"></a><pre class="programlisting"><a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a>*     g_option_context_new                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *parameter_string);</pre>
 
362
<a name="g-option-context-new"></a><h3>g_option_context_new ()</h3>
 
363
<pre class="programlisting"><a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *    g_option_context_new                (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *parameter_string);</pre>
381
364
<p>
382
365
Creates a new option context. 
383
366
</p>
384
367
<p>
385
368
The <em class="parameter"><code>parameter_string</code></em> can serve multiple purposes. It can be used
386
369
to add descriptions for "rest" arguments, which are not parsed by
387
 
the <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>, typically something like "FILES" or
388
 
"FILE1 FILE2...". If you are using <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING:CAPS"><span class="type">G_OPTION_REMAINING</span></a> for
 
370
the <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>, typically something like "FILES" or
 
371
"FILE1 FILE2...". If you are using <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING--CAPS" title="G_OPTION_REMAINING"><span class="type">G_OPTION_REMAINING</span></a> for
389
372
collecting "rest" arguments, GLib handles this automatically by
390
 
using the <em class="parameter"><code>arg_description</code></em> of the corresponding <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a> in
 
373
using the <em class="parameter"><code>arg_description</code></em> of the corresponding <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry"><span class="type">GOptionEntry</span></a> in
391
374
the usage summary.
392
375
</p>
393
376
<p>
395
378
functionality, like " - frob the strings", which will be displayed
396
379
in the same line as the usage. For a longer description of the
397
380
program functionality that should be displayed as a paragraph
398
 
below the usage line, use <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary"><code class="function">g_option_context_set_summary()</code></a>.
 
381
below the usage line, use <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary" title="g_option_context_set_summary ()"><code class="function">g_option_context_set_summary()</code></a>.
399
382
</p>
400
383
<p>
401
384
Note that the <em class="parameter"><code>parameter_string</code></em> is translated using the
402
 
function set with <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func"><code class="function">g_option_context_set_translate_func()</code></a>, so
 
385
function set with <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func" title="g_option_context_set_translate_func ()"><code class="function">g_option_context_set_translate_func()</code></a>, so
403
386
it should normally be passed untranslated.</p>
404
387
<p>
405
 
 
406
388
</p>
407
389
<div class="variablelist"><table border="0">
408
390
<col align="left" valign="top">
409
391
<tbody>
410
392
<tr>
411
 
<td><p><span class="term"><em class="parameter"><code>parameter_string</code></em>&#160;:</span></p></td>
 
393
<td><p><span class="term"><em class="parameter"><code>parameter_string</code></em> :</span></p></td>
412
394
<td> a string which is displayed in
413
395
   the first line of <code class="option">--help</code> output, after the
414
396
   usage summary 
416
398
</td>
417
399
</tr>
418
400
<tr>
419
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
420
 
<td> a newly created <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>, which must be
421
 
   freed with <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free"><code class="function">g_option_context_free()</code></a> after use.
 
401
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
402
<td> a newly created <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>, which must be
 
403
   freed with <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free" title="g_option_context_free ()"><code class="function">g_option_context_free()</code></a> after use.
422
404
 
423
405
</td>
424
406
</tr>
425
407
</tbody>
426
408
</table></div>
427
 
<p class="since">Since  2.6
428
 
</p>
 
409
<p class="since">Since 2.6</p>
429
410
</div>
430
411
<hr>
431
412
<div class="refsect2" lang="en">
432
 
<a name="id3184459"></a><h3>
433
 
<a name="g-option-context-set-summary"></a>g_option_context_set_summary ()</h3>
434
 
<a class="indexterm" name="id3184475"></a><pre class="programlisting">void                g_option_context_set_summary        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
435
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *summary);</pre>
 
413
<a name="g-option-context-set-summary"></a><h3>g_option_context_set_summary ()</h3>
 
414
<pre class="programlisting">void                g_option_context_set_summary        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
415
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *summary);</pre>
436
416
<p>
437
417
Adds a string to be displayed in <code class="option">--help</code> output
438
418
before the list of options. This is typically a summary of the
440
420
</p>
441
421
<p>
442
422
Note that the summary is translated (see 
443
 
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func"><code class="function">g_option_context_set_translate_func()</code></a>, <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translation-domain"><code class="function">g_option_context_set_translation_domain()</code></a>).</p>
 
423
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func" title="g_option_context_set_translate_func ()"><code class="function">g_option_context_set_translate_func()</code></a>, <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translation-domain" title="g_option_context_set_translation_domain ()"><code class="function">g_option_context_set_translation_domain()</code></a>).</p>
444
424
<p>
445
 
 
446
425
</p>
447
426
<div class="variablelist"><table border="0">
448
427
<col align="left" valign="top">
449
428
<tbody>
450
429
<tr>
451
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
452
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
430
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
431
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
453
432
</td>
454
433
</tr>
455
434
<tr>
456
 
<td><p><span class="term"><em class="parameter"><code>summary</code></em>&#160;:</span></p></td>
 
435
<td><p><span class="term"><em class="parameter"><code>summary</code></em> :</span></p></td>
457
436
<td> a string to be shown in <code class="option">--help</code> output 
458
 
 before the list of options, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 
437
 before the list of options, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
459
438
</td>
460
439
</tr>
461
440
</tbody>
462
441
</table></div>
463
 
<p class="since">Since  2.12
464
 
</p>
 
442
<p class="since">Since 2.12</p>
465
443
</div>
466
444
<hr>
467
445
<div class="refsect2" lang="en">
468
 
<a name="id3184610"></a><h3>
469
 
<a name="g-option-context-get-summary"></a>g_option_context_get_summary ()</h3>
470
 
<a class="indexterm" name="id3184626"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        g_option_context_get_summary        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre>
471
 
<p>
472
 
Returns the summary. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary"><code class="function">g_option_context_set_summary()</code></a>.</p>
473
 
<p>
474
 
 
 
446
<a name="g-option-context-get-summary"></a><h3>g_option_context_get_summary ()</h3>
 
447
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *       g_option_context_get_summary        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);</pre>
 
448
<p>
 
449
Returns the summary. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary" title="g_option_context_set_summary ()"><code class="function">g_option_context_set_summary()</code></a>.</p>
 
450
<p>
475
451
</p>
476
452
<div class="variablelist"><table border="0">
477
453
<col align="left" valign="top">
478
454
<tbody>
479
455
<tr>
480
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
481
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
456
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
457
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
482
458
</td>
483
459
</tr>
484
460
<tr>
485
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
461
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
486
462
<td> the summary
487
463
 
488
464
</td>
489
465
</tr>
490
466
</tbody>
491
467
</table></div>
492
 
<p class="since">Since  2.12
493
 
</p>
 
468
<p class="since">Since 2.12</p>
494
469
</div>
495
470
<hr>
496
471
<div class="refsect2" lang="en">
497
 
<a name="id3184714"></a><h3>
498
 
<a name="g-option-context-set-description"></a>g_option_context_set_description ()</h3>
499
 
<a class="indexterm" name="id3184730"></a><pre class="programlisting">void                g_option_context_set_description    (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
500
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *description);</pre>
 
472
<a name="g-option-context-set-description"></a><h3>g_option_context_set_description ()</h3>
 
473
<pre class="programlisting">void                g_option_context_set_description    (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
474
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *description);</pre>
501
475
<p>
502
476
Adds a string to be displayed in <code class="option">--help</code> output
503
477
after the list of options. This text often includes a bug reporting
505
479
</p>
506
480
<p>
507
481
Note that the summary is translated (see 
508
 
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func"><code class="function">g_option_context_set_translate_func()</code></a>).</p>
 
482
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-translate-func" title="g_option_context_set_translate_func ()"><code class="function">g_option_context_set_translate_func()</code></a>).</p>
509
483
<p>
510
 
 
511
484
</p>
512
485
<div class="variablelist"><table border="0">
513
486
<col align="left" valign="top">
514
487
<tbody>
515
488
<tr>
516
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
517
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
489
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
490
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
518
491
</td>
519
492
</tr>
520
493
<tr>
521
 
<td><p><span class="term"><em class="parameter"><code>description</code></em>&#160;:</span></p></td>
 
494
<td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td>
522
495
<td> a string to be shown in <code class="option">--help</code> output 
523
 
  after the list of options, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 
496
  after the list of options, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
524
497
</td>
525
498
</tr>
526
499
</tbody>
527
500
</table></div>
528
 
<p class="since">Since  2.12
529
 
</p>
 
501
<p class="since">Since 2.12</p>
530
502
</div>
531
503
<hr>
532
504
<div class="refsect2" lang="en">
533
 
<a name="id3184854"></a><h3>
534
 
<a name="g-option-context-get-description"></a>g_option_context_get_description ()</h3>
535
 
<a class="indexterm" name="id3184869"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        g_option_context_get_description    (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre>
536
 
<p>
537
 
Returns the description. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description"><code class="function">g_option_context_set_description()</code></a>.</p>
538
 
<p>
539
 
 
 
505
<a name="g-option-context-get-description"></a><h3>g_option_context_get_description ()</h3>
 
506
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *       g_option_context_get_description    (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);</pre>
 
507
<p>
 
508
Returns the description. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description" title="g_option_context_set_description ()"><code class="function">g_option_context_set_description()</code></a>.</p>
 
509
<p>
540
510
</p>
541
511
<div class="variablelist"><table border="0">
542
512
<col align="left" valign="top">
543
513
<tbody>
544
514
<tr>
545
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
546
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
515
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
516
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
547
517
</td>
548
518
</tr>
549
519
<tr>
550
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
520
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
551
521
<td> the description
552
522
 
553
523
</td>
554
524
</tr>
555
525
</tbody>
556
526
</table></div>
557
 
<p class="since">Since  2.12
558
 
</p>
 
527
<p class="since">Since 2.12</p>
559
528
</div>
560
529
<hr>
561
530
<div class="refsect2" lang="en">
562
 
<a name="id3184958"></a><h3>
563
 
<a name="GTranslateFunc"></a>GTranslateFunc ()</h3>
564
 
<a class="indexterm" name="id3184970"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        (*GTranslateFunc)                   (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
565
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
 
531
<a name="GTranslateFunc"></a><h3>GTranslateFunc ()</h3>
 
532
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *       (*GTranslateFunc)                   (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *str,
 
533
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
566
534
<p>
567
535
The type of functions which are used to translate user-visible
568
536
strings, for <code class="option">--help</code> output.
571
539
<col align="left" valign="top">
572
540
<tbody>
573
541
<tr>
574
 
<td><p><span class="term"><em class="parameter"><code>str</code></em>&#160;:</span></p></td>
 
542
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
575
543
<td>the untranslated string
576
544
</td>
577
545
</tr>
578
546
<tr>
579
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
547
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
580
548
<td>user data specified when installing the function, e.g.
581
 
  in <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translate-func"><code class="function">g_option_group_set_translate_func()</code></a>
 
549
  in <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translate-func" title="g_option_group_set_translate_func ()"><code class="function">g_option_group_set_translate_func()</code></a>
582
550
</td>
583
551
</tr>
584
552
<tr>
585
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
553
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
586
554
<td>a translation of the string for the current locale.
587
555
  The returned string is owned by GLib and must not be freed.
588
 
 
589
 
 
590
556
</td>
591
557
</tr>
592
558
</tbody>
594
560
</div>
595
561
<hr>
596
562
<div class="refsect2" lang="en">
597
 
<a name="id3185069"></a><h3>
598
 
<a name="g-option-context-set-translate-func"></a>g_option_context_set_translate_func ()</h3>
599
 
<a class="indexterm" name="id3185085"></a><pre class="programlisting">void                g_option_context_set_translate_func (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
600
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc">GTranslateFunc</a> func,
601
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
602
 
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_notify);</pre>
 
563
<a name="g-option-context-set-translate-func"></a><h3>g_option_context_set_translate_func ()</h3>
 
564
<pre class="programlisting">void                g_option_context_set_translate_func (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
565
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">GTranslateFunc</a> func,
 
566
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
567
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy_notify);</pre>
603
568
<p>
604
569
Sets the function which is used to translate the contexts 
605
570
user-visible strings, for <code class="option">--help</code> output. 
606
 
If <em class="parameter"><code>func</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, strings are not translated.
 
571
If <em class="parameter"><code>func</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, strings are not translated.
607
572
</p>
608
573
<p>
609
574
Note that option groups have their own translation functions, 
610
 
this function only affects the <em class="parameter"><code>parameter_string</code></em> (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-new"><code class="function">g_option_context_new()</code></a>), 
611
 
the summary (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary"><code class="function">g_option_context_set_summary()</code></a>) and the description 
612
 
(see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description"><code class="function">g_option_context_set_description()</code></a>).
 
575
this function only affects the <em class="parameter"><code>parameter_string</code></em> (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-new" title="g_option_context_new ()"><code class="function">g_option_context_new()</code></a>), 
 
576
the summary (see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-summary" title="g_option_context_set_summary ()"><code class="function">g_option_context_set_summary()</code></a>) and the description 
 
577
(see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-description" title="g_option_context_set_description ()"><code class="function">g_option_context_set_description()</code></a>).
613
578
</p>
614
579
<p>
615
 
If you are using <code class="function">gettext()</code>, you only need to set the translation
 
580
If you are using <a
 
581
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
 
582
><code class="function">gettext()</code></a>, you only need to set the translation
616
583
domain, see <code class="function">g_context_group_set_translation_domain()</code>.</p>
617
584
<p>
618
 
 
619
585
</p>
620
586
<div class="variablelist"><table border="0">
621
587
<col align="left" valign="top">
622
588
<tbody>
623
589
<tr>
624
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
625
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
626
 
</td>
627
 
</tr>
628
 
<tr>
629
 
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
630
 
<td> the <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc"><span class="type">GTranslateFunc</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> 
631
 
</td>
632
 
</tr>
633
 
<tr>
634
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
635
 
<td> user data to pass to <em class="parameter"><code>func</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
636
 
</td>
637
 
</tr>
638
 
<tr>
639
 
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em>&#160;:</span></p></td>
640
 
<td> a function which gets called to free <em class="parameter"><code>data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 
590
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
591
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
 
592
</td>
 
593
</tr>
 
594
<tr>
 
595
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
 
596
<td> the <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()"><span class="type">GTranslateFunc</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> 
 
597
</td>
 
598
</tr>
 
599
<tr>
 
600
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
 
601
<td> user data to pass to <em class="parameter"><code>func</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
 
602
</td>
 
603
</tr>
 
604
<tr>
 
605
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
 
606
<td> a function which gets called to free <em class="parameter"><code>data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
641
607
</td>
642
608
</tr>
643
609
</tbody>
644
610
</table></div>
645
 
<p class="since">Since  2.12
646
 
</p>
 
611
<p class="since">Since 2.12</p>
647
612
</div>
648
613
<hr>
649
614
<div class="refsect2" lang="en">
650
 
<a name="id3185362"></a><h3>
651
 
<a name="g-option-context-set-translation-domain"></a>g_option_context_set_translation_domain ()</h3>
652
 
<a class="indexterm" name="id3185378"></a><pre class="programlisting">void                g_option_context_set_translation_domain
653
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
654
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain);</pre>
 
615
<a name="g-option-context-set-translation-domain"></a><h3>g_option_context_set_translation_domain ()</h3>
 
616
<pre class="programlisting">void                g_option_context_set_translation_domain
 
617
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
618
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain);</pre>
655
619
<p>
656
 
A convenience function to use <code class="function">gettext()</code> for translating
 
620
A convenience function to use <a
 
621
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
 
622
><code class="function">gettext()</code></a> for translating
657
623
user-visible strings.</p>
658
624
<p>
659
 
 
660
625
</p>
661
626
<div class="variablelist"><table border="0">
662
627
<col align="left" valign="top">
663
628
<tbody>
664
629
<tr>
665
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
666
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
630
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
631
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
667
632
</td>
668
633
</tr>
669
634
<tr>
670
 
<td><p><span class="term"><em class="parameter"><code>domain</code></em>&#160;:</span></p></td>
 
635
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
671
636
<td> the domain to use
672
637
</td>
673
638
</tr>
674
639
</tbody>
675
640
</table></div>
676
 
<p class="since">Since  2.12
677
 
</p>
 
641
<p class="since">Since 2.12</p>
678
642
</div>
679
643
<hr>
680
644
<div class="refsect2" lang="en">
681
 
<a name="id3185477"></a><h3>
682
 
<a name="g-option-context-free"></a>g_option_context_free ()</h3>
683
 
<a class="indexterm" name="id3185492"></a><pre class="programlisting">void                g_option_context_free               (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre>
 
645
<a name="g-option-context-free"></a><h3>g_option_context_free ()</h3>
 
646
<pre class="programlisting">void                g_option_context_free               (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);</pre>
684
647
<p>
685
648
Frees context and all the groups which have been 
686
649
added to it.</p>
687
650
<p>
688
 
 
689
651
</p>
690
652
<div class="variablelist"><table border="0">
691
653
<col align="left" valign="top">
692
654
<tbody><tr>
693
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
694
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a> 
 
655
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
656
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a> 
695
657
</td>
696
658
</tr></tbody>
697
659
</table></div>
698
 
<p class="since">Since  2.6
699
 
</p>
 
660
<p class="since">Since 2.6</p>
700
661
</div>
701
662
<hr>
702
663
<div class="refsect2" lang="en">
703
 
<a name="id3185558"></a><h3>
704
 
<a name="g-option-context-parse"></a>g_option_context_parse ()</h3>
705
 
<a class="indexterm" name="id3185574"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_option_context_parse              (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
706
 
                                                         <a class="link" href="glib-Basic-Types.html#gint">gint</a> *argc,
707
 
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> ***argv,
708
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre>
 
664
<a name="g-option-context-parse"></a><h3>g_option_context_parse ()</h3>
 
665
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_option_context_parse              (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
666
                                                         <a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> *argc,
 
667
                                                         <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> ***argv,
 
668
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
709
669
<p>
710
670
Parses the command line arguments, recognizing options
711
671
which have been added to <em class="parameter"><code>context</code></em>. A side-effect of 
712
 
calling this function is that <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-prgname"><code class="function">g_set_prgname()</code></a> will be
 
672
calling this function is that <a class="link" href="glib-Miscellaneous-Utility-Functions.html#g-set-prgname" title="g_set_prgname ()"><code class="function">g_set_prgname()</code></a> will be
713
673
called.
714
674
</p>
715
675
<p>
722
682
</p>
723
683
<p>
724
684
If automatic <code class="option">--help</code> support is enabled
725
 
(see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled"><code class="function">g_option_context_set_help_enabled()</code></a>), and the 
 
685
(see <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled" title="g_option_context_set_help_enabled ()"><code class="function">g_option_context_set_help_enabled()</code></a>), and the 
726
686
<em class="parameter"><code>argv</code></em> array contains one of the recognized help options,
727
687
this function will produce help output to stdout and
728
688
call <code class="literal">exit (0)</code>.
733
693
automatic character set conversion of string and filename
734
694
arguments.</p>
735
695
<p>
736
 
 
737
696
</p>
738
697
<div class="variablelist"><table border="0">
739
698
<col align="left" valign="top">
740
699
<tbody>
741
700
<tr>
742
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
743
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
701
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
702
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
744
703
</td>
745
704
</tr>
746
705
<tr>
747
 
<td><p><span class="term"><em class="parameter"><code>argc</code></em>&#160;:</span></p></td>
 
706
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
748
707
<td> a pointer to the number of command line arguments
749
708
</td>
750
709
</tr>
751
710
<tr>
752
 
<td><p><span class="term"><em class="parameter"><code>argv</code></em>&#160;:</span></p></td>
 
711
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
753
712
<td> a pointer to the array of command line arguments
754
713
</td>
755
714
</tr>
756
715
<tr>
757
 
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
 
716
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
758
717
<td> a return location for errors 
759
718
</td>
760
719
</tr>
761
720
<tr>
762
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
763
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the parsing was successful, 
764
 
              <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if an error occurred
 
721
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
722
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the parsing was successful, 
 
723
              <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error occurred
765
724
 
766
725
</td>
767
726
</tr>
768
727
</tbody>
769
728
</table></div>
770
 
<p class="since">Since  2.6
771
 
</p>
 
729
<p class="since">Since 2.6</p>
772
730
</div>
773
731
<hr>
774
732
<div class="refsect2" lang="en">
775
 
<a name="id3185838"></a><h3>
776
 
<a name="g-option-context-set-help-enabled"></a>g_option_context_set_help_enabled ()</h3>
777
 
<a class="indexterm" name="id3185855"></a><pre class="programlisting">void                g_option_context_set_help_enabled   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
778
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> help_enabled);</pre>
 
733
<a name="g-option-context-set-help-enabled"></a><h3>g_option_context_set_help_enabled ()</h3>
 
734
<pre class="programlisting">void                g_option_context_set_help_enabled   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
735
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> help_enabled);</pre>
779
736
<p>
780
737
Enables or disables automatic generation of <code class="option">--help</code> 
781
 
output. By default, <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> recognizes
 
738
output. By default, <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()"><code class="function">g_option_context_parse()</code></a> recognizes
782
739
<code class="option">--help</code>, <code class="option">-?</code>, <code class="option">--help-all</code>
783
740
and <code class="option">--help-</code><em class="replaceable"><code>groupname</code></em> and creates
784
741
suitable output to stdout.</p>
785
742
<p>
786
 
 
787
743
</p>
788
744
<div class="variablelist"><table border="0">
789
745
<col align="left" valign="top">
790
746
<tbody>
791
747
<tr>
792
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
793
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
748
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
749
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
794
750
</td>
795
751
</tr>
796
752
<tr>
797
 
<td><p><span class="term"><em class="parameter"><code>help_enabled</code></em>&#160;:</span></p></td>
798
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to enable <code class="option">--help</code>, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to disable it
 
753
<td><p><span class="term"><em class="parameter"><code>help_enabled</code></em> :</span></p></td>
 
754
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> to enable <code class="option">--help</code>, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> to disable it
799
755
</td>
800
756
</tr>
801
757
</tbody>
802
758
</table></div>
803
 
<p class="since">Since  2.6
804
 
</p>
 
759
<p class="since">Since 2.6</p>
805
760
</div>
806
761
<hr>
807
762
<div class="refsect2" lang="en">
808
 
<a name="id3185998"></a><h3>
809
 
<a name="g-option-context-get-help-enabled"></a>g_option_context_get_help_enabled ()</h3>
810
 
<a class="indexterm" name="id3186015"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_option_context_get_help_enabled   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre>
 
763
<a name="g-option-context-get-help-enabled"></a><h3>g_option_context_get_help_enabled ()</h3>
 
764
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_option_context_get_help_enabled   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);</pre>
811
765
<p>
812
766
Returns whether automatic <code class="option">--help</code> generation
813
 
is turned on for <em class="parameter"><code>context</code></em>. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled"><code class="function">g_option_context_set_help_enabled()</code></a>.</p>
 
767
is turned on for <em class="parameter"><code>context</code></em>. See <a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-help-enabled" title="g_option_context_set_help_enabled ()"><code class="function">g_option_context_set_help_enabled()</code></a>.</p>
814
768
<p>
815
 
 
816
769
</p>
817
770
<div class="variablelist"><table border="0">
818
771
<col align="left" valign="top">
819
772
<tbody>
820
773
<tr>
821
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
822
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
774
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
775
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
823
776
</td>
824
777
</tr>
825
778
<tr>
826
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
827
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if automatic help generation is turned on.
 
779
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
780
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if automatic help generation is turned on.
828
781
 
829
782
</td>
830
783
</tr>
831
784
</tbody>
832
785
</table></div>
833
 
<p class="since">Since  2.6
834
 
</p>
 
786
<p class="since">Since 2.6</p>
835
787
</div>
836
788
<hr>
837
789
<div class="refsect2" lang="en">
838
 
<a name="id3186122"></a><h3>
839
 
<a name="g-option-context-set-ignore-unknown-options"></a>g_option_context_set_ignore_unknown_options ()</h3>
840
 
<a class="indexterm" name="id3186139"></a><pre class="programlisting">void                g_option_context_set_ignore_unknown_options
841
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
842
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> ignore_unknown);</pre>
 
790
<a name="g-option-context-set-ignore-unknown-options"></a><h3>g_option_context_set_ignore_unknown_options ()</h3>
 
791
<pre class="programlisting">void                g_option_context_set_ignore_unknown_options
 
792
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
793
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> ignore_unknown);</pre>
843
794
<p>
844
795
Sets whether to ignore unknown options or not. If an argument is 
845
796
ignored, it is left in the <em class="parameter"><code>argv</code></em> array after parsing. By default, 
846
 
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> treats unknown options as error.
 
797
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()"><code class="function">g_option_context_parse()</code></a> treats unknown options as error.
847
798
</p>
848
799
<p>
849
800
This setting does not affect non-option arguments (i.e. arguments 
850
801
which don't start with a dash). But note that GOption cannot reliably
851
802
determine whether a non-option belongs to a preceding unknown option.</p>
852
803
<p>
853
 
 
854
804
</p>
855
805
<div class="variablelist"><table border="0">
856
806
<col align="left" valign="top">
857
807
<tbody>
858
808
<tr>
859
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
860
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
809
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
810
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
861
811
</td>
862
812
</tr>
863
813
<tr>
864
 
<td><p><span class="term"><em class="parameter"><code>ignore_unknown</code></em>&#160;:</span></p></td>
865
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to ignore unknown options, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to produce
 
814
<td><p><span class="term"><em class="parameter"><code>ignore_unknown</code></em> :</span></p></td>
 
815
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> to ignore unknown options, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> to produce
866
816
   an error when unknown options are met
867
817
</td>
868
818
</tr>
869
819
</tbody>
870
820
</table></div>
871
 
<p class="since">Since  2.6
872
 
</p>
 
821
<p class="since">Since 2.6</p>
873
822
</div>
874
823
<hr>
875
824
<div class="refsect2" lang="en">
876
 
<a name="id3186274"></a><h3>
877
 
<a name="g-option-context-get-ignore-unknown-options"></a>g_option_context_get_ignore_unknown_options ()</h3>
878
 
<a class="indexterm" name="id3186292"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_option_context_get_ignore_unknown_options
879
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre>
 
825
<a name="g-option-context-get-ignore-unknown-options"></a><h3>g_option_context_get_ignore_unknown_options ()</h3>
 
826
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            g_option_context_get_ignore_unknown_options
 
827
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);</pre>
880
828
<p>
881
829
Returns whether unknown options are ignored or not. See
882
 
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options"><code class="function">g_option_context_set_ignore_unknown_options()</code></a>.</p>
 
830
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-set-ignore-unknown-options" title="g_option_context_set_ignore_unknown_options ()"><code class="function">g_option_context_set_ignore_unknown_options()</code></a>.</p>
883
831
<p>
884
 
 
885
832
</p>
886
833
<div class="variablelist"><table border="0">
887
834
<col align="left" valign="top">
888
835
<tbody>
889
836
<tr>
890
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
891
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
837
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
838
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
892
839
</td>
893
840
</tr>
894
841
<tr>
895
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
896
 
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if unknown options are ignored.
 
842
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
843
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if unknown options are ignored.
897
844
 
898
845
</td>
899
846
</tr>
900
847
</tbody>
901
848
</table></div>
902
 
<p class="since">Since  2.6
903
 
</p>
 
849
<p class="since">Since 2.6</p>
904
850
</div>
905
851
<hr>
906
852
<div class="refsect2" lang="en">
907
 
<a name="id3186390"></a><h3>
908
 
<a name="g-option-context-get-help"></a>g_option_context_get_help ()</h3>
909
 
<a class="indexterm" name="id3186406"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_option_context_get_help           (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
910
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> main_help,
911
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);</pre>
 
853
<a name="g-option-context-get-help"></a><h3>g_option_context_get_help ()</h3>
 
854
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *             g_option_context_get_help           (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
855
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> main_help,
 
856
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);</pre>
912
857
<p>
913
858
Returns a formatted, translated help text for the given context.
914
859
To obtain the text produced by <code class="option">--help</code>, call
918
863
To obtain the help text for an option group, call
919
864
<code class="literal">g_option_context_get_help (context, FALSE, group)</code>.</p>
920
865
<p>
921
 
 
922
866
</p>
923
867
<div class="variablelist"><table border="0">
924
868
<col align="left" valign="top">
925
869
<tbody>
926
870
<tr>
927
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
928
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
929
 
</td>
930
 
</tr>
931
 
<tr>
932
 
<td><p><span class="term"><em class="parameter"><code>main_help</code></em>&#160;:</span></p></td>
933
 
<td> if <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, only include the main group 
934
 
</td>
935
 
</tr>
936
 
<tr>
937
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
938
 
<td> the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> to create help for, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
939
 
</td>
940
 
</tr>
941
 
<tr>
942
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
871
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
872
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
 
873
</td>
 
874
</tr>
 
875
<tr>
 
876
<td><p><span class="term"><em class="parameter"><code>main_help</code></em> :</span></p></td>
 
877
<td> if <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>, only include the main group 
 
878
</td>
 
879
</tr>
 
880
<tr>
 
881
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
882
<td> the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> to create help for, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
 
883
</td>
 
884
</tr>
 
885
<tr>
 
886
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
943
887
<td> A newly allocated string containing the help text
944
888
 
945
889
</td>
946
890
</tr>
947
891
</tbody>
948
892
</table></div>
949
 
<p class="since">Since  2.14
950
 
</p>
 
893
<p class="since">Since 2.14</p>
951
894
</div>
952
895
<hr>
953
896
<div class="refsect2" lang="en">
954
 
<a name="id3186586"></a><h3>
955
 
<a name="GOptionArg"></a>enum GOptionArg</h3>
956
 
<a class="indexterm" name="id3186598"></a><pre class="programlisting">typedef enum
 
897
<a name="GOptionArg"></a><h3>enum GOptionArg</h3>
 
898
<pre class="programlisting">typedef enum
957
899
{
958
900
  G_OPTION_ARG_NONE,
959
901
  G_OPTION_ARG_STRING,
967
909
} GOptionArg;
968
910
</pre>
969
911
<p>
970
 
The <a class="link" href="glib-Commandline-option-parser.html#GOptionArg"><span class="type">GOptionArg</span></a> enum values determine which type of extra argument the
 
912
The <a class="link" href="glib-Commandline-option-parser.html#GOptionArg" title="enum GOptionArg"><span class="type">GOptionArg</span></a> enum values determine which type of extra argument the
971
913
options expect to find. If an option expects an extra argument, it
972
914
can be specified in several ways; with a short option:
973
915
<code class="option">-x arg</code>, with a long option: <code class="option">--name arg</code>
977
919
<col align="left" valign="top">
978
920
<tbody>
979
921
<tr>
980
 
<td><p><span class="term"><a name="G-OPTION-ARG-NONE:CAPS"></a><code class="literal">G_OPTION_ARG_NONE</code></span></p></td>
 
922
<td><p><a name="G-OPTION-ARG-NONE--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_NONE</code></span></p></td>
981
923
<td>No extra argument. This is useful for simple flags.
982
924
</td>
983
925
</tr>
984
926
<tr>
985
 
<td><p><span class="term"><a name="G-OPTION-ARG-STRING:CAPS"></a><code class="literal">G_OPTION_ARG_STRING</code></span></p></td>
 
927
<td><p><a name="G-OPTION-ARG-STRING--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_STRING</code></span></p></td>
986
928
<td>The option takes a string argument.
987
929
</td>
988
930
</tr>
989
931
<tr>
990
 
<td><p><span class="term"><a name="G-OPTION-ARG-INT:CAPS"></a><code class="literal">G_OPTION_ARG_INT</code></span></p></td>
 
932
<td><p><a name="G-OPTION-ARG-INT--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_INT</code></span></p></td>
991
933
<td>The option takes an integer argument.
992
934
</td>
993
935
</tr>
994
936
<tr>
995
 
<td><p><span class="term"><a name="G-OPTION-ARG-CALLBACK:CAPS"></a><code class="literal">G_OPTION_ARG_CALLBACK</code></span></p></td>
 
937
<td><p><a name="G-OPTION-ARG-CALLBACK--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_CALLBACK</code></span></p></td>
996
938
<td>The option provides a callback to parse the
997
939
  extra argument.
998
940
</td>
999
941
</tr>
1000
942
<tr>
1001
 
<td><p><span class="term"><a name="G-OPTION-ARG-FILENAME:CAPS"></a><code class="literal">G_OPTION_ARG_FILENAME</code></span></p></td>
 
943
<td><p><a name="G-OPTION-ARG-FILENAME--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_FILENAME</code></span></p></td>
1002
944
<td>The option takes a filename as argument.
1003
945
</td>
1004
946
</tr>
1005
947
<tr>
1006
 
<td><p><span class="term"><a name="G-OPTION-ARG-STRING-ARRAY:CAPS"></a><code class="literal">G_OPTION_ARG_STRING_ARRAY</code></span></p></td>
 
948
<td><p><a name="G-OPTION-ARG-STRING-ARRAY--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_STRING_ARRAY</code></span></p></td>
1007
949
<td>The option takes a string argument, multiple
1008
950
  uses of the option are collected into an array of strings.
1009
951
</td>
1010
952
</tr>
1011
953
<tr>
1012
 
<td><p><span class="term"><a name="G-OPTION-ARG-FILENAME-ARRAY:CAPS"></a><code class="literal">G_OPTION_ARG_FILENAME_ARRAY</code></span></p></td>
 
954
<td><p><a name="G-OPTION-ARG-FILENAME-ARRAY--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_FILENAME_ARRAY</code></span></p></td>
1013
955
<td>The option takes a filename as argument, 
1014
956
  multiple uses of the option are collected into an array of strings.
1015
957
</td>
1016
958
</tr>
1017
959
<tr>
1018
 
<td><p><span class="term"><a name="G-OPTION-ARG-DOUBLE:CAPS"></a><code class="literal">G_OPTION_ARG_DOUBLE</code></span></p></td>
 
960
<td><p><a name="G-OPTION-ARG-DOUBLE--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_DOUBLE</code></span></p></td>
1019
961
<td>The option takes a double argument. The argument
1020
962
  can be formatted either for the user's locale or for the "C" locale. Since 2.12
1021
963
</td>
1022
964
</tr>
1023
965
<tr>
1024
 
<td><p><span class="term"><a name="G-OPTION-ARG-INT64:CAPS"></a><code class="literal">G_OPTION_ARG_INT64</code></span></p></td>
1025
 
<td>The option takes a 64-bit integer. Like <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-INT:CAPS"><code class="literal">G_OPTION_ARG_INT</code></a>
 
966
<td><p><a name="G-OPTION-ARG-INT64--CAPS"></a><span class="term"><code class="literal">G_OPTION_ARG_INT64</code></span></p></td>
 
967
<td>The option takes a 64-bit integer. Like <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-INT--CAPS"><code class="literal">G_OPTION_ARG_INT</code></a>
1026
968
  but for larger numbers. The number can be in decimal base, or in hexadecimal
1027
969
  (when prefixed with <code class="literal">0x</code>, for example, <code class="literal">0xffffffff</code>).
1028
970
  Since 2.12
1029
 
 
1030
971
</td>
1031
972
</tr>
1032
973
</tbody>
1034
975
</div>
1035
976
<hr>
1036
977
<div class="refsect2" lang="en">
1037
 
<a name="id3186881"></a><h3>
1038
 
<a name="GOptionFlags"></a>enum GOptionFlags</h3>
1039
 
<a class="indexterm" name="id3186893"></a><pre class="programlisting">typedef enum
 
978
<a name="GOptionFlags"></a><h3>enum GOptionFlags</h3>
 
979
<pre class="programlisting">typedef enum
1040
980
{
1041
981
  G_OPTION_FLAG_HIDDEN          = 1 &lt;&lt; 0,
1042
982
  G_OPTION_FLAG_IN_MAIN         = 1 &lt;&lt; 1,
1054
994
<col align="left" valign="top">
1055
995
<tbody>
1056
996
<tr>
1057
 
<td><p><span class="term"><a name="G-OPTION-FLAG-HIDDEN:CAPS"></a><code class="literal">G_OPTION_FLAG_HIDDEN</code></span></p></td>
 
997
<td><p><a name="G-OPTION-FLAG-HIDDEN--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_HIDDEN</code></span></p></td>
1058
998
<td>The option doesn't appear in <code class="option">--help</code>
1059
999
   output.
1060
1000
</td>
1061
1001
</tr>
1062
1002
<tr>
1063
 
<td><p><span class="term"><a name="G-OPTION-FLAG-IN-MAIN:CAPS"></a><code class="literal">G_OPTION_FLAG_IN_MAIN</code></span></p></td>
 
1003
<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>
1064
1004
<td>The option appears in the main section of the
1065
1005
   <code class="option">--help</code> output, even if it is defined in a group.
1066
1006
</td>
1067
1007
</tr>
1068
1008
<tr>
1069
 
<td><p><span class="term"><a name="G-OPTION-FLAG-REVERSE:CAPS"></a><code class="literal">G_OPTION_FLAG_REVERSE</code></span></p></td>
1070
 
<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
 
1009
<td><p><a name="G-OPTION-FLAG-REVERSE--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_REVERSE</code></span></p></td>
 
1010
<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
1071
1011
   indicates that the sense of the option is reversed.
1072
1012
</td>
1073
1013
</tr>
1074
1014
<tr>
1075
 
<td><p><span class="term"><a name="G-OPTION-FLAG-NO-ARG:CAPS"></a><code class="literal">G_OPTION_FLAG_NO_ARG</code></span></p></td>
1076
 
<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,
 
1015
<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>
 
1016
<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,
1077
1017
   this flag indicates that the callback does not take any argument
1078
 
   (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
 
1018
   (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
1079
1019
</td>
1080
1020
</tr>
1081
1021
<tr>
1082
 
<td><p><span class="term"><a name="G-OPTION-FLAG-FILENAME:CAPS"></a><code class="literal">G_OPTION_FLAG_FILENAME</code></span></p></td>
1083
 
<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>
 
1022
<td><p><a name="G-OPTION-FLAG-FILENAME--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_FILENAME</code></span></p></td>
 
1023
<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>
1084
1024
   kind, this flag indicates that the argument should be passed to the
1085
1025
   callback in the GLib filename encoding rather than UTF-8. Since 2.8
1086
1026
</td>
1087
1027
</tr>
1088
1028
<tr>
1089
 
<td><p><span class="term"><a name="G-OPTION-FLAG-OPTIONAL-ARG:CAPS"></a><code class="literal">G_OPTION_FLAG_OPTIONAL_ARG</code></span></p></td>
1090
 
<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> 
 
1029
<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>
 
1030
<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> 
1091
1031
   kind, this flag indicates that the argument supply is optional. If no argument
1092
 
   is given then data of <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc"><code class="literal">GOptionParseFunc</code></a> will be set to NULL. Since 2.8
 
1032
   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
1093
1033
</td>
1094
1034
</tr>
1095
1035
<tr>
1096
 
<td><p><span class="term"><a name="G-OPTION-FLAG-NOALIAS:CAPS"></a><code class="literal">G_OPTION_FLAG_NOALIAS</code></span></p></td>
 
1036
<td><p><a name="G-OPTION-FLAG-NOALIAS--CAPS"></a><span class="term"><code class="literal">G_OPTION_FLAG_NOALIAS</code></span></p></td>
1097
1037
<td>This flag turns off the automatic conflict resolution
1098
 
   which prefixes long option names with <code class="literal">groupname-</code> if 
 
1038
   which prefixes long option names with <code class="literal">groupname-</code> if
1099
1039
   there is a conflict. This option should only be used in situations where
1100
1040
   aliasing is necessary to model some legacy commandline interface. It is
1101
 
   not safe to use this option, unless all option groups are under your 
 
1041
   not safe to use this option, unless all option groups are under your
1102
1042
   direct control. Since 2.8.
1103
 
 
1104
1043
</td>
1105
1044
</tr>
1106
1045
</tbody>
1108
1047
</div>
1109
1048
<hr>
1110
1049
<div class="refsect2" lang="en">
1111
 
<a name="id3187172"></a><h3>
1112
 
<a name="G-OPTION-REMAINING:CAPS"></a>G_OPTION_REMAINING</h3>
1113
 
<a class="indexterm" name="id3187188"></a><pre class="programlisting">#define G_OPTION_REMAINING ""
 
1050
<a name="G-OPTION-REMAINING--CAPS"></a><h3>G_OPTION_REMAINING</h3>
 
1051
<pre class="programlisting">#define G_OPTION_REMAINING ""
1114
1052
</pre>
1115
1053
<p>
1116
 
If a long option in the main group has this name, it is not treated as a 
 
1054
If a long option in the main group has this name, it is not treated as a
1117
1055
regular option. Instead it collects all non-option arguments which would
1118
1056
otherwise be left in <code class="literal">argv</code>. The option must be of type
1119
 
<a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>, <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>
1120
 
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>.
 
1057
<a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>, <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>
 
1058
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>.
1121
1059
</p>
1122
1060
<p>
1123
 
Using <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING:CAPS"><span class="type">G_OPTION_REMAINING</span></a> instead of simply scanning <code class="literal">argv</code>
1124
 
for leftover arguments has the advantage that GOption takes care of 
 
1061
Using <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-REMAINING--CAPS" title="G_OPTION_REMAINING"><span class="type">G_OPTION_REMAINING</span></a> instead of simply scanning <code class="literal">argv</code>
 
1062
for leftover arguments has the advantage that GOption takes care of
1125
1063
necessary encoding conversions for strings or filenames.
1126
1064
</p>
1127
 
<p class="since">Since 2.6
1128
 
 
1129
 
 
1130
 
</p>
 
1065
<p class="since">Since 2.6</p>
1131
1066
</div>
1132
1067
<hr>
1133
1068
<div class="refsect2" lang="en">
1134
 
<a name="id3187275"></a><h3>
1135
 
<a name="GOptionEntry"></a>GOptionEntry</h3>
1136
 
<a class="indexterm" name="id3187287"></a><pre class="programlisting">typedef struct {
 
1069
<a name="GOptionEntry"></a><h3>GOptionEntry</h3>
 
1070
<pre class="programlisting">typedef struct {
1137
1071
  const gchar *long_name;
1138
1072
  gchar        short_name;
1139
1073
  gint         flags;
1147
1081
</pre>
1148
1082
<p>
1149
1083
A <span class="structname">GOptionEntry</span> defines a single option.
1150
 
To have an effect, they must be added to a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> with
1151
 
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-main-entries"><code class="function">g_option_context_add_main_entries()</code></a> or <a class="link" href="glib-Commandline-option-parser.html#g-option-group-add-entries"><code class="function">g_option_group_add_entries()</code></a>.
 
1084
To have an effect, they must be added to a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> with
 
1085
<a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-main-entries" title="g_option_context_add_main_entries ()"><code class="function">g_option_context_add_main_entries()</code></a> or <a class="link" href="glib-Commandline-option-parser.html#g-option-group-add-entries" title="g_option_group_add_entries ()"><code class="function">g_option_group_add_entries()</code></a>.
1152
1086
</p>
1153
1087
<div class="variablelist"><table border="0">
1154
1088
<col align="left" valign="top">
1155
1089
<tbody>
1156
1090
<tr>
1157
 
<td><p><span class="term">const&#160;<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>&#160;*<em class="structfield"><code>long_name</code></em>;</span></p></td>
 
1091
<td><p><span class="term">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *<em class="structfield"><code>long_name</code></em>;</span></p></td>
1158
1092
<td>The long name of an option can be used to specify it
1159
1093
  in a commandline as --<em class="replaceable"><code>long_name</code></em>. Every
1160
1094
  option must have a long name. To resolve conflicts if multiple
1161
1095
  option groups contain the same long name, it is also possible to
1162
 
  specify the option as 
 
1096
  specify the option as
1163
1097
  --<em class="replaceable"><code>groupname</code></em>-<em class="replaceable"><code>long_name</code></em>.
1164
1098
</td>
1165
1099
</tr>
1166
1100
<tr>
1167
 
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>&#160;<em class="structfield"><code>short_name</code></em>;</span></p></td>
 
1101
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> <em class="structfield"><code>short_name</code></em>;</span></p></td>
1168
1102
<td>If an option has a short name, it can be specified
1169
 
  -<em class="replaceable"><code>short_name</code></em> in a commandline. <em class="parameter"><code>short_name</code></em> must be 
 
1103
  -<em class="replaceable"><code>short_name</code></em> in a commandline. <em class="parameter"><code>short_name</code></em> must be
1170
1104
  a printable ASCII character different from '-', or zero if the option has no
1171
1105
  short name.
1172
1106
</td>
1173
1107
</tr>
1174
1108
<tr>
1175
 
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gint">gint</a>&#160;<em class="structfield"><code>flags</code></em>;</span></p></td>
1176
 
<td>Flags from <a class="link" href="glib-Commandline-option-parser.html#GOptionFlags"><span class="type">GOptionFlags</span></a>.
1177
 
</td>
1178
 
</tr>
1179
 
<tr>
1180
 
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#GOptionArg">GOptionArg</a>&#160;<em class="structfield"><code>arg</code></em>;</span></p></td>
1181
 
<td>The type of the option, as a <a class="link" href="glib-Commandline-option-parser.html#GOptionArg"><span class="type">GOptionArg</span></a>.
1182
 
</td>
1183
 
</tr>
1184
 
<tr>
1185
 
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>&#160;<em class="structfield"><code>arg_data</code></em>;</span></p></td>
1186
 
<td> If the <em class="parameter"><code>arg</code></em> type is <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>, then <em class="parameter"><code>arg_data</code></em> must 
1187
 
 point to a <a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc"><span class="type">GOptionArgFunc</span></a> callback function, which will be called to handle 
1188
 
 the extra argument. Otherwise, <em class="parameter"><code>arg_data</code></em> is a pointer to a location to store 
 
1109
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a> <em class="structfield"><code>flags</code></em>;</span></p></td>
 
1110
<td>Flags from <a class="link" href="glib-Commandline-option-parser.html#GOptionFlags" title="enum GOptionFlags"><span class="type">GOptionFlags</span></a>.
 
1111
</td>
 
1112
</tr>
 
1113
<tr>
 
1114
<td><p><span class="term"><a class="link" href="glib-Commandline-option-parser.html#GOptionArg" title="enum GOptionArg">GOptionArg</a> <em class="structfield"><code>arg</code></em>;</span></p></td>
 
1115
<td>The type of the option, as a <a class="link" href="glib-Commandline-option-parser.html#GOptionArg" title="enum GOptionArg"><span class="type">GOptionArg</span></a>.
 
1116
</td>
 
1117
</tr>
 
1118
<tr>
 
1119
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> <em class="structfield"><code>arg_data</code></em>;</span></p></td>
 
1120
<td> If the <em class="parameter"><code>arg</code></em> type is <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a>, then <em class="parameter"><code>arg_data</code></em> must 
 
1121
 point to a <a class="link" href="glib-Commandline-option-parser.html#GOptionArgFunc" title="GOptionArgFunc ()"><span class="type">GOptionArgFunc</span></a> callback function, which will be called to handle
 
1122
 the extra argument. Otherwise, <em class="parameter"><code>arg_data</code></em> is a pointer to a location to store
1189
1123
 the value, the required type of the location depends on the <em class="parameter"><code>arg</code></em> type:
1190
1124
  <div class="variablelist"><table border="0">
1191
1125
<col align="left" valign="top">
1192
1126
<tbody>
1193
1127
<tr>
1194
 
<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>
1195
 
<td><p><a class="link" href="glib-Basic-Types.html#gboolean"><code class="literal">gboolean</code></a></p></td>
1196
 
</tr>
1197
 
<tr>
1198
 
<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>
1199
 
<td><p><a class="link" href="glib-Basic-Types.html#gchar"><code class="literal">gchar</code></a>*</p></td>
1200
 
</tr>
1201
 
<tr>
1202
 
<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>
1203
 
<td><p><a class="link" href="glib-Basic-Types.html#gint"><code class="literal">gint</code></a></p></td>
1204
 
</tr>
1205
 
<tr>
1206
 
<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>
1207
 
<td><p><a class="link" href="glib-Basic-Types.html#gchar"><code class="literal">gchar</code></a>*</p></td>
1208
 
</tr>
1209
 
<tr>
1210
 
<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>
1211
 
<td><p><a class="link" href="glib-Basic-Types.html#gchar"><code class="literal">gchar</code></a>**</p></td>
1212
 
</tr>
1213
 
<tr>
1214
 
<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>
1215
 
<td><p><a class="link" href="glib-Basic-Types.html#gchar"><code class="literal">gchar</code></a>**</p></td>
1216
 
</tr>
1217
 
<tr>
1218
 
<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>
1219
 
<td><p><a class="link" href="glib-Basic-Types.html#gdouble"><code class="literal">gdouble</code></a></p></td>
 
1128
<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>
 
1129
<td><p><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><code class="literal">gboolean</code></a></p></td>
 
1130
</tr>
 
1131
<tr>
 
1132
<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>
 
1133
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>*</p></td>
 
1134
</tr>
 
1135
<tr>
 
1136
<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>
 
1137
<td><p><a class="link" href="glib-Basic-Types.html#gint" title="gint"><code class="literal">gint</code></a></p></td>
 
1138
</tr>
 
1139
<tr>
 
1140
<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>
 
1141
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>*</p></td>
 
1142
</tr>
 
1143
<tr>
 
1144
<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>
 
1145
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>**</p></td>
 
1146
</tr>
 
1147
<tr>
 
1148
<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>
 
1149
<td><p><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><code class="literal">gchar</code></a>**</p></td>
 
1150
</tr>
 
1151
<tr>
 
1152
<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>
 
1153
<td><p><a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><code class="literal">gdouble</code></a></p></td>
1220
1154
</tr>
1221
1155
</tbody>
1222
1156
</table></div>
1223
1157
</td>
1224
1158
</tr>
1225
1159
<tr>
1226
 
<td><p><span class="term">const&#160;<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>&#160;*<em class="structfield"><code>description</code></em>;</span></p></td>
 
1160
<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>
1227
1161
<td>the description for the option in <code class="option">--help</code>
1228
1162
  output. The <em class="parameter"><code>description</code></em> is translated using the <em class="parameter"><code>translate_func</code></em> of the
1229
 
  group, see <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain"><code class="function">g_option_group_set_translation_domain()</code></a>.
 
1163
  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>.
1230
1164
</td>
1231
1165
</tr>
1232
1166
<tr>
1233
 
<td><p><span class="term">const&#160;<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>&#160;*<em class="structfield"><code>arg_description</code></em>;</span></p></td>
 
1167
<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>
1234
1168
<td>The placeholder to use for the extra argument parsed
1235
1169
  by the option in <code class="option">--help</code>
1236
1170
  output. The <em class="parameter"><code>arg_description</code></em> is translated using the <em class="parameter"><code>translate_func</code></em> of the
1237
 
  group, see <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain"><code class="function">g_option_group_set_translation_domain()</code></a>.
1238
 
 
 
1171
  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>.
1239
1172
</td>
1240
1173
</tr>
1241
1174
</tbody>
1243
1176
</div>
1244
1177
<hr>
1245
1178
<div class="refsect2" lang="en">
1246
 
<a name="id3187841"></a><h3>
1247
 
<a name="g-option-context-add-main-entries"></a>g_option_context_add_main_entries ()</h3>
1248
 
<a class="indexterm" name="id3187858"></a><pre class="programlisting">void                g_option_context_add_main_entries   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
1249
 
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry">GOptionEntry</a> *entries,
1250
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *translation_domain);</pre>
 
1179
<a name="g-option-context-add-main-entries"></a><h3>g_option_context_add_main_entries ()</h3>
 
1180
<pre class="programlisting">void                g_option_context_add_main_entries   (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
1181
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a> *entries,
 
1182
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *translation_domain);</pre>
1251
1183
<p>
1252
1184
A convenience function which creates a main group if it doesn't 
1253
1185
exist, adds the <em class="parameter"><code>entries</code></em> to it and sets the translation domain.</p>
1254
1186
<p>
1255
 
 
1256
1187
</p>
1257
1188
<div class="variablelist"><table border="0">
1258
1189
<col align="left" valign="top">
1259
1190
<tbody>
1260
1191
<tr>
1261
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
1262
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
1263
 
</td>
1264
 
</tr>
1265
 
<tr>
1266
 
<td><p><span class="term"><em class="parameter"><code>entries</code></em>&#160;:</span></p></td>
1267
 
<td> a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array of <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a>s
1268
 
</td>
1269
 
</tr>
1270
 
<tr>
1271
 
<td><p><span class="term"><em class="parameter"><code>translation_domain</code></em>&#160;:</span></p></td>
 
1192
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
1193
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
 
1194
</td>
 
1195
</tr>
 
1196
<tr>
 
1197
<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td>
 
1198
<td> a <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry"><span class="type">GOptionEntry</span></a>s
 
1199
</td>
 
1200
</tr>
 
1201
<tr>
 
1202
<td><p><span class="term"><em class="parameter"><code>translation_domain</code></em> :</span></p></td>
1272
1203
<td> a translation domain to use for translating
1273
1204
   the <code class="option">--help</code> output for the options in <em class="parameter"><code>entries</code></em>
1274
 
   with <code class="function">gettext()</code>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 
1205
   with <a
 
1206
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
 
1207
><code class="function">gettext()</code></a>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
1275
1208
</td>
1276
1209
</tr>
1277
1210
</tbody>
1278
1211
</table></div>
1279
 
<p class="since">Since  2.6
1280
 
</p>
 
1212
<p class="since">Since 2.6</p>
1281
1213
</div>
1282
1214
<hr>
1283
1215
<div class="refsect2" lang="en">
1284
 
<a name="id3188025"></a><h3>
1285
 
<a name="GOptionGroup"></a>GOptionGroup</h3>
1286
 
<a class="indexterm" name="id3188038"></a><pre class="programlisting">typedef struct _GOptionGroup GOptionGroup;</pre>
 
1216
<a name="GOptionGroup"></a><h3>GOptionGroup</h3>
 
1217
<pre class="programlisting">typedef struct _GOptionGroup GOptionGroup;</pre>
1287
1218
<p>
1288
1219
A <span class="structname">GOptionGroup</span> struct defines the options in a single
1289
 
group. The struct has only private fields and should not be directly accessed. 
 
1220
group. The struct has only private fields and should not be directly accessed.
1290
1221
</p>
1291
1222
<p>
1292
1223
All options in a group share the same translation function. Libaries which
1293
1224
need to parse commandline options are expected to provide a function for
1294
 
getting a <span class="structname">GOptionGroup</span> holding their options, which 
1295
 
the application can then add to its <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>.
 
1225
getting a <span class="structname">GOptionGroup</span> holding their options, which
 
1226
the application can then add to its <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>.
1296
1227
</p>
1297
1228
</div>
1298
1229
<hr>
1299
1230
<div class="refsect2" lang="en">
1300
 
<a name="id3188078"></a><h3>
1301
 
<a name="g-option-context-add-group"></a>g_option_context_add_group ()</h3>
1302
 
<a class="indexterm" name="id3188094"></a><pre class="programlisting">void                g_option_context_add_group          (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
1303
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);</pre>
 
1231
<a name="g-option-context-add-group"></a><h3>g_option_context_add_group ()</h3>
 
1232
<pre class="programlisting">void                g_option_context_add_group          (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
1233
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);</pre>
1304
1234
<p>
1305
 
Adds a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> to the <em class="parameter"><code>context</code></em>, so that parsing with <em class="parameter"><code>context</code></em>
 
1235
Adds a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> to the <em class="parameter"><code>context</code></em>, so that parsing with <em class="parameter"><code>context</code></em>
1306
1236
will recognize the options in the group. Note that the group will
1307
 
be freed together with the context when <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free"><code class="function">g_option_context_free()</code></a> is
 
1237
be freed together with the context when <a class="link" href="glib-Commandline-option-parser.html#g-option-context-free" title="g_option_context_free ()"><code class="function">g_option_context_free()</code></a> is
1308
1238
called, so you must not free the group yourself after adding it
1309
1239
to a context.</p>
1310
1240
<p>
1311
 
 
1312
1241
</p>
1313
1242
<div class="variablelist"><table border="0">
1314
1243
<col align="left" valign="top">
1315
1244
<tbody>
1316
1245
<tr>
1317
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
1318
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
1246
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
1247
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
1319
1248
</td>
1320
1249
</tr>
1321
1250
<tr>
1322
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
 
1251
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
1323
1252
<td> the group to add
1324
1253
</td>
1325
1254
</tr>
1326
1255
</tbody>
1327
1256
</table></div>
1328
 
<p class="since">Since  2.6
1329
 
</p>
 
1257
<p class="since">Since 2.6</p>
1330
1258
</div>
1331
1259
<hr>
1332
1260
<div class="refsect2" lang="en">
1333
 
<a name="id3188215"></a><h3>
1334
 
<a name="g-option-context-set-main-group"></a>g_option_context_set_main_group ()</h3>
1335
 
<a class="indexterm" name="id3188231"></a><pre class="programlisting">void                g_option_context_set_main_group     (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
1336
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);</pre>
 
1261
<a name="g-option-context-set-main-group"></a><h3>g_option_context_set_main_group ()</h3>
 
1262
<pre class="programlisting">void                g_option_context_set_main_group     (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
1263
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);</pre>
1337
1264
<p>
1338
 
Sets a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> as main group of the <em class="parameter"><code>context</code></em>. 
1339
 
This has the same effect as calling <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-group"><code class="function">g_option_context_add_group()</code></a>, 
 
1265
Sets a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> as main group of the <em class="parameter"><code>context</code></em>. 
 
1266
This has the same effect as calling <a class="link" href="glib-Commandline-option-parser.html#g-option-context-add-group" title="g_option_context_add_group ()"><code class="function">g_option_context_add_group()</code></a>, 
1340
1267
the only difference is that the options in the main group are 
1341
1268
treated differently when generating <code class="option">--help</code> output.</p>
1342
1269
<p>
1343
 
 
1344
1270
</p>
1345
1271
<div class="variablelist"><table border="0">
1346
1272
<col align="left" valign="top">
1347
1273
<tbody>
1348
1274
<tr>
1349
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
1350
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
1275
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
1276
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
1351
1277
</td>
1352
1278
</tr>
1353
1279
<tr>
1354
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
 
1280
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
1355
1281
<td> the group to set as main group
1356
1282
</td>
1357
1283
</tr>
1358
1284
</tbody>
1359
1285
</table></div>
1360
 
<p class="since">Since  2.6
1361
 
</p>
 
1286
<p class="since">Since 2.6</p>
1362
1287
</div>
1363
1288
<hr>
1364
1289
<div class="refsect2" lang="en">
1365
 
<a name="id3188351"></a><h3>
1366
 
<a name="g-option-context-get-main-group"></a>g_option_context_get_main_group ()</h3>
1367
 
<a class="indexterm" name="id3188366"></a><pre class="programlisting"><a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a>*       g_option_context_get_main_group     (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context);</pre>
 
1290
<a name="g-option-context-get-main-group"></a><h3>g_option_context_get_main_group ()</h3>
 
1291
<pre class="programlisting"><a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *      g_option_context_get_main_group     (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context);</pre>
1368
1292
<p>
1369
1293
Returns a pointer to the main group of <em class="parameter"><code>context</code></em>.</p>
1370
1294
<p>
1371
 
 
1372
1295
</p>
1373
1296
<div class="variablelist"><table border="0">
1374
1297
<col align="left" valign="top">
1375
1298
<tbody>
1376
1299
<tr>
1377
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
1378
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
1300
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
1301
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
1379
1302
</td>
1380
1303
</tr>
1381
1304
<tr>
1382
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1383
 
<td> the main group of <em class="parameter"><code>context</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>context</code></em> doesn't
 
1305
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1306
<td> the main group of <em class="parameter"><code>context</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>context</code></em> doesn't
1384
1307
 have a main group. Note that group belongs to <em class="parameter"><code>context</code></em> and should
1385
1308
 not be modified or freed.
1386
1309
 
1388
1311
</tr>
1389
1312
</tbody>
1390
1313
</table></div>
1391
 
<p class="since">Since  2.6
1392
 
</p>
 
1314
<p class="since">Since 2.6</p>
1393
1315
</div>
1394
1316
<hr>
1395
1317
<div class="refsect2" lang="en">
1396
 
<a name="id3188477"></a><h3>
1397
 
<a name="g-option-group-new"></a>g_option_group_new ()</h3>
1398
 
<a class="indexterm" name="id3188493"></a><pre class="programlisting"><a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a>*       g_option_group_new                  (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *name,
1399
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *description,
1400
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *help_description,
1401
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data,
1402
 
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy);</pre>
1403
 
<p>
1404
 
Creates a new <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>.</p>
1405
 
<p>
1406
 
 
 
1318
<a name="g-option-group-new"></a><h3>g_option_group_new ()</h3>
 
1319
<pre class="programlisting"><a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *      g_option_group_new                  (const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *name,
 
1320
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *description,
 
1321
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *help_description,
 
1322
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data,
 
1323
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy);</pre>
 
1324
<p>
 
1325
Creates a new <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>.</p>
 
1326
<p>
1407
1327
</p>
1408
1328
<div class="variablelist"><table border="0">
1409
1329
<col align="left" valign="top">
1410
1330
<tbody>
1411
1331
<tr>
1412
 
<td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
 
1332
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
1413
1333
<td> the name for the option group, this is used to provide
1414
1334
  help for the options in this group with <code class="option">--help-</code><em class="parameter"><code>name</code></em>
1415
1335
</td>
1416
1336
</tr>
1417
1337
<tr>
1418
 
<td><p><span class="term"><em class="parameter"><code>description</code></em>&#160;:</span></p></td>
 
1338
<td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td>
1419
1339
<td> a description for this group to be shown in 
1420
1340
  <code class="option">--help</code>. This string is translated using the translation
1421
1341
  domain or translation function of the group
1422
1342
</td>
1423
1343
</tr>
1424
1344
<tr>
1425
 
<td><p><span class="term"><em class="parameter"><code>help_description</code></em>&#160;:</span></p></td>
 
1345
<td><p><span class="term"><em class="parameter"><code>help_description</code></em> :</span></p></td>
1426
1346
<td> a description for the <code class="option">--help-</code><em class="parameter"><code>name</code></em> option.
1427
1347
  This string is translated using the translation domain or translation function
1428
1348
  of the group
1429
1349
</td>
1430
1350
</tr>
1431
1351
<tr>
1432
 
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
 
1352
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
1433
1353
<td> user data that will be passed to the pre- and post-parse hooks,
1434
 
  the error hook and to callbacks of <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK:CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a> options, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
1435
 
</td>
1436
 
</tr>
1437
 
<tr>
1438
 
<td><p><span class="term"><em class="parameter"><code>destroy</code></em>&#160;:</span></p></td>
1439
 
<td> a function that will be called to free <em class="parameter"><code>user_data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
1440
 
</td>
1441
 
</tr>
1442
 
<tr>
1443
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
1354
  the error hook and to callbacks of <a class="link" href="glib-Commandline-option-parser.html#G-OPTION-ARG-CALLBACK--CAPS"><code class="literal">G_OPTION_ARG_CALLBACK</code></a> options, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
 
1355
</td>
 
1356
</tr>
 
1357
<tr>
 
1358
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
 
1359
<td> a function that will be called to free <em class="parameter"><code>user_data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
 
1360
</td>
 
1361
</tr>
 
1362
<tr>
 
1363
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1444
1364
<td> a newly created option group. It should be added 
1445
 
  to a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a> or freed with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-free"><code class="function">g_option_group_free()</code></a>.
 
1365
  to a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a> or freed with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-free" title="g_option_group_free ()"><code class="function">g_option_group_free()</code></a>.
1446
1366
 
1447
1367
</td>
1448
1368
</tr>
1449
1369
</tbody>
1450
1370
</table></div>
1451
 
<p class="since">Since  2.6
1452
 
</p>
 
1371
<p class="since">Since 2.6</p>
1453
1372
</div>
1454
1373
<hr>
1455
1374
<div class="refsect2" lang="en">
1456
 
<a name="id3188741"></a><h3>
1457
 
<a name="g-option-group-free"></a>g_option_group_free ()</h3>
1458
 
<a class="indexterm" name="id3188756"></a><pre class="programlisting">void                g_option_group_free                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group);</pre>
1459
 
<p>
1460
 
Frees a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>. Note that you must <span class="emphasis"><em>not</em></span>
1461
 
free groups which have been added to a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>.</p>
1462
 
<p>
1463
 
 
 
1375
<a name="g-option-group-free"></a><h3>g_option_group_free ()</h3>
 
1376
<pre class="programlisting">void                g_option_group_free                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group);</pre>
 
1377
<p>
 
1378
Frees a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>. Note that you must <span class="emphasis"><em>not</em></span>
 
1379
free groups which have been added to a <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>.</p>
 
1380
<p>
1464
1381
</p>
1465
1382
<div class="variablelist"><table border="0">
1466
1383
<col align="left" valign="top">
1467
1384
<tbody><tr>
1468
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
1469
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>
 
1385
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
1386
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>
1470
1387
</td>
1471
1388
</tr></tbody>
1472
1389
</table></div>
1473
 
<p class="since">Since  2.6
1474
 
</p>
 
1390
<p class="since">Since 2.6</p>
1475
1391
</div>
1476
1392
<hr>
1477
1393
<div class="refsect2" lang="en">
1478
 
<a name="id3188841"></a><h3>
1479
 
<a name="g-option-group-add-entries"></a>g_option_group_add_entries ()</h3>
1480
 
<a class="indexterm" name="id3188857"></a><pre class="programlisting">void                g_option_group_add_entries          (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1481
 
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry">GOptionEntry</a> *entries);</pre>
 
1394
<a name="g-option-group-add-entries"></a><h3>g_option_group_add_entries ()</h3>
 
1395
<pre class="programlisting">void                g_option_group_add_entries          (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1396
                                                         const <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry">GOptionEntry</a> *entries);</pre>
1482
1397
<p>
1483
1398
Adds the options specified in <em class="parameter"><code>entries</code></em> to <em class="parameter"><code>group</code></em>.</p>
1484
1399
<p>
1485
 
 
1486
1400
</p>
1487
1401
<div class="variablelist"><table border="0">
1488
1402
<col align="left" valign="top">
1489
1403
<tbody>
1490
1404
<tr>
1491
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
1492
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>
 
1405
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
1406
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>
1493
1407
</td>
1494
1408
</tr>
1495
1409
<tr>
1496
 
<td><p><span class="term"><em class="parameter"><code>entries</code></em>&#160;:</span></p></td>
1497
 
<td> a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array of <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a>s
 
1410
<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td>
 
1411
<td> a <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of <a class="link" href="glib-Commandline-option-parser.html#GOptionEntry" title="GOptionEntry"><span class="type">GOptionEntry</span></a>s
1498
1412
</td>
1499
1413
</tr>
1500
1414
</tbody>
1501
1415
</table></div>
1502
 
<p class="since">Since  2.6
1503
 
</p>
 
1416
<p class="since">Since 2.6</p>
1504
1417
</div>
1505
1418
<hr>
1506
1419
<div class="refsect2" lang="en">
1507
 
<a name="id3188975"></a><h3>
1508
 
<a name="GOptionParseFunc"></a>GOptionParseFunc ()</h3>
1509
 
<a class="indexterm" name="id3188988"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            (*GOptionParseFunc)                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
1510
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1511
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
1512
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre>
 
1420
<a name="GOptionParseFunc"></a><h3>GOptionParseFunc ()</h3>
 
1421
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a>            (*GOptionParseFunc)                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
1422
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1423
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
1424
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
1513
1425
<p>
1514
 
The type of function that can be called before and after parsing. 
 
1426
The type of function that can be called before and after parsing.
1515
1427
</p>
1516
1428
<div class="variablelist"><table border="0">
1517
1429
<col align="left" valign="top">
1518
1430
<tbody>
1519
1431
<tr>
1520
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
1521
 
<td>The active <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
1432
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
1433
<td>The active <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
1522
1434
</td>
1523
1435
</tr>
1524
1436
<tr>
1525
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
 
1437
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
1526
1438
<td>The group to which the function belongs
1527
1439
</td>
1528
1440
</tr>
1529
1441
<tr>
1530
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
1531
 
<td>User data added to the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> containing the option when it
1532
 
  was created with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new"><code class="function">g_option_group_new()</code></a>
 
1442
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
 
1443
<td>User data added to the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> containing the option when it
 
1444
  was created with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()"><code class="function">g_option_group_new()</code></a>
1533
1445
</td>
1534
1446
</tr>
1535
1447
<tr>
1536
 
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
 
1448
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
1537
1449
<td>A return location for error details
1538
1450
</td>
1539
1451
</tr>
1540
1452
<tr>
1541
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1542
 
<td>
1543
 
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the function completed successfully, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if an error 
1544
 
  occurred, in which case <em class="parameter"><code>error</code></em> should be set with <a class="link" href="glib-Error-Reporting.html#g-set-error"><code class="function">g_set_error()</code></a>
1545
 
 
1546
 
 
 
1453
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
1454
<td>%TRUE if the function completed successfully, <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if an error 
 
1455
  occurred, in which case <em class="parameter"><code>error</code></em> should be set with <a class="link" href="glib-Error-Reporting.html#g-set-error" title="g_set_error ()"><code class="function">g_set_error()</code></a>
1547
1456
</td>
1548
1457
</tr>
1549
1458
</tbody>
1551
1460
</div>
1552
1461
<hr>
1553
1462
<div class="refsect2" lang="en">
1554
 
<a name="id3189177"></a><h3>
1555
 
<a name="g-option-group-set-parse-hooks"></a>g_option_group_set_parse_hooks ()</h3>
1556
 
<a class="indexterm" name="id3189193"></a><pre class="programlisting">void                g_option_group_set_parse_hooks      (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1557
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc">GOptionParseFunc</a> pre_parse_func,
1558
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc">GOptionParseFunc</a> post_parse_func);</pre>
 
1463
<a name="g-option-group-set-parse-hooks"></a><h3>g_option_group_set_parse_hooks ()</h3>
 
1464
<pre class="programlisting">void                g_option_group_set_parse_hooks      (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1465
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">GOptionParseFunc</a> pre_parse_func,
 
1466
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionParseFunc" title="GOptionParseFunc ()">GOptionParseFunc</a> post_parse_func);</pre>
1559
1467
<p>
1560
1468
Associates two functions with <em class="parameter"><code>group</code></em> which will be called 
1561
 
from <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> before the first option is parsed
 
1469
from <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()"><code class="function">g_option_context_parse()</code></a> before the first option is parsed
1562
1470
and after the last option has been parsed, respectively.
1563
1471
</p>
1564
1472
<p>
1565
1473
Note that the user data to be passed to <em class="parameter"><code>pre_parse_func</code></em> and
1566
1474
<em class="parameter"><code>post_parse_func</code></em> can be specified when constructing the group
1567
 
with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new"><code class="function">g_option_group_new()</code></a>.</p>
 
1475
with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()"><code class="function">g_option_group_new()</code></a>.</p>
1568
1476
<p>
1569
 
 
1570
1477
</p>
1571
1478
<div class="variablelist"><table border="0">
1572
1479
<col align="left" valign="top">
1573
1480
<tbody>
1574
1481
<tr>
1575
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
1576
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>
1577
 
</td>
1578
 
</tr>
1579
 
<tr>
1580
 
<td><p><span class="term"><em class="parameter"><code>pre_parse_func</code></em>&#160;:</span></p></td>
1581
 
<td> a function to call before parsing, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
1582
 
</td>
1583
 
</tr>
1584
 
<tr>
1585
 
<td><p><span class="term"><em class="parameter"><code>post_parse_func</code></em>&#160;:</span></p></td>
1586
 
<td> a function to call after parsing, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 
1482
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
1483
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>
 
1484
</td>
 
1485
</tr>
 
1486
<tr>
 
1487
<td><p><span class="term"><em class="parameter"><code>pre_parse_func</code></em> :</span></p></td>
 
1488
<td> a function to call before parsing, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
 
1489
</td>
 
1490
</tr>
 
1491
<tr>
 
1492
<td><p><span class="term"><em class="parameter"><code>post_parse_func</code></em> :</span></p></td>
 
1493
<td> a function to call after parsing, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
1587
1494
</td>
1588
1495
</tr>
1589
1496
</tbody>
1590
1497
</table></div>
1591
 
<p class="since">Since  2.6
1592
 
</p>
 
1498
<p class="since">Since 2.6</p>
1593
1499
</div>
1594
1500
<hr>
1595
1501
<div class="refsect2" lang="en">
1596
 
<a name="id3189371"></a><h3>
1597
 
<a name="GOptionErrorFunc"></a>GOptionErrorFunc ()</h3>
1598
 
<a class="indexterm" name="id3189383"></a><pre class="programlisting">void                (*GOptionErrorFunc)                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext">GOptionContext</a> *context,
1599
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1600
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
1601
 
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre>
 
1502
<a name="GOptionErrorFunc"></a><h3>GOptionErrorFunc ()</h3>
 
1503
<pre class="programlisting">void                (*GOptionErrorFunc)                 (<a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext">GOptionContext</a> *context,
 
1504
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1505
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
1506
                                                         <a class="link" href="glib-Error-Reporting.html#GError" title="GError">GError</a> **error);</pre>
1602
1507
<p>
1603
1508
The type of function to be used as callback when a parse error occurs.
1604
1509
</p>
1606
1511
<col align="left" valign="top">
1607
1512
<tbody>
1608
1513
<tr>
1609
 
<td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
1610
 
<td>The active <a class="link" href="glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a>
 
1514
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
 
1515
<td>The active <a class="link" href="glib-Commandline-option-parser.html#GOptionContext" title="GOptionContext"><span class="type">GOptionContext</span></a>
1611
1516
</td>
1612
1517
</tr>
1613
1518
<tr>
1614
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
 
1519
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
1615
1520
<td>The group to which the function belongs
1616
1521
</td>
1617
1522
</tr>
1618
1523
<tr>
1619
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
1620
 
<td>User data added to the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> containing the option when it
1621
 
  was created with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new"><code class="function">g_option_group_new()</code></a>
 
1524
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
 
1525
<td>User data added to the <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a> containing the option when it
 
1526
  was created with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()"><code class="function">g_option_group_new()</code></a>
1622
1527
</td>
1623
1528
</tr>
1624
1529
<tr>
1625
 
<td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
1626
 
<td>The <a class="link" href="glib-Error-Reporting.html#GError"><span class="type">GError</span></a> containing details about the parse error
1627
 
 
1628
 
 
 
1530
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
 
1531
<td>The <a class="link" href="glib-Error-Reporting.html#GError" title="GError"><span class="type">GError</span></a> containing details about the parse error
1629
1532
</td>
1630
1533
</tr>
1631
1534
</tbody>
1633
1536
</div>
1634
1537
<hr>
1635
1538
<div class="refsect2" lang="en">
1636
 
<a name="id3189534"></a><h3>
1637
 
<a name="g-option-group-set-error-hook"></a>g_option_group_set_error_hook ()</h3>
1638
 
<a class="indexterm" name="id3189549"></a><pre class="programlisting">void                g_option_group_set_error_hook       (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1639
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc">GOptionErrorFunc</a> error_func);</pre>
 
1539
<a name="g-option-group-set-error-hook"></a><h3>g_option_group_set_error_hook ()</h3>
 
1540
<pre class="programlisting">void                g_option_group_set_error_hook       (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1541
                                                         <a class="link" href="glib-Commandline-option-parser.html#GOptionErrorFunc" title="GOptionErrorFunc ()">GOptionErrorFunc</a> error_func);</pre>
1640
1542
<p>
1641
1543
Associates a function with <em class="parameter"><code>group</code></em> which will be called 
1642
 
from <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> when an error occurs.
 
1544
from <a class="link" href="glib-Commandline-option-parser.html#g-option-context-parse" title="g_option_context_parse ()"><code class="function">g_option_context_parse()</code></a> when an error occurs.
1643
1545
</p>
1644
1546
<p>
1645
 
Note that the user data to be passed to <em class="parameter"><code>pre_parse_func</code></em> and
1646
 
<em class="parameter"><code>post_parse_func</code></em> can be specified when constructing the group
1647
 
with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new"><code class="function">g_option_group_new()</code></a>.</p>
 
1547
Note that the user data to be passed to <em class="parameter"><code>error_func</code></em> can be
 
1548
specified when constructing the group with <a class="link" href="glib-Commandline-option-parser.html#g-option-group-new" title="g_option_group_new ()"><code class="function">g_option_group_new()</code></a>.</p>
1648
1549
<p>
1649
 
 
1650
1550
</p>
1651
1551
<div class="variablelist"><table border="0">
1652
1552
<col align="left" valign="top">
1653
1553
<tbody>
1654
1554
<tr>
1655
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
1656
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>
 
1555
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
1556
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>
1657
1557
</td>
1658
1558
</tr>
1659
1559
<tr>
1660
 
<td><p><span class="term"><em class="parameter"><code>error_func</code></em>&#160;:</span></p></td>
 
1560
<td><p><span class="term"><em class="parameter"><code>error_func</code></em> :</span></p></td>
1661
1561
<td> a function to call when an error occurs
1662
1562
</td>
1663
1563
</tr>
1664
1564
</tbody>
1665
1565
</table></div>
1666
 
<p class="since">Since  2.6
1667
 
</p>
 
1566
<p class="since">Since 2.6</p>
1668
1567
</div>
1669
1568
<hr>
1670
1569
<div class="refsect2" lang="en">
1671
 
<a name="id3189682"></a><h3>
1672
 
<a name="g-option-group-set-translate-func"></a>g_option_group_set_translate_func ()</h3>
1673
 
<a class="indexterm" name="id3189699"></a><pre class="programlisting">void                g_option_group_set_translate_func   (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1674
 
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc">GTranslateFunc</a> func,
1675
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
1676
 
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> destroy_notify);</pre>
 
1570
<a name="g-option-group-set-translate-func"></a><h3>g_option_group_set_translate_func ()</h3>
 
1571
<pre class="programlisting">void                g_option_group_set_translate_func   (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1572
                                                         <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()">GTranslateFunc</a> func,
 
1573
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
1574
                                                         <a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> destroy_notify);</pre>
1677
1575
<p>
1678
1576
Sets the function which is used to translate user-visible
1679
1577
strings, for <code class="option">--help</code> output. Different
1680
 
groups can use different <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc"><span class="type">GTranslateFunc</span></a>s. If <em class="parameter"><code>func</code></em>
1681
 
is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, strings are not translated.
 
1578
groups can use different <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()"><span class="type">GTranslateFunc</span></a>s. If <em class="parameter"><code>func</code></em>
 
1579
is <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, strings are not translated.
1682
1580
</p>
1683
1581
<p>
1684
 
If you are using <code class="function">gettext()</code>, you only need to set the translation
1685
 
domain, see <a class="link" href="glib-Commandline-option-parser.html#g-option-group-set-translation-domain"><code class="function">g_option_group_set_translation_domain()</code></a>.</p>
 
1582
If you are using <a
 
1583
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
 
1584
><code class="function">gettext()</code></a>, you only need to set the translation
 
1585
domain, 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>.</p>
1686
1586
<p>
1687
 
 
1688
1587
</p>
1689
1588
<div class="variablelist"><table border="0">
1690
1589
<col align="left" valign="top">
1691
1590
<tbody>
1692
1591
<tr>
1693
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
1694
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>
1695
 
</td>
1696
 
</tr>
1697
 
<tr>
1698
 
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
1699
 
<td> the <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc"><span class="type">GTranslateFunc</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> 
1700
 
</td>
1701
 
</tr>
1702
 
<tr>
1703
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
1704
 
<td> user data to pass to <em class="parameter"><code>func</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
1705
 
</td>
1706
 
</tr>
1707
 
<tr>
1708
 
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em>&#160;:</span></p></td>
1709
 
<td> a function which gets called to free <em class="parameter"><code>data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 
1592
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
1593
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>
 
1594
</td>
 
1595
</tr>
 
1596
<tr>
 
1597
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
 
1598
<td> the <a class="link" href="glib-Commandline-option-parser.html#GTranslateFunc" title="GTranslateFunc ()"><span class="type">GTranslateFunc</span></a>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> 
 
1599
</td>
 
1600
</tr>
 
1601
<tr>
 
1602
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
 
1603
<td> user data to pass to <em class="parameter"><code>func</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
 
1604
</td>
 
1605
</tr>
 
1606
<tr>
 
1607
<td><p><span class="term"><em class="parameter"><code>destroy_notify</code></em> :</span></p></td>
 
1608
<td> a function which gets called to free <em class="parameter"><code>data</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>
1710
1609
</td>
1711
1610
</tr>
1712
1611
</tbody>
1713
1612
</table></div>
1714
 
<p class="since">Since  2.6
1715
 
</p>
 
1613
<p class="since">Since 2.6</p>
1716
1614
</div>
1717
1615
<hr>
1718
1616
<div class="refsect2" lang="en">
1719
 
<a name="id3189939"></a><h3>
1720
 
<a name="g-option-group-set-translation-domain"></a>g_option_group_set_translation_domain ()</h3>
1721
 
<a class="indexterm" name="id3189955"></a><pre class="programlisting">void                g_option_group_set_translation_domain
1722
 
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup">GOptionGroup</a> *group,
1723
 
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *domain);</pre>
 
1617
<a name="g-option-group-set-translation-domain"></a><h3>g_option_group_set_translation_domain ()</h3>
 
1618
<pre class="programlisting">void                g_option_group_set_translation_domain
 
1619
                                                        (<a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup">GOptionGroup</a> *group,
 
1620
                                                         const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *domain);</pre>
1724
1621
<p>
1725
 
A convenience function to use <code class="function">gettext()</code> for translating
 
1622
A convenience function to use <a
 
1623
href="/usr/share/gtk-doc/html/camel/camel-camel-i18n.html#gettext"
 
1624
><code class="function">gettext()</code></a> for translating
1726
1625
user-visible strings.</p>
1727
1626
<p>
1728
 
 
1729
1627
</p>
1730
1628
<div class="variablelist"><table border="0">
1731
1629
<col align="left" valign="top">
1732
1630
<tbody>
1733
1631
<tr>
1734
 
<td><p><span class="term"><em class="parameter"><code>group</code></em>&#160;:</span></p></td>
1735
 
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a>
 
1632
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
 
1633
<td> a <a class="link" href="glib-Commandline-option-parser.html#GOptionGroup" title="GOptionGroup"><span class="type">GOptionGroup</span></a>
1736
1634
</td>
1737
1635
</tr>
1738
1636
<tr>
1739
 
<td><p><span class="term"><em class="parameter"><code>domain</code></em>&#160;:</span></p></td>
 
1637
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
1740
1638
<td> the domain to use
1741
1639
</td>
1742
1640
</tr>
1743
1641
</tbody>
1744
1642
</table></div>
1745
 
<p class="since">Since  2.6
1746
 
</p>
1747
 
</div>
1748
 
</div>
1749
 
<div class="refsect1" lang="en">
1750
 
<a name="id3190055"></a><div class="refsect2" lang="en"><a name="id3190056"></a></div>
 
1643
<p class="since">Since 2.6</p>
 
1644
</div>
 
1645
</div>
 
1646
</div>
 
1647
<div class="footer">
1751
1648
<hr>
1752
 
<div class="refsect2" lang="en"><a name="id3190057"></a></div>
1753
 
</div>
1754
 
</div>
 
1649
          Generated by GTK-Doc V1.11</div>
1755
1650
</body>
1756
1651
</html>