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<
refentry id="glib-genmarshal-1">
10139N/A<
refmeta><
refentrytitle>glib-genmarshal</
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-genmarshal</
primary></
indexterm><
indexterm><
primary>
10139N/Agenerates C code marshallers for GLib closures</
primary></
indexterm><
refnamediv 10139N/Aid="glib-genmarshal-1-name"><
refname>glib-genmarshal</
refname><
refpurpose>generates
11913N/AC code marshallers for GLib closures</
refpurpose></
refnamediv>
10139N/A<
refsynopsisdiv id="glib-genmarshal-1-synp"><
title>&synp-tt;</
title>
10139N/A<
cmdsynopsis><
command>&cmd;</
command>
11913N/A<
arg choice="opt"><
option>-body</
option></
arg>
10139N/A<
arg choice="opt"><
option>-g-fatal-warnings</
option></
arg>
10139N/A<
arg choice="opt"><
option>-header</
option></
arg>
10139N/A<
arg choice="opt"><
option>-help</
option></
arg>
10139N/A<
arg choice="opt"><
option>-nostdinc</
option> | <
option>-stdinc</
option></
arg>
10139N/A<
arg choice="opt"><
option>-prefix=<
replaceable>dir</
replaceable></
option></
arg>
10139N/A<
arg choice="opt"><
option>-skip-source</
option></
arg>
10139N/A<
arg choice="opt"><
option>-version</
option></
arg>
11913N/A<
arg choice="opt" rep="repeat"><
option role="nodash"><
replaceable>file</
replaceable></
option></
arg>
10139N/A<
refsect1 id="glib-genmarshal-1-desc"><
title>&desc-tt;</
title>
10139N/A<
para><
command>&cmd;</
command> generates C code marshallers for callback functions
10139N/Aof the GClosure mechanism in the GObject sublibrary of GLib. The marshaller
10139N/Afunctions have a standard signature. The following are passed to the marshaller
10139N/Afunctions: the invoking closure, an array of value structures holding the
10139N/Acallback function parameters, and a value structure for the return value of
10139N/Athe callback. The marshaller then calls the C code function of the closure
10139N/Awith all of the parameters on the stack, and collects the return value.</
para>
11913N/A<
para><
command>&cmd;</
command> generates the specified list of marshallers.
10139N/AThe marshaller list is either read from standard input or from files passed
10139N/Aas additional arguments on the command line.</
para>
10139N/A<
refsect1 id="glib-genmarshal-1-exde"><
title>&exde-tt;</
title>
10139N/A<
para>The marshaller lists are processed line by line. A line can contain
10139N/Aa comment in the following format:</
para>
10139N/A<
para><
screen># this is a comment</
screen></
para>
10139N/A<
para>A marshaller list can contain a marshaller specification in the following
10139N/A<
para><
screen><
replaceable>RTYPE</
replaceable>:<
replaceable>PTYPE</
replaceable>
10139N/A<
replaceable>RTYPE</
replaceable>:<
replaceable>PTYPE</
replaceable>,<
replaceable>
10139N/A<
replaceable>RTYPE</
replaceable>:<
replaceable>PTYPE</
replaceable>,<
replaceable>
10139N/APTYPE</
replaceable>,<
replaceable>PTYPE</
replaceable>
10139N/A# up to 16 <
replaceable>PTYPE</
replaceable>s may be present</
screen></
para>
10139N/A<
para>RTYPE specifies the callback return type. PTYPE specifies the callback
11913N/Aparameter list, except for the first and the last arguments which are always
11913N/A<
refsect2 id="glib-genmarshal-1-exde-ptyp"><
title>Parameter Types</
title>
10139N/A<
para>Currently, the following parameter types are supported:</
para>
10139N/A<
variablelist><
varlistentry><
term><
literal>BOOL</
literal></
term><
listitem>
10139N/A<
para>Deprecated alias for <
literal>BOOLEAN</
literal>.</
para>
10139N/A<
varlistentry><
term><
literal>BOOLEAN</
literal></
term><
listitem><
para>Boolean
10139N/Atype (<
literal>gboolean</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>BOXED</
literal></
term><
listitem><
para>Boxed,
10139N/Aanonymous but reference counted, type (<
literal>GBoxed*</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>CHAR</
literal></
term><
listitem><
para>Signed char
10139N/Atype (<
literal>gchar</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>DOUBLE</
literal></
term><
listitem><
para>Double-precision
10139N/Afloat type (<
literal>gdouble</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>ENUM</
literal></
term><
listitem><
para>Enumeration
10139N/Atype (<
literal>gint</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>FLAGS</
literal></
term><
listitem><
para>Flag enumeration
10139N/Atype (<
literal>guint</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>FLOAT</
literal></
term><
listitem><
para>Single-precision
10139N/Afloat type (<
literal>gfloat</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>INT</
literal></
term><
listitem><
para>Signed integer
11913N/Atype (<
literal>gint</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>INT64</
literal></
term><
listitem><
para>Signed 64bit integer type (<
literal>gint64</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>LONG</
literal></
term><
listitem><
para>Signed long
10139N/Ainteger type (<
literal>glong</
literal>).</
para>
10139N/A<
varlistentry><
term><
literal>NONE</
literal></
term><
listitem><
para>Deprecated
10139N/Aalias for <
literal>VOID</
literal>.</
para>
10139N/A<
varlistentry><
term><
literal>OBJECT</
literal></
term><
listitem><
para>GObject
10139N/Aor derived type (<
literal>GObject*</
literal>).</
para>
11904N/A<
varlistentry><
term><
literal>PARAM</
literal></
term><
listitem><
para>GParamSpec
11904N/Aor derived type (<
literal>GParamSpec*</
literal>).</
para>
11913N/A<
varlistentry><
term><
literal>POINTER</
literal></
term><
listitem><
para>Anonymous
11933N/Apointer type (<
literal>gpointer</
literal>).</
para>
11933N/A<
varlistentry><
term><
literal>STRING</
literal></
term><
listitem><
para>String
10139N/Atype (<
literal>gchar*</
literal>).</
para>
<
varlistentry><
term><
literal>UCHAR</
literal></
term><
listitem><
para>Unsigned
char type (<
literal>guchar</
literal>).</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
literal>UINT</
literal></
term><
listitem><
para>Unsigned
integer type (<
literal>guint</
literal>).</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
literal>UINT64</
literal></
term><
listitem><
para>Unsigned
64bit integer type (<
literal>guint64</
literal>).</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
literal>ULONG</
literal></
term><
listitem><
para>Unsigned
long integer type (<
literal>gulong</
literal>).</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
literal>VOID</
literal></
term><
listitem><
para>No return
type, or no extra parameters. If <
literal>VOID</
literal> is used as the parameter
list, no additional parameters may be present.</
para>
</
listitem></
varlistentry>
</
variablelist></
refsect2>
<
refsect1 id="glib-genmarshal-1-opts"><
title>&opts-tt;</
title>
<
para>The following options are supported:</
para>
<
variablelist termlength="medium"><
varlistentry><
term><
option>-body</
option></
term>
<
listitem><
para>Generate the C code file contents of the marshallers.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option>-g-fatal-warnings<?
Pub Caret></
option></
term>
<
listitem><
para>Make warnings fatal, that is, exit immediately once a warning
</
listitem></
varlistentry>
<
varlistentry><
term><
option>-header</
option></
term><
listitem><
para>Generate
the header file contents of the marshallers.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option role="nodash">-h</
option>, <
option>-help</
option></
term><
listitem><
para>Show usage
and basic help information.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option>-nostdinc</
option></
term><
listitem><
para>Do not
use the standard marshallers of the GObject library, and skip the <
filename>
gmarshal.h</
filename> include directive in generated header files.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option>-stdinc</
option></
term><
listitem><
para>Use
the standard marshallers of the GObject library, and use the <
filename>
gmarshal.h</
filename> include directive in generated header files.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option>-prefix=<
replaceable>dir</
replaceable></
option></
term>
<
listitem><
para>Specify the marshaller prefix. The default prefix is <
literal>
g_cclosure_marshal</
literal>.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option>-skip-source</
option></
term><
listitem><
para>Skip
source location remarks in generated comments.</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
option role="nodash">-v</
option>, <
option>-version</
option></
term><
listitem><
para>Show version
</
listitem></
varlistentry>
</
variablelist></
refsect1>
<
refsect1 id="glib-genmarshal-1-oper"><
title>&oper-tt;</
title>
<
para>The following operands are supported:</
para>
<
variablelist termlength="medium"><
varlistentry><
term><
option role="nodash"><
replaceable>
file</
replaceable></
option></
term><
listitem><
para>Specifies the marshaller
</
listitem></
varlistentry>
</
variablelist></
refsect1>
<
refsect1 id="glib-genmarshal-1-exam"><
title>&exam-tt;</
title>
<
example role="example"><
title>Generating Marshallers</
title>
<
para>This example shows how to generate marshallers for the following callback
<
para><
screen>void foo (gpointer data1,
void bar (gpointer data1,
gfloat baz (gpointer data1,
gpointer data2);</
screen></
para>
<
para>The marshaller list is as follows:</
para>
FLOAT:BOOLEAN,UCHAR</
screen>
<
para>The generated marshallers have the arguments encoded in their function
name. For this particular list, they are as follows:</
para>
<
screen>g_cclosure_marshal_VOID__VOID()
g_cclosure_marshal_VOID__INT()
g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR()</
screen>
<
para>The generated marshallers can be used directly for GClosures or can
be passed in as the GSignalCMarshaller c_marshaller; argument upon creation
<
screen>GClosure *cc_foo, *cc_bar, *cc_baz;
cc_foo = g_cclosure_new (NULL, foo, NULL);
g_closure_set_marshal (cc_foo, g_cclosure_marshal_VOID__VOID);
cc_bar = g_cclosure_new (NULL, bar, NULL);
g_closure_set_marshal (cc_bar, g_cclosure_marshal_VOID__INT);
cc_baz = g_cclosure_new (NULL, baz, NULL);
g_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR);</
screen>
<
refsect1 id="glib-genmarshal-1-exit"><
title>&exit-tt;</
title>
<
para>The following exit values are returned:</
para>
<
variablelist termlength="xtranarrow"><
varlistentry><
term><
returnvalue>0</
returnvalue></
term>
<
listitem><
para>Application exited successfully</
para>
</
listitem></
varlistentry>
<
varlistentry><
term><
returnvalue>>0</
returnvalue></
term><
listitem><
para>Application
exited with failure</
para>
</
listitem></
varlistentry>
</
variablelist></
refsect1>
<
refsect1 id="glib-genmarshal-1-file"><
title>&file-tt;</
title>
<
para>The following files are used by this application:</
para>
<
variablelist termlength="wide"><
varlistentry><
term><
filename>/
usr/
bin/&cmd;</
filename>
</
term><
listitem><
para>The command-line executable for the application.</
para>
</
listitem></
varlistentry>
<
para>Location of developer documentation</
para></
listitem>
</
variablelist></
refsect1>
<
refsect1 id="glib-genmarshal-1-attr"><
title>&attr-tt;</
title>
<
para>See <
olink targetdocent="REFMAN5" localinfo="attributes-5"><
citerefentry>
<
refentrytitle>attributes</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry></
olink>
for descriptions of the following attributes:</
para>
<
informaltable frame="all">
<
tgroup cols="2" colsep="1" rowsep="1"><
colspec colname="COLSPEC0" colwidth="1*">
<
colspec colname="COLSPEC1" colwidth="1*">
<
row><
entry align="center" valign="middle">ATTRIBUTE TYPE</
entry><
entry align="center"valign="middle">ATTRIBUTE VALUE</
entry></
row>
<
row><
entry><
para>Availability</
para></
entry><
entry><
para>SUNWgnome-base-libs-devel
<
row><
entry colname="COLSPEC0"><
para>Interface stability</
para></
entry><
entrycolname="COLSPEC1"><
para>Committed</
para></
entry></
row>
<
refsect1 id="glib-genmarshal-1-also"><
title>&also-tt;</
title>
<!--Reference to another man page--> <!--Reference to a Help manual--> <!--Reference to a book.--> <
citerefentry><
refentrytitle>gdk-pixbuf-csource</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>gdk-pixbuf-query-loaders</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>glib-gettextize</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>glib-mkenums</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>gobject-query</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>gtk-query-immodules-2.0</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>gtk-update-icon-cache</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry>,
<
citerefentry><
refentrytitle>libglib-2.0</
refentrytitle><
manvolnum>3</
manvolnum></
citerefentry>
<
refsect1 id="glib-genmarshal-1-note"><
title>¬e-tt;</
title>
<
para>Updated by Brian Cameron, Sun Microsystems Inc., 2003, 2006. Written by Tim