This a C language namespace extension to the Core namespace.

C-specific meta data

The C part of the meta data adds C-specific information about interface elements. To use it, you need to declare it in the XML header:

<?xml version='1.0'

Additions usable for most tags

  • To specify the full C name of an abstract symbol, use "c:identifier". For example:

<class name="Window" parent="Widget" c:identifier="GtkWindow">

Additions usable for <type>

Use <c:typename> to specify the C identifier of a type. Use <c:pointer> to denote pointers.

<parameter name="src">
  <type name="String">
    <c:pointer const="1">
      <c:type name="xmlChar"/>

Additions usable for <parameter> and <return-value>

  • To specify who owns a parameter or a return value, use "c:owner". Allowed values: caller, callee. For example:

<parameter name="protocol" direction="out" c:owner="caller"/>
  <type name="String">
  • To specify that a parameter or a return value is to be freed with a special free function, use "c:free-function".

  <type name="String" c:owner="caller" c:free-function="xml_string_free">
    <c:pointer const="1">
      <c:type name="xmlChar"/>
  • To specify how an abstract callback parameter maps to C types, use c:user-data and c:destroy-notification along with c:parameter-index. For example:

<parameter name="callback">
  <type name="LoadIconFunction">
    <c:user-data name="user_data" c:parameter-index="2"/>
    <c:destroy-notification name="destroy_notify" c:parameter-index="3"/>


A method with a default value which may be NULL

<method name="set_title">
  <c:identifier name="gtk_window_set_title" />
  <parameter name="title">
    <type name="String">
      <c:pointer const="1">
        <c:type name name="gchar" />
      <default value="hello world" />

A typedef

<c:typedef name="GCallback">
        <c:basictype name="void"/> <!-- return type -->/
        <c:symbol name="some_parameter">
          <c:basictype name="int">

Projects/GObjectIntrospection/Metadata/C (last edited 2013-11-22 19:41:56 by WilliamJonMcCann)