~ivoks/ubuntu/lucid/glib2.0/887946

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>glib-mkenums</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GObject Reference Manual">
<link rel="up" href="rn02.html" title="Tools Reference">
<link rel="prev" href="rn02.html" title="Tools Reference">
<link rel="next" href="glib-genmarshal.html" title="glib-genmarshal">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="rn02.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="rn02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GObject Reference Manual</th>
<td><a accesskey="n" href="glib-genmarshal.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry" title="glib-mkenums">
<a name="glib-mkenums"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">glib-mkenums</span></h2>
<p>glib-mkenums — C language enum description generation utility</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<h2>Synopsis</h2>
<div class="cmdsynopsis"><p><code class="command">glib-mkenums</code>  [options...] [files...]</p></div>
</div>
<div class="refsect1" title="Description">
<a name="id563870"></a><h2>Description</h2>
<p><span class="command"><strong>glib-mkenums</strong></span> is a small perl-script utility that parses C
code to extract enum definitions and produces enum descriptions based on text
templates specified by the user. Most frequently this script is used to 
produce C code that contains enum values as strings so programs can provide 
value name strings for introspection.
</p>
</div>
<div class="refsect1" title="Invocation">
<a name="id559876"></a><h2>Invocation</h2>
<p><span class="command"><strong>glib-mkenums</strong></span> takes a list of valid C code files as
input. The options specified control the text that is output, certain 
substitutions are performed on the text templates for keywords enclosed 
in @ characters.
</p>
<div class="refsect2" title="Options">
<a name="id604549"></a><h3>Options</h3>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><code class="option">--fhead</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> prior to processing input files.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--fprod</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> everytime a new input file 
is being processed.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--ftail</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> after all input files have been 
processed.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--eprod</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> everytime an enum is encountered 
in the input files.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--vhead</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> before iterating over the set of 
values of an enum.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--vprod</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> for every value of an enum.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--vtail</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Put out <em class="replaceable"><code>text</code></em> after iterating over all values 
of an enum.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--comments</code> <em class="replaceable"><code>text</code></em></span></p></td>
<td><p>
Template for auto-generated comments, the default (for C code generations) is
<code class="literal">"/* @comment@ */"</code>.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--template</code> <em class="replaceable"><code>file</code></em></span></p></td>
<td>
<p>
Read templates from the given file. The templates are enclosed in
specially-formatted C comments
</p>
<pre class="programlisting">
/*** BEGIN section ***/
/*** END section ***/
</pre>
<p>
where section may be <code class="literal">file-header</code>, 
<code class="literal">file-production</code>, <code class="literal">file-tail</code>,
<code class="literal">enumeration-production</code>, <code class="literal">value-header</code>, 
<code class="literal">value-production</code>, <code class="literal">value-tail</code> or
<code class="literal">comment</code>.
</p>
</td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--help</code></span></p></td>
<td><p>
Print brief help and exit.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="option">--version</code></span></p></td>
<td><p>
Print version and exit.
</p></td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="Production text substitutions">
<a name="id577314"></a><h3>Production text substitutions</h3>
<p>
Certain keywords enclosed in @ characters will be substituted in the 
emitted text. For the substitution examples of the keywords below, 
the following example enum definition is assumed:
</p>
<pre class="programlisting">
typedef enum
{
  PREFIX_THE_XVALUE    = 1 &lt;&lt; 3,
  PREFIX_ANOTHER_VALUE = 1 &lt;&lt; 4
} PrefixTheXEnum;
</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">@EnumName@</span></p></td>
<td><p>
The name of the enum currently being processed, enum names are assumed to be
properly namespaced and to use mixed capitalization to separate
words (e.g. PrefixTheXEnum).
</p></td>
</tr>
<tr>
<td><p><span class="term">@enum_name@</span></p></td>
<td><p>
The enum name with words lowercase and word-separated by underscores 
(e.g. prefix_the_xenum).
</p></td>
</tr>
<tr>
<td><p><span class="term">@ENUMNAME@</span></p></td>
<td><p>
The enum name with words uppercase and word-separated by underscores 
(e.g. PREFIX_THE_XENUM).
</p></td>
</tr>
<tr>
<td><p><span class="term">@ENUMSHORT@</span></p></td>
<td><p>
The enum name with words uppercase and word-separated by underscores, 
prefix stripped (e.g. THE_XENUM).
</p></td>
</tr>
<tr>
<td><p><span class="term">@VALUENAME@</span></p></td>
<td><p>
The enum value name currently being processed with words uppercase and 
word-separated by underscores,
this is the assumed literal notation of enum values in the C sources 
(e.g. PREFIX_THE_XVALUE).
</p></td>
</tr>
<tr>
<td><p><span class="term">@valuenick@</span></p></td>
<td><p>
A nick name for the enum value currently being processed, this is usually 
generated by stripping common prefix words of all the enum values of the 
current enum, the words are lowercase and underscores are substituted by a 
minus (e.g. the-xvalue).
</p></td>
</tr>
<tr>
<td><p><span class="term">@type@</span></p></td>
<td><p>
This is substituted either by "enum" or "flags", depending on whether the 
enum value definitions contained bit-shift operators or not (e.g. flags).
</p></td>
</tr>
<tr>
<td><p><span class="term">@Type@</span></p></td>
<td><p>
The same as <code class="literal">@type@</code> with the first letter capitalized (e.g. Flags).
</p></td>
</tr>
<tr>
<td><p><span class="term">@TYPE@</span></p></td>
<td><p>
The same as <code class="literal">@type@</code> with all letters uppercased (e.g. FLAGS).
</p></td>
</tr>
<tr>
<td><p><span class="term">@filename@</span></p></td>
<td><p>
The name of the input file currently being processed (e.g. foo.h).
</p></td>
</tr>
<tr>
<td><p><span class="term">@basename@</span></p></td>
<td><p>
The base name of the input file currently being processed (e.g. foo.h). (Since: 2.22)
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="Trigraph extensions">
<a name="id558311"></a><h3>Trigraph extensions</h3>
<p>
Some C comments are treated specially in the parsed enum definitions, 
such comments start out with the trigraph sequence <code class="literal">/*&lt;</code> 
and end with the trigraph sequence <code class="literal">&gt;*/</code>.
Per enum definition, the options "skip" and "flags" can be specified, to 
indicate this enum definition to be skipped, or for it to be treated as 
a flags definition, or to specify the common prefix to be stripped from 
all values to generate value nicknames, respectively. The "lowercase_name"
option can be used to specify the word separation used in the *_get_type()
function. For instance, /*&lt; lowercase_name=gnome_vfs_uri_hide_options &gt;*/.
</p>
<p>
Per value definition, the options "skip" and "nick" are supported. 
The former causes the value to be skipped, and the latter can be used to 
specify the otherwise auto-generated nickname.
Examples:
</p>
<pre class="programlisting">
typedef enum /*&lt; skip &gt;*/
{
  PREFIX_FOO
} PrefixThisEnumWillBeSkipped;
typedef enum /*&lt; flags,prefix=PREFIX &gt;*/
{
  PREFIX_THE_ZEROTH_VALUE,	/*&lt; skip &gt;*/
  PREFIX_THE_FIRST_VALUE,
  PREFIX_THE_SECOND_VALUE,
  PREFIX_THE_THIRD_VALUE,	/*&lt; nick=the-last-value &gt;*/
} PrefixTheFlagsEnum;
</pre>
<p>
</p>
</div>
</div>
<div class="refsect1" title="See also">
<a name="id567307"></a><h2>See also</h2>
<p><span class="command"><strong>glib-genmarshal</strong></span>(1)
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>