1 .TH GLIB-GENMARSHAL 1 "18 Oct 2000"
3 glib-genmarshal \- C code marshaller generation utility for GLib closures
6 \fBglib-genmarshal\fP [\fIoptions\fP] [\fIfiles...\fP]
9 \fBglib-genmarshal\fP is a small utility that generates C code marshallers
10 for callback functions of the GClosure mechanism in the GObject sublibrary
11 of GLib. The marshaller functions have a standard signature, they get passed
12 in the invoking closure, an array of value structures holding the callback
13 function parameters and a value structure for the return value of the
14 callback. The marshaller is then responsible to call the respective C code
15 function of the closure with all the parameters on the stack and to collect
20 \fBglib-genmarshal\fP takes a list of marshallers to generate as input.
21 The marshaller list is either read from standard input or from files
22 passed as additional arguments on the command line.
27 Generate header file contents of the marshallers.
30 Generate C code file contents of the marshallers.
32 \fI--prefix=string, --prefix string
33 Specify marshaller prefix. The default prefix is `\fIg_cclosure_marshal\fP'.
36 Skip source location remarks in generated comments.
39 Make warnings fatal, that is, exit immediately once a warning occours.
42 Print brief help and exit.
45 Print version and exit.
48 .SS Marshaller list format
50 The marshaller lists are processed line by line, a line can contain a
51 comment in the form of
57 or a marshaller specification of the form
60 \fIRTYPE\fP:\fBPTYPE\fP
62 \fIRTYPE\fP:\fBPTYPE\fP,\fBPTYPE\fP
64 \fIRTYPE\fP:\fBPTYPE\fP,\fBPTYPE\fP,\fBPTYPE\fP
66 # up to 16 \fBPTYPE\fPs may be present
69 The \fIRTYPE\fP part specifies the callback's return type and
70 the \fBPTYPE\fPs right to the colon specify the callback's
71 parameter list, except for the first and the last arguments which
76 Currently, the following types are supported:
79 indicates no return type, or no extra parameters. if \fIVOID\fP is used as
80 the parameter list, no additional parameters may be present.
83 for boolean types (gboolean)
86 for signed char types (gchar)
89 for unsigned char types (guchar)
92 for signed integer types (gint)
95 for unsigned integer types (guint)
98 for signed long integer types (glong)
101 for unsigned long integer types (gulong)
104 for enumeration types (gint)
107 for flag enumeration types (guint)
110 for single-precision float types (gfloat)
113 for double-precision float types (gdouble)
116 for string types (gchar*)
119 for boxed (anonymous but reference counted) types (GBoxed*)
122 for anonymous pointer types (gpointer)
125 for GObject or derived types (GObject*)
128 deprecated alias for \fIVOID\fP
131 deprecated alias for \fIBOOLEAN\fP
134 To generate marshallers for the following callback functions:
138 void foo (gpointer data1,
140 void bar (gpointer data1,
143 gfloat baz (gpointer data1,
150 The marshaller list has to look like this:
160 The generated marshallers have the arguments encoded
161 in their function name. For this particular list, they
163 g_cclosure_marshal_VOID__VOID(),
164 g_cclosure_marshal_VOID__INT(),
165 g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR().
167 They can be used directly for GClosures or be passed in as
168 the GSignalCMarshaller c_marshaller; argument upon creation
172 GClosure *cc_foo, *cc_bar, *cc_baz;
174 cc_foo = g_cclosure_new (NULL, foo, NULL);
175 g_closure_set_marshal (cc_foo, g_cclosure_marshal_VOID__VOID);
176 cc_bar = g_cclosure_new (NULL, bar, NULL);
177 g_closure_set_marshal (cc_bar, g_cclosure_marshal_VOID__INT);
178 cc_baz = g_cclosure_new (NULL, baz, NULL);
179 g_closure_set_marshal (cc_baz, g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR);
194 has been written by Tim Janik <timj@gtk.org>.
196 This manual page was provided by Tim Janik <timj@gtk.org>.