glib-genmarshal - C code marshaller generation utility for GLib


   glib-genmarshal [OPTION...] [FILE...]


   glib-genmarshal 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.

   glib-genmarshal 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.

   Marshaller list format
   The marshaller lists are processed line by line, a line can contain a
   comment in the form of
   or a marshaller specification of the form


   (up to 16 PTYPEs may be present).

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

   Parameter types
   Currently, the following types are supported:

       indicates no return type, or no extra parameters. If VOID is used
       as the parameter list, no additional parameters may be present.

       for boolean types (gboolean)

       for signed char types (gchar)

       for unsigned char types (guchar)

       for signed integer types (gint)

       for unsigned integer types (guint)

       for signed long integer types (glong)

       for unsigned long integer types (gulong)

       for signed 64bit integer types (gint64)

       for unsigned 64bit integer types (guint64)

       for enumeration types (gint)

       for flag enumeration types (guint)

       for single-precision float types (gfloat)

       for double-precision float types (gdouble)

       for string types (gchar*)

       for boxed (anonymous but reference counted) types (GBoxed*)

       for GParamSpec or derived types (GParamSpec*)

       for anonymous pointer types (gpointer)

       for GObject or derived types (GObject*)

       for GVariant types (GVariant*)

       deprecated alias for VOID

       deprecated alias for BOOLEAN


       Generate header file contents of the marshallers.

       Generate C code file contents of the marshallers.

       Specify marshaller prefix. The default prefix is

       Skip source location remarks in generated comments.

       Use the standard marshallers of the GObject library, and include
       gmarshal.h in generated header files.

       Do not use the standard marshallers of the GObject library, and
       skip gmarshal.h include directive in generated header files.

       Mark generated functions as internal, using G_GNUC_INTERNAL.

       Generate valist marshallers, for use with

   -v, --version
       Print version information.

       Make warnings fatal, that is, exit immediately once a warning

   -h, --help
       Print brief help and exit.

   -v, --version
       Print version and exit.

       Write output to FILE instead of stdout.


   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 file has to look like this:


   and you call glib-genmarshal like this:

       glib-genmarshal --header marshaller.list > marshaller.h
       glib-genmarshal --body marshaller.list > marshaller.c

   The generated marshallers have the arguments encoded in their function
   name. For this particular list, they are


   They can be used directly for GClosures or be passed in as the
   GSignalCMarshaller c_marshaller; argument upon creation of signals:

       GClosure *cc_foo, *cc_bar, *cc_baz;

       cc_foo = g_cclosure_new (NULL, foo, NULL);
       g_closure_set_marshal (cc_foo, g_cclosure_user_marshal_VOID__VOID);
       cc_bar = g_cclosure_new (NULL, bar, NULL);
       g_closure_set_marshal (cc_bar, g_cclosure_user_marshal_VOID__INT);
       cc_baz = g_cclosure_new (NULL, baz, NULL);
       g_closure_set_marshal (cc_baz, g_cclosure_user_marshal_FLOAT__BOOLEAN_UCHAR);




Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.

Free Software

Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.

Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.

Free Books

The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.

Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.

Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.