10139N/A<!
DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
10139N/A<!--ArborText, Inc., 1988-1999, v.4002-->
10139N/A<!
ENTITY suncopy "Copyright (c) 2003,2006 Sun Microsystems, Inc. All Rights Reserved.">
10139N/A<
refmeta><
refentrytitle>glib-mkenums</
refentrytitle><
manvolnum>1</
manvolnum>
10139N/A<
refmiscinfo class="date">7 Apr 2003</
refmiscinfo>
10139N/A<
refmiscinfo class="sectdesc">&man1;</
refmiscinfo>
10139N/A<
refmiscinfo class="software">&release;</
refmiscinfo>
10139N/A<
refmiscinfo class="arch">generic</
refmiscinfo>
10139N/A<
refmiscinfo class="copyright">&suncopy;</
refmiscinfo>
10139N/A<
indexterm><
primary>glib-mkenums</
primary></
indexterm><
indexterm><
primary>
10139N/Agenerate C language <
literal>enum</
literal> description</
primary></
indexterm>
10139N/A<
refnamediv id="glib-mkenums-1-name"><
refname>glib-mkenums</
refname><
refpurpose>
10139N/Agenerate C language <
literal>enum</
literal> description</
refpurpose></
refnamediv>
10139N/A<
refsynopsisdiv id="glib-mkenums-1-synp"><
title>&synp-tt;</
title>
10139N/A<
cmdsynopsis><
command>&cmd;</
command>
10139N/A<
arg choice="opt"><
option>-comments <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-eprod <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-fhead <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-fprod <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-ftail <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-help</
option></
arg>
10139N/A<
arg choice="opt"><
option>-template <
replaceable>file</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-version</
option></
arg>
10139N/A<
arg choice="opt"><
option>-vhead <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-vprod <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-vtail <
replaceable>text</
replaceable></
option></
arg>
10139N/A<
arg choice="opt" rep="repeat"><
option role="nodash"><
replaceable>file</
replaceable></
option></
arg>
10139N/A<
refsect1 id="glib-mkenums-1-desc"><
title>&desc-tt;</
title>
17616N/A<
command>&cmd;</
command> parses C code to extract <
literal>enum</
literal>
10139N/Adefinitions, and produces <
literal>enum</
literal> descriptions based on text
10139N/Atemplates specified by the user. <
command>&cmd;</
command> produces C code
10139N/Athat contains <
literal>enum</
literal> values as strings, which allows programs
17616N/Ato provide value name strings for introspection.
10139N/A<
command>glib-mkenums</
command> takes a list of valid C code files as input.
10139N/AThe options specified control the text that is output, certain substitutions
10139N/Aare performed on the text templates for keywords enclosed in @ characters.
10139N/A<
refsect1 id="glib-mkenums-1-exde"><
title>&exde-tt;</
title>
17616N/AThis section provides more information about text substitution and trigraph
10139N/A<
refsect2 id="glib-mkenums-1-exde-tsub"><
title>Text Substitution</
title>
17616N/A<
command>&cmd;</
command> substitutes certain keywords, which are enclosed in
17616N/A@ characters, when creating the output text. For the substitution examples of
17616N/Athe keywords in this section, the following example <
literal>enum</
literal>
10139N/A PREFIX_THE_XVALUE = 1 << 3,
10139N/A PREFIX_ANOTHER_VALUE = 1 << 4
17616N/A<
command>&cmd;</
command> substitutes the following keywords:
17616N/A<
variablelist termlength="narrow">
17616N/A<
term><
literal>@EnumName@</
literal></
term>
17616N/AThe name of the <
literal>enum</
literal> currently being
17616N/Aprocessed. <
literal>enum</
literal> names are assumed to be properly namespaced
17616N/Aand to use mixed capitalization to separate words (for example,
17616N/A<
literal>PrefixTheXEnum</
literal>).
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@enum_name@</
literal></
term>
17616N/AThe <
literal>enum</
literal> name with words in lowercase and each word
17616N/Aseparated by underscores (for example, <
literal>prefix_the_xenum</
literal>).
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@ENUMNAME@</
literal></
term>
17616N/AThe <
literal>enum</
literal> name with words in uppercase and each word
17616N/Aseparated by underscores (for example, <
literal>PREFIX_THE_XENUM</
literal>).
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@ENUMSHORT@</
literal></
term>
10139N/AThe <
literal>enum</
literal> name with words in uppercase and each word separated
10139N/Aby underscores, and with the prefix stripped (for example, <
literal>THE_XENUM
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@VALUENAME@</
literal></
term>
10139N/AThe <
literal>enum</
literal> value name currently being processed, with words
10139N/Ain uppercase and each word separated by underscores. This is the assumed literal
17616N/Anotation of <
literal>enum</
literal> values in the C sources (for example,
17616N/A<
literal>PREFIX_THE_XVALUE</
literal>).
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@valuenick@</
literal></
term>
10139N/AA nickname for the <
literal>enum</
literal> value currently being processed.
17616N/AThis is usually generated by stripping the common prefix words of all of the
17616N/A<
literal>enum</
literal> values of the current <
literal>enum</
literal>, with
17616N/Awords in lowercase and underscores substituted by hyphens (for example,
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@type@</
literal></
term>
17616N/AThis is substituted either by "<
literal>enum</
literal>" or
17616N/A"<
literal>flags</
literal>", depending on whether the <
literal>enum</
literal>
17616N/Avalue definitions contain bit-shift operators or not (for example,
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@Type@</
literal></
term>
17616N/ASame as <
literal>@type@</
literal>, but with the first letter capitalized (for
17616N/Aexample, <
literal>Flags</
literal>).
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@TYPE@</
literal></
term>
17616N/ASame as <
literal>@type@</
literal>, but with all letters in uppercase (for
17616N/Aexample, <
literal>FLAGS</
literal>).
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
literal>@filename@</
literal></
term>
17616N/AThe name of the input file currently being processed (for example,
17616N/A</
para></
listitem></
varlistentry>
10139N/A<
refsect2 id="glib-mkenums-1-exde-trex"><
title>Trigraph Extensions</
title>
17616N/ASome C comments in the parsed <
literal>enum</
literal> definitions are treated
17616N/Aas special. Such comments start with the trigraph sequence
17616N/A<
literal>/*<</
literal> and end with the trigraph sequence
12050N/APer <
literal>enum</
literal> definition, the "<
literal>skip</
literal>" and
12050N/A"<
literal>flags</
literal>" options are supported. The <
literal>skip</
literal>
12050N/Aoption indicates that this <
literal>enum</
literal> definition should be
12050N/Askipped. The <
literal>flags</
literal> option specifies that this
12050N/A<
literal>enum</
literal> definition should be treated as a flags definition, or
12050N/Aspecifies the common prefix to be stripped from all values to generate value
12050N/Anicknames. The "<
literal>underscore_name</
literal>" option can be used to
12050N/Aspecify the underscorized name variant used in the *_get_type() function and
17616N/A/*< underscore_name=gnome_vfs_uri_hide_options >*/
17616N/APer value definition, the "<
literal>skip</
literal>" and
12050N/A"<
literal>nick</
literal>" options are supported. The <
literal>skip</
literal>
12050N/Aoption causes the value to be skipped. The <
literal>nick</
literal> option
17616N/Aspecifies the otherwise autogenerated nickname.
10139N/A<
refsect1 id="glib-mkenums-1-opts"><
title>&opts-tt;</
title>
17616N/AThe following options are supported:
17616N/A<
variablelist termlength="medium"><
varlistentry>
17616N/A<
term><
option>-comments <
replaceable> text</
replaceable></
option></
term>
17616N/ATemplate <
replaceable>text</
replaceable> for auto-generated comments, the
17616N/Adefault (for C code generation) is <
screen>"/* @comment@ */"</
screen>
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
option>-eprod <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> every time an <
literal>enum</
literal>
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
option>-fhead <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> prior to processing input files.
17616N/A<
term><
option>-fprod <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> every time a new input file is
17616N/A<
term><
option>-ftail <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> after all input files have been
17616N/A<
term><
option role="nodash">-h</
option>, <
option>-help</
option></
term>
17616N/AShow usage and basic help information.
17616N/A<
term><
option>-template <
replaceable>file</
replaceable></
option></
term>
17616N/ARead template from the given <
replaceable>file</
replaceable>. The templates
17616N/Aare enclosed in specially-formatted C comments
10139N/A/*** BEGIN <
replaceable>section</
replaceable> ***/
10139N/A/*** END <
replaceable>section</
replaceable> ***/
17616N/Awhere <
replaceable>section</
replaceable> may be file-header, file-production,
17616N/Afile-tail, enumeration-production, value-header, value-production, value-tail,
17616N/A<
term><
option role="nodash">-v</
option>, <
option>-version</
option></
term>
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
option>-vhead <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> before iterating the set of values of an
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
option>-vprod <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> for every value of an
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
option>-vtail <
replaceable>text</
replaceable></
option></
term>
17616N/AOutput <
replaceable>text</
replaceable> after iterating all values of an
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
refsect1 id="glib-mkenums-1-oper"><
title>&oper-tt;</
title>
17616N/AThe following operands are supported:
17616N/A<
variablelist termlength="medium"><
varlistentry>
17616N/A<
term><
option role="nodash"><
replaceable>file</
replaceable></
option></
term>
10139N/A<
refsect1 id="glib-mkenums-1-exam"><
title>&exam-tt;</
title>
11904N/A<
example role="example"><
title>Examples of Trigraph Extensions
10139N/Atypedef enum /*< flags,prefix=PREFIX >*/
10139N/A PREFIX_THE_ZEROTH_VALUE, /*< skip >*/
10139N/A PREFIX_THE_THIRD_VALUE, /*< nick=the-last-value >*/
10139N/A<
refsect1 id="glib-mkenums-1-exit"><
title>&exit-tt;</
title>
17616N/AThe following exit values are returned:
17616N/A<
variablelist termlength="xtranarrow"><
varlistentry>
17616N/A<
term><
returnvalue>0</
returnvalue></
term>
17616N/A</
para></
listitem></
varlistentry>
17616N/A<
term><
returnvalue>>0</
returnvalue></
term>
17616N/A</
para></
listitem></
varlistentry>
10139N/A<
refsect1 id="glib-mkenums-1-file"><
title>&file-tt;</
title>
17616N/AThe following files are used by this application:
17616N/A<
variablelist termlength="wide"><
varlistentry>
17616N/AThe command-line executable for the application.
17616N/A</
para></
listitem></
varlistentry>
17616N/ALocation of developer documentation
17616N/A</
para></
listitem></
varlistentry>
10139N/A<
refsect1 id="glib-mkenums-1-attr"><
title>&attr-tt;</
title>
17616N/A<
olink targetdocent="REFMAN5" localinfo="attributes-5">
17616N/A<
citerefentry><
refentrytitle>attributes</
refentrytitle>
17616N/A<
manvolnum>5</
manvolnum></
citerefentry></
olink>
17616N/Afor descriptions of the following attributes:
17616N/A<
tgroup cols="2" colsep="1" rowsep="1">
17616N/A<
colspec colname="COLSPEC0" colwidth="1*">
10139N/A<
colspec colname="COLSPEC1" colwidth="1*">
17616N/A<
entry align="center" valign="middle">ATTRIBUTE TYPE</
entry>
17616N/A<
entry align="center" valign="middle">ATTRIBUTE VALUE</
entry>
17616N/A<
entry><
para>Availability</
para></
entry>
17616N/A<
entry><
para>SUNWglib2-devel</
para></
entry>
17616N/A<
entry colname="COLSPEC0"><
para>Interface stability</
para></
entry>
17616N/A<
entry colname="COLSPEC1"><
para>Committed</
para></
entry>
17616N/A</
tbody></
tgroup></
informaltable>
10139N/A<
refsect1 id="glib-mkenums-1-also"><
title>&also-tt;</
title>
10139N/A<!--Reference to another man page--> 10139N/A<!--Reference to a Help manual--> 10139N/A<
citerefentry><
refentrytitle>gdk-pixbuf-source</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
10139N/A<
citerefentry><
refentrytitle>gdk-pixbuf-query-loaders</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
10139N/A<
citerefentry><
refentrytitle>glib-genmarshal</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
10139N/A<
citerefentry><
refentrytitle>glib-gettextize</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
10139N/A<
citerefentry><
refentrytitle>gobject-query</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
10139N/A<
citerefentry><
refentrytitle>gtk-query-immodules-2.0</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
10139N/A<
citerefentry><
refentrytitle>gtk-update-icon-cache</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
11904N/A<
citerefentry><
refentrytitle>libglib-2.0</
refentrytitle><
manvolnum>3</
manvolnum></
citerefentry>,
11904N/A<
citerefentry><
refentrytitle>attributes</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry>,
11904N/A<
citerefentry><
refentrytitle>gnome-interfaces</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry>
10139N/A<
refsect1 id="glib-mkenums-1-note"><
title>¬e-tt;</
title>
17616N/AWritten by Tim Janik. Updated by Brian Cameron, Sun Microsystems Inc., 2003,