Re: [Vala] Bindings for Function with xmlNodePtr argument



valac --version output:

Vala 0.13.4.5-0497

vapigen --version output:

Vala API Generator 0.13.4.5-0497

Here you have Gda-4.0.gir headers:

<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations.  -->
<repository version="1.2"
            xmlns="http://www.gtk.org/introspection/core/1.0";
            xmlns:c="http://www.gtk.org/introspection/c/1.0";
            xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
  <include name="GLib" version="2.0"/>
  <include name="GObject" version="2.0"/>
  <include name="libxml2" version="2.0"/>
  <namespace name="Gda"
             version="4.0"
             shared-library="libgda-4.0.so.4"
             c:identifier-prefixes="Gda"
             c:symbol-prefixes="gda">

And and example in GIR about the use of xmlNodePtr:

This a DataModel's method:

 <method name="add_data_from_xml_node"
              c:identifier="gda_data_model_add_data_from_xml_node"
              throws="1">
        <doc xml:whitespace="preserve">Adds the data from an XML node to the
given data model (see the DTD for that node
in the $prefix/share/libgda/dtd/libgda-array.dtd file).
Upon errors FALSE will be returned and @error will be assigned a
#GError from the #GDA_DATA_MODEL_ERROR domain.</doc>
        <return-value transfer-ownership="none">
          <doc xml:whitespace="preserve">%TRUE if successful, %FALSE
otherwise.</doc>
          <type name="gboolean" c:type="gboolean"/>
        </return-value>
        <parameters>
          <parameter name="node" transfer-ownership="none">
            <doc xml:whitespace="preserve">an XML node representing a
&amp;lt;gda_array_data&amp;gt; XML node.</doc>
            <type name="libxml2.NodePtr" c:type="xmlNodePtr"/>
          </parameter>
        </parameters>
      </method>

2011/9/9 Luca Bruno <lethalman88 gmail com>

09:03 Yo: Hi Bruno, Just to ask: Do you need all Gda-4.0.gir file in order
to check about xml problem?
 Luca: no the header of it and libxml... most probably you want --pkg
libxml-2.0
09:04 test --pkg libxml-2.0 first
  ensure you're using an up-to-date vapigen
09:05 Yo: I'm using master, valac --version returns Vala 0.13.4-dirty
09:06 I've used to add --pkg libxml-2.0, but found some problems in vapi
generation.
09:07 When I use just vapigen --library libgda-4.0 Gda-4.0.gir
  just works!
  I think vapigen gets required packages from libgda-4.0.pc file



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]