SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Mandrake 10.X libglib2.0_0-devel-2.2.3-1mdk.i586.rpm

GLIB-GENMARSHAL

Section: User Commands (1)
Updated: 18 Oct 2000
Index 

NAME

glib-genmarshal - C code marshaller generation utility for GLib closures 

SYNOPSIS

glib-genmarshal [options] [files...]

 

DESCRIPTION

glib-genmarshal is a small utility that generates C code marshallersfor callback functions of the GClosure mechanism in the GObject sublibraryof GLib. The marshaller functions have a standard signature, they get passedin the invoking closure, an array of value structures holding the callbackfunction parameters and a value structure for the return value of thecallback. The marshaller is then responsible to call the respective C codefunction of the closure with all the parameters on the stack and to collectits return value.

 

INVOCATION

glib-genmarshal takes a list of marshallers to generate as input.The marshaller list is either read from standard input or from filespassed as additional arguments on the command line.

 

Options

--header
Generate header file contents of the marshallers.
--body
Generate C code file contents of the marshallers.
--prefix=string, --prefix string
Specify marshaller prefix. The default prefix is `g_cclosure_marshal'.
--skip-source
Skip source location remarks in generated comments.
--nostdinc
Do not use the standard marshallers of the GObject library, and skip gmarshal.h includedirective in generated header files.
--g-fatal-warnings
Make warnings fatal, that is, exit immediately once a warning occurs.
-h, --help
Print brief help and exit.
-v, --version
Print version and exit.

 

Marshaller list format

The marshaller lists are processed line by line, a line can contain acomment in the form of

# this is a comment

or a marshaller specification of the form

RTYPE:PTYPE

RTYPE:PTYPE,PTYPE

RTYPE:PTYPE,PTYPE,PTYPE

# up to 16 PTYPEs may be present

The RTYPE part specifies the callback's return type andthe PTYPEs right to the colon specify the callback'sparameter list, except for the first and the last arguments whichare always pointers.

 

Parameter types

Currently, the following types are supported:
VOID
indicates no return type, or no extra parameters. if VOID is used asthe parameter list, no additional parameters may be present.
BOOLEAN
for boolean types (gboolean)
CHAR
for signed char types (gchar)
UCHAR
for unsigned char types (guchar)
INT
for signed integer types (gint)
UINT
for unsigned integer types (guint)
LONG
for signed long integer types (glong)
ULONG
for unsigned long integer types (gulong)
ENUM
for enumeration types (gint)
FLAGS
for flag enumeration types (guint)
FLOAT
for single-precision float types (gfloat)
DOUBLE
for double-precision float types (gdouble)
STRING
for string types (gchar*)
BOXED
for boxed (anonymous but reference counted) types (GBoxed*)
PARAM
for GParamSpec or derived types (GParamSpec*)
POINTER
for anonymous pointer types (gpointer)
OBJECT
for GObject or derived types (GObject*)
NONE
deprecated alias for VOID
BOOL
deprecated alias for BOOLEAN

 

EXAMPLE

To generate marshallers for the following callback functions:

void   foo (gpointer data1,            gpointer data2);void   bar (gpointer data1,            gint     param1,            gpointer data2);gfloat baz (gpointer data1,            gboolean param1,            guchar   param2,            gpointer data2);

The marshaller list has to look like this:

VOID:VOIDVOID:INTFLOAT:BOOLEAN,UCHAR

The generated marshallers have the arguments encodedin their function name. For this particular list, theyareg_cclosure_marshal_VOID__VOID(),g_cclosure_marshal_VOID__INT(), g_cclosure_marshal_FLOAT__BOOLEAN_UCHAR().

They can be used directly for GClosures or be passed in asthe GSignalCMarshaller c_marshaller; argument upon creationof signals:

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);

 

SEE ALSO

glib-mkenums(1)

 

BUGS

None known yet.

 

AUTHOR

glib-genmarshalhas been written by Tim Janik <timjAATTgtk.org>.

This manual page was provided by Tim Janik <timjAATTgtk.org>.


 

Index

NAME
SYNOPSIS
DESCRIPTION
INVOCATION
Options
Marshaller list format
Parameter types
EXAMPLE
SEE ALSO
BUGS
AUTHOR

This document was created byman2html,using the manual pages.