'\" te .TH glib-genmarshal 1 "7 Apr 2003" "SunOS 5.11" "User Commands" .SH "NAME" glib-genmarshal \- generates C code marshallers for GLib closures .SH "SYNOPSIS" .PP \fBglib-genmarshal\fR [-\fB-body\fR] [-\fB-g-fatal-warnings\fR] [-\fB-header\fR] [-\fB-help\fR] [-\fB-internal\fR] [-\fB-nostdinc\fR | -\fB-stdinc\fR] [-\fB-prefix=\fIdir\fR\fR] [-\fB-skip-source\fR] [-\fB-version\fR] [\fB\fIfile\fR\fR\&...] .SH "DESCRIPTION" .PP \fBglib-genmarshal\fR generates C code marshallers for callback functions of the GClosure mechanism in the GObject sublibrary of GLib\&. The marshaller functions have a standard signature\&. The following are passed to the marshaller functions: 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 then calls the C code function of the closure with all of the parameters on the stack, and collects the return value\&. .PP \fBglib-genmarshal\fR generates the specified list of marshallers\&. The marshaller list is either read from standard input or from files passed as additional arguments on the command line\&. .SH "EXTENDED DESCRIPTION" .PP The marshaller lists are processed line by line\&. A line can contain a comment in the following format: .PP .PP .nf # this is a comment .fi .PP A marshaller list can contain a marshaller specification in the following format: .PP .PP .nf \fIRTYPE\fR:\fIPTYPE\fR \fIRTYPE\fR:\fIPTYPE\fR,\fIPTYPE\fR \fIRTYPE\fR:\fIPTYPE\fR,\fIPTYPE\fR,\fIPTYPE\fR # up to 16 \fIPTYPE\fRs may be present .fi .PP RTYPE specifies the callback return type\&. PTYPE specifies the callback parameter list, except for the first and the last arguments which are always pointers\&. .SS "Parameter Types" .PP Currently, the following parameter types are supported: .sp .ne 2 .mk \fB\fBBOOL\fR\fR .in +24n .rt Deprecated alias for \fBBOOLEAN\fR\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBBOOLEAN\fR\fR .in +24n .rt Boolean type (\fBgboolean\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBBOXED\fR\fR .in +24n .rt Boxed, anonymous but reference counted, type (\fBGBoxed*\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBCHAR\fR\fR .in +24n .rt Signed char type (\fBgchar\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBDOUBLE\fR\fR .in +24n .rt Double-precision float type (\fBgdouble\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBENUM\fR\fR .in +24n .rt Enumeration type (\fBgint\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBFLAGS\fR\fR .in +24n .rt Flag enumeration type (\fBguint\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBFLOAT\fR\fR .in +24n .rt Single-precision float type (\fBgfloat\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBINT\fR\fR .in +24n .rt Signed integer type (\fBgint\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBINT64\fR\fR .in +24n .rt Signed 64bit integer type (\fBgint64\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBLONG\fR\fR .in +24n .rt Signed long integer type (\fBglong\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBNONE\fR\fR .in +24n .rt Deprecated alias for \fBVOID\fR\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBOBJECT\fR\fR .in +24n .rt GObject or derived type (\fBGObject*\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBPARAM\fR\fR .in +24n .rt GParamSpec or derived type (\fBGParamSpec*\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBPOINTER\fR\fR .in +24n .rt Anonymous pointer type (\fBgpointer\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBSTRING\fR\fR .in +24n .rt String type (\fBgchar*\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBUCHAR\fR\fR .in +24n .rt Unsigned char type (\fBguchar\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBUINT\fR\fR .in +24n .rt Unsigned integer type (\fBguint\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBUINT64\fR\fR .in +24n .rt Unsigned 64bit integer type (\fBguint64\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBULONG\fR\fR .in +24n .rt Unsigned long integer type (\fBgulong\fR)\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fBVOID\fR\fR .in +24n .rt No return type, or no extra parameters\&. If \fBVOID\fR is used as the parameter list, no additional parameters may be present\&. .sp .sp 1 .in -24n .SH "OPTIONS" .PP The following options are supported: .sp .ne 2 .mk \fB-\fB-body\fR\fR .in +24n .rt Generate the C code file contents of the marshallers\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-g-fatal-warnings\fR\fR .in +24n .rt Make warnings fatal, that is, exit immediately once a warning occurs\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-internal\fR\fR .in +24n .rt Mark generated functions as internal by using the G_GNUC_INTERNAL macro\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-header\fR\fR .in +24n .rt Generate the header file contents of the marshallers\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fB-h\fR, -\fB-help\fR\fR .in +24n .rt Show usage and basic help information\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-nostdinc\fR\fR .in +24n .rt Do not use the standard marshallers of the GObject library, and skip the \fBgmarshal\&.h\fR include directive in generated header files\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-stdinc\fR\fR .in +24n .rt Use the standard marshallers of the GObject library, and use the \fBgmarshal\&.h\fR include directive in generated header files\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-prefix=\fIdir\fR\fR\fR .in +24n .rt Specify the marshaller prefix\&. The default prefix is \fBg_cclosure_marshal\fR\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB-\fB-skip-source\fR\fR .in +24n .rt Skip source location remarks in generated comments\&. .sp .sp 1 .in -24n .sp .ne 2 .mk \fB\fB-v\fR, -\fB-version\fR\fR .in +24n .rt Show version information\&. .sp .sp 1 .in -24n .SH "OPERANDS" .PP The following operands are supported: .sp .ne 2 .mk \fB\fB\fIfile\fR\fR\fR .in +24n .rt Specifies the marshaller to be generated\&. .sp .sp 1 .in -24n .SH "EXAMPLES" .PP \fBExample 1: Generating Marshallers\fR .PP This example shows how to generate marshallers for the following callback functions: .PP .PP .nf void foo (gpointer data1, gpointer data2); void bar (gpointer data1, gint param1, gpointer data2); gfloat baz (gpointer data1, gboolean param1, guchar param2, gpointer data2); .fi .PP The marshaller list is as follows: .PP .nf VOID:VOID VOID:INT FLOAT:BOOLEAN,UCHAR .fi .PP The generated marshallers have the arguments encoded in their function name\&. For this particular list, they are as follows: .PP .nf g_cclosure_marshal_VOID__VOID() g_cclosure_marshal_VOID__INT() g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR() .fi .PP The generated marshallers can be used directly for GClosures or can be passed in as the GSignalCMarshaller c_marshaller; argument upon creation of signals: .PP .nf 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); .fi .SH "EXIT STATUS" .PP The following exit values are returned: .sp .ne 2 .mk \fB\fB0\fR\fR .in +9n .rt Application exited successfully .sp .sp 1 .in -9n .sp .ne 2 .mk \fB\fB>0\fR\fR .in +9n .rt Application exited with failure .sp .sp 1 .in -9n .SH "FILES" .PP The following files are used by this application: .sp .ne 2 .mk \fB\fB/usr/bin/glib-genmarshal\fR\fR .in +32n .rt The command-line executable for the application\&. .sp .sp 1 .in -32n .sp .ne 2 .mk \fB\fB/usr/share/gtk-doc/html/glib\fR\fR .in +32n .rt Location of developer documentation .sp .sp 1 .in -32n .SH "ATTRIBUTES" .PP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .TS tab() allbox; cw(2.750000i)| cw(2.750000i) lw(2.750000i)| lw(2.750000i). ATTRIBUTE TYPEATTRIBUTE VALUE AvailabilitySUNWglib2-devel Interface stabilityCommitted .TE .sp .SH "SEE ALSO" .PP \fBgdk-pixbuf-csource\fR(1), \fBgdk-pixbuf-query-loaders\fR(1), \fBglib-gettextize\fR(1), \fBglib-mkenums\fR(1), \fBgobject-query\fR(1), \fBgtk-query-immodules-2\&.0\fR(1), \fBgtk-update-icon-cache\fR(1), \fBlibglib-2\&.0\fR(3), \fBattributes\fR(5), \fBgnome-interfaces\fR(5) .SH "NOTES" .PP Written by Tim Janik\&. Updated by Brian Cameron, Sun Microsystems Inc\&., 2003, 2006\&. ...\" created by instant / solbook-to-man, Thu 20 Mar 2014, 02:30