2 .\" Title: glib-genmarshal
3 .\" Author: [see the "Author" section]
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
6 .\" Manual: User Commands
7 .\" Source: User Commands
10 .TH "GLIB\-GENMARSHAL" "1" "03/05/2012" "User Commands" "User Commands"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 glib-genmarshal \- C code marshaller generation utility for GLib closures
33 .HP \w'\fBglib\-genmarshal\fR\ 'u
34 \fBglib\-genmarshal\fR [options...] [files...]
37 \fBglib\-genmarshal\fR
38 is a small utility that generates C code marshallers for callback functions of the GClosure mechanism in the GObject sublibrary of GLib\&. The marshaller functions have a standard signature, they get passed in the invoking closure, an array of value structures holding the callback function parameters and a value structure for the return value of the callback\&. The marshaller is then responsible to call the respective C code function of the closure with all the parameters on the stack and to collect its return value\&.
41 \fBglib\-genmarshal\fR
42 takes a list of marshallers to generate as input\&. The marshaller list is either read from standard input or from files passed as additional arguments on the command line\&.
47 Generate header file contents of the marshallers\&.
52 Generate C code file contents of the marshallers\&.
55 \fB\-\-prefix=string\fR, \fB\-\-prefix string\fR
57 Specify marshaller prefix\&. The default prefix is
58 `g_cclosure_marshal\*(Aq\&.
61 \fB\-\-skip\-source\fR
63 Skip source location remarks in generated comments\&.
68 Do not use the standard marshallers of the GObject library, and skip
70 include directive in generated header files\&.
73 \fB\-\-g\-fatal\-warnings\fR
75 Make warnings fatal, that is, exit immediately once a warning occurs\&.
78 \fB\-h\fR, \fB\-\-help\fR
80 Print brief help and exit\&.
83 \fB\-v\fR, \fB\-\-version\fR
85 Print version and exit\&.
87 .SS "Marshaller list format"
89 The marshaller lists are processed line by line, a line can contain a comment in the form of
101 or a marshaller specification of the form
107 \fIRTYPE\fR:\fIPTYPE\fR
108 \fIRTYPE\fR:\fIPTYPE\fR,\fIPTYPE\fR
109 \fIRTYPE\fR:\fIPTYPE\fR,\fIPTYPE\fR,\fIPTYPE\fR
116 \fIPTYPE\fRs may be present)\&.
120 part specifies the callback\*(Aqs return type and the
121 \fIPTYPE\fRs right to the colon specify the callback\*(Aqs parameter list, except for the first and the last arguments which are always pointers\&.
122 .SS "Parameter types"
124 Currently, the following types are supported:
128 indicates no return type, or no extra parameters\&. If
130 is used as the parameter list, no additional parameters may be present\&.
135 for boolean types (gboolean)
140 for signed char types (gchar)
145 for unsigned char types (guchar)
150 for signed integer types (gint)
155 for unsigned integer types (guint)
160 for signed long integer types (glong)
165 for unsigned long integer types (gulong)
170 for signed 64bit integer types (gint64)
175 for unsigned 64bit integer types (guint64)
180 for enumeration types (gint)
185 for flag enumeration types (guint)
190 for single\-precision float types (gfloat)
195 for double\-precision float types (gdouble)
200 for string types (gchar*)
205 for boxed (anonymous but reference counted) types (GBoxed*)
210 for GParamSpec or derived types (GParamSpec*)
215 for anonymous pointer types (gpointer)
220 for GObject or derived types (GObject*)
225 for GVariant types (GVariant*)
241 To generate marshallers for the following callback functions:
247 void foo (gpointer data1,
249 void bar (gpointer data1,
252 gfloat baz (gpointer data1,
261 The marshaller list has to look like this:
275 The generated marshallers have the arguments encoded in their function name\&. For this particular list, they are
281 g_cclosure_marshal_VOID__VOID(),
282 g_cclosure_marshal_VOID__INT(),
283 g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR()\&.
289 They can be used directly for GClosures or be passed in as the GSignalCMarshaller c_marshaller; argument upon creation of signals:
295 GClosure *cc_foo, *cc_bar, *cc_baz;
297 cc_foo = g_cclosure_new (NULL, foo, NULL);
298 g_closure_set_marshal (cc_foo, g_cclosure_marshal_VOID__VOID);
299 cc_bar = g_cclosure_new (NULL, bar, NULL);
300 g_closure_set_marshal (cc_bar, g_cclosure_marshal_VOID__INT);
301 cc_baz = g_cclosure_new (NULL, baz, NULL);
302 g_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR);
310 \fBglib\-mkenums\fR(1)
316 \fBglib\-genmarshal\fR
317 has been written by Tim Janik
320 This manual page was provided by Tim Janik