The GIR XML format

3 The GIR XML format

The GIR XML format

The GIR XML format

This chapter describes the GIR XML markup format. This describes exported C API, including documentation. It may contain installation-specific data, such as library filenames which may differ between platforms.

## api node

The root node of all GIR documents is the api node. Possible children: namespace.

### A GIR fragment showing an api node

        <api version="1.0">
          <namespace/>
        </api>

## namespace node

Parent node: api. Possible children: callback, class, function. interface.

### A GIR fragment showing an namespace node

        <api version="1.0">
          <namespace="Gtk">
             <class/>
             <function/>
          </namespace>
        </api>

## class node

Parent node: namespace. Possible children: constructor, field, method, property.

### A GIR fragment showing an class node

        <api version="1.0">
          <namespace="Gtk">
            <class name="Widget">
               <constructor/>
               <field/>
               <method/>
               <property/>
            <class>
          </namespace>
        </api>

## interface node

Parent node: namespace. Possible children: field, method, property.

### A GIR fragment showing an interface node

        <api version="1.0">
          <namespace="Gtk">
            <interface name="Buildable">
               <field/>
               <method/>
               <property/>
            <interface>
          </namespace>
        </api>

## function node

Parent node: namespace.

### A GIR fragment showing an function node

        <api version="1.0">
          <namespace="Gtk">
            <function name="init">
            </function>
          </namespace>
        </api>