gobject-introspection r325 - in trunk: . girepository giscanner tests tests/invoke tests/parser tools
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r325 - in trunk: . girepository giscanner tests tests/invoke tests/parser tools
- Date: Fri, 8 Aug 2008 19:09:17 +0000 (UTC)
Author: johan
Date: Fri Aug 8 19:09:17 2008
New Revision: 325
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=325&view=rev
Log:
2008-08-08 Johan Dahlin <johan gnome org>
* girepository/gtypelib.c (validate_header):
* girepository/gtypelib.h:
* giscanner/ast.py:
* giscanner/girwriter.py:
* giscanner/sourcescanner.c (gi_source_symbol_ref),
(gi_source_symbol_unref):
* tests/array.test:
* tests/boxed.test:
* tests/constant.test:
* tests/enum.test:
* tests/errors.test:
* tests/function.test:
* tests/gobject.test:
* tests/interface.test:
* tests/invoke/Makefile.am:
* tests/invoke/testfns.xml:
* tests/object.test:
* tests/parser/Makefile.am:
* tests/roundtrips.sh:
* tests/struct.test:
* tests/types.test:
* tests/union.test:
* tests/xref1.test:
* tests/xref2.test:
* tools/Makefile.am:
* tools/compiler.c (main):
* tools/generate.c (write_callable_info), (write_function_info),
(write_repository):
* tools/gidlmodule.c:
* tools/gidlmodule.h:
* tools/gidlnode.c:
* tools/gidlnode.h:
* tools/gidlparser.c:
* tools/gidlparser.h:
* tools/gidlwriter.c:
* tools/gidlwriter.h:
* tools/scanner.c (create_node_from_gtype),
(create_node_from_ctype), (g_igenerator_process_properties),
(g_igenerator_process_signals), (g_igenerator_create_object),
(g_igenerator_create_interface), (g_igenerator_create_boxed),
(g_igenerator_create_enum), (g_igenerator_create_flags),
(g_igenerator_process_function_symbol),
(g_igenerator_process_unregistered_struct_typedef),
(g_igenerator_process_struct_typedef),
(g_igenerator_process_union_typedef),
(g_igenerator_process_enum_typedef),
(g_igenerator_process_function_typedef),
(g_igenerator_process_constant), (g_igenerator_process_symbols),
(g_igenerator_add_module), (g_igenerator_add_include_idl):
Merge in the gir-compiler branch.
Thanks to Philip and Colin for their help.
Added:
trunk/tests/invoke/testfns.gir
- copied unchanged from r324, /branches/gir-compiler/tests/invoke/testfns.gir
trunk/tools/girmodule.c
- copied unchanged from r324, /branches/gir-compiler/tools/girmodule.c
trunk/tools/girmodule.h
- copied unchanged from r324, /branches/gir-compiler/tools/girmodule.h
trunk/tools/girnode.c
- copied unchanged from r324, /branches/gir-compiler/tools/girnode.c
trunk/tools/girnode.h
- copied unchanged from r324, /branches/gir-compiler/tools/girnode.h
trunk/tools/girparser.c
- copied unchanged from r324, /branches/gir-compiler/tools/girparser.c
trunk/tools/girparser.h
- copied unchanged from r324, /branches/gir-compiler/tools/girparser.h
trunk/tools/girwriter.c
- copied unchanged from r324, /branches/gir-compiler/tools/girwriter.c
trunk/tools/girwriter.h
- copied unchanged from r324, /branches/gir-compiler/tools/girwriter.h
Removed:
trunk/tests/invoke/testfns.xml
trunk/tools/gidlmodule.c
trunk/tools/gidlmodule.h
trunk/tools/gidlnode.c
trunk/tools/gidlnode.h
trunk/tools/gidlparser.c
trunk/tools/gidlparser.h
trunk/tools/gidlwriter.c
trunk/tools/gidlwriter.h
Modified:
trunk/ChangeLog
trunk/girepository/gtypelib.c
trunk/girepository/gtypelib.h
trunk/giscanner/ast.py
trunk/giscanner/girwriter.py
trunk/giscanner/sourcescanner.c
trunk/tests/array.test
trunk/tests/boxed.test
trunk/tests/constant.test
trunk/tests/enum.test
trunk/tests/errors.test
trunk/tests/function.test
trunk/tests/gobject.test
trunk/tests/interface.test
trunk/tests/invoke/Makefile.am
trunk/tests/object.test
trunk/tests/parser/Makefile.am
trunk/tests/roundtrips.sh
trunk/tests/struct.test
trunk/tests/types.test
trunk/tests/union.test
trunk/tests/xref1.test
trunk/tests/xref2.test
trunk/tools/Makefile.am
trunk/tools/compiler.c
trunk/tools/generate.c
trunk/tools/scanner.c
Modified: trunk/girepository/gtypelib.c
==============================================================================
--- trunk/girepository/gtypelib.c (original)
+++ trunk/girepository/gtypelib.c Fri Aug 8 19:09:17 2008
@@ -113,7 +113,7 @@
header = (Header *)metadata->data;
- if (strncmp (header->magic, G_IDL_MAGIC, 16) != 0)
+ if (strncmp (header->magic, G_IR_MAGIC, 16) != 0)
{
g_set_error (error,
G_TYPELIB_ERROR,
Modified: trunk/girepository/gtypelib.h
==============================================================================
--- trunk/girepository/gtypelib.h (original)
+++ trunk/girepository/gtypelib.h Fri Aug 8 19:09:17 2008
@@ -27,7 +27,7 @@
G_BEGIN_DECLS
-#define G_IDL_MAGIC "GOBJ\nMETADATA\r\n\032"
+#define G_IR_MAGIC "GOBJ\nMETADATA\r\n\032"
enum
{
@@ -126,7 +126,10 @@
TYPE_TAG_LIST = 22,
TYPE_TAG_SLIST = 23,
TYPE_TAG_HASH = 24,
- TYPE_TAG_ERROR = 25
+ TYPE_TAG_ERROR = 25,
+ TYPE_TAG_STRING = 26,
+ TYPE_TAG_SEQUENCE = 27,
+ TYPE_TAG_ANY = 28
} TypeTag;
typedef union
Modified: trunk/giscanner/ast.py
==============================================================================
--- trunk/giscanner/ast.py (original)
+++ trunk/giscanner/ast.py Fri Aug 8 19:09:17 2008
@@ -94,9 +94,10 @@
def type_name_from_ctype(ctype):
return type_names.get(ctype, ctype)
-
-
+
+
class Node(object):
+
def __init__(self, name=None):
self.name = name
Modified: trunk/giscanner/girwriter.py
==============================================================================
--- trunk/giscanner/girwriter.py (original)
+++ trunk/giscanner/girwriter.py Fri Aug 8 19:09:17 2008
@@ -115,13 +115,13 @@
with self.tagcontext('parameter', attrs):
self._write_type(parameter.type)
- def _write_type(self, type):
- attrs = [('name', type.name)]
+ def _write_type(self, ntype):
+ attrs = [('name', ntype.name)]
# FIXME: figure out if type references a basic type
# or a boxed/class/interface etc. and skip
# writing the ctype if the latter.
if type.ctype is not None:
- attrs.append(('c:type', type.ctype))
+ attrs.append(('c:type', ntype.ctype))
self.write_tag('type', attrs)
def _write_sequence(self, sequence):
Modified: trunk/giscanner/sourcescanner.c
==============================================================================
--- trunk/giscanner/sourcescanner.c (original)
+++ trunk/giscanner/sourcescanner.c Fri Aug 8 19:09:17 2008
@@ -44,11 +44,14 @@
gi_source_symbol_ref (GISourceSymbol * symbol)
{
symbol->ref_count++;
+ return symbol;
}
void
gi_source_symbol_unref (GISourceSymbol * symbol)
{
+ if (!symbol)
+ return;
symbol->ref_count--;
if (symbol->ref_count == 0)
{
Modified: trunk/tests/array.test
==============================================================================
--- trunk/tests/array.test (original)
+++ trunk/tests/array.test Fri Aug 8 19:09:17 2008
@@ -1,25 +1,50 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
- <function name="test1" symbol="test1">
- <return-type type="gboolean" />
+ <function name="test1" c:identifier="test1">
+ <return-value>
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
<parameters>
- <parameter name="p1" type="guint8[length=1,zero-terminated=1]" transfer="full" direction="in" />
- <parameter name="p2" type="gint" direction="in" />
+ <parameter name="p1">
+ <type name="sequence" c:type="guint8*" length="1" zero-terminated="1">
+ <type name="uint8" c:type="guint8"/>
+ </type>
+ </parameter>
+ <parameter name="p2">
+ <type name="int" c:type="gint"/>
+ </parameter>
</parameters>
</function>
- <function name="test2" symbol="test2">
- <return-type type="gboolean" />
+ <function name="test2" c:identifier="test2">
+ <return-value>
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
<parameters>
- <parameter name="p2" type="gint" direction="out" />
- <parameter name="p1" type="guint8[length=0]" transfer="full" direction="out" />
+ <parameter name="p2">
+ <type name="uint" c:type="gint" direction="out"/>
+ </parameter>
+ <parameter name="p1">
+ <type name="sequence" c:type="guint8*" length="0" directon="out">
+ <type name="uint8" c:type="guint8"/>
+ </type>
+ </parameter>
</parameters>
</function>
- <function name="test3" symbol="test3">
- <return-type type="gboolean" />
+ <function name="test3" c:identifier="test3">
+ <return-value>
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
<parameters>
- <parameter name="p1" type="guint8[zero-terminated=1]" transfer="full" direction="in" />
+ <parameter name="p1">
+ <type name="sequence" c:type="guint8*" length="1" zero-terminated="1">
+ <type name="uint8" c:type="guint8"/>
+ </type>
+ </parameter>
</parameters>
</function>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/boxed.test
==============================================================================
--- trunk/tests/boxed.test (original)
+++ trunk/tests/boxed.test Fri Aug 8 19:09:17 2008
@@ -1,35 +1,80 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
- <boxed name="boxed1" type-name="BoxedType1" get-type="boxed1_get_type" deprecated="1">
- <field name="field1" readable="1" writable="1" offset="0" type="guint32" />
- <field name="field2" readable="1" writable="1" offset="4" type="guint32" />
- <field name="field3" readable="1" writable="1" offset="8" type="guint32" />
- <method name="frob_boxed1" symbol="frob_boxed1">
- <return-type type="void" />
+ <glib:boxed glib:name="BoxedType1" glib:type-name="boxed1" glib:get-type="boxed1_get_type" deprecated="1">
+ <field name="field1" readable="1" writable="1" offset="0">
+ <type name="guint32" c:type="guint32"/>
+ </field>
+ <field name="field2" readable="1" writable="1" offset="4">
+ <type name="guint32" c:type="guint32"/>
+ </field>
+ <field name="field3" readable="1" writable="1" offset="8">
+ <type name="guint32" c:type="guint32"/>
+ </field>
+ <method name="frob_boxed1" c:identifier="frob_boxed1">
+ <return-value>
+ <!-- FIXME: name=void should be none -->
+ <type name="void" c:type="void" />
+ </return-value>
<parameters>
- <parameter name="box" type="boxed1*" transfer="full" direction="in" />
- <parameter name="w" type="GList<boxed2*>*" transfer="full" direction="in" />
- <parameter name="t" type="GHashTable<utf8,gint64>*" transfer="full" direction="in" />
- <parameter name="e" type="GError*" transfer="full" direction="out" />
+ <parameter name="box" transfer="full" direction="in">
+ <type name="BoxedType1" c:type="boxed1*"/>
+ </parameter>
+ <parameter name="w" transfer="full" direction="in">
+ <!-- FIXME: put this in a sub node -->
+ <!--
+ <type name="sequence" c:type="GList*">
+ <type name="boxed2" c:type="boxed2*"/>
+ </type>
+ -->
+ <type name="GList<boxed2*>*" c:type="GList*"/>
+ </parameter>
+ <parameter name="t" transfer="full" direction="in">
+ <!-- FIXME: put this in a sub node -->
+ <!--
+ <type name="mapping" c:type="GHashTable*">
+ <type name="utf8" c:type="gchar*"/>
+ <type name="int64" c:type="gint64"/>
+ </type>
+ -->
+ <type name="GHashTable<utf8,gint64>*" c:type="GHashTable*"/>
+ </parameter>
+ <parameter name="e" transfer="full" direction="out">
+ <type name="GError" c:type="GError**"/>
+ </parameter>
</parameters>
</method>
- <method name="lart" symbol="lart">
- <return-type type="gboolean" />
+ <method name="lart" c:identifier="lart">
+ <return-value>
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
<parameters>
- <parameter name="box" type="boxed2*" transfer="full" direction="in" />
- <parameter name="val" type="gint*" transfer="full" direction="inout" />
+ <parameter name="box" transfer="full" direction="in">
+ <type name="boxed2*" c:type="boxed2*"/>
+ </parameter>
+ <parameter name="val" transfer="full" direction="inout">
+ <type name="uint" c:type="guint*"/>
+ </parameter>
</parameters>
</method>
- </boxed>
- <function name="freefunc" symbol="freefunc" deprecated="1">
- <return-type type="gint" />
+ </glib:boxed>
+ <function name="freefunc" c:identifier="freefunc" deprecated="1">
+ <return-value>
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
<parameters>
- <parameter name="v1" type="gint" direction="in" />
- <parameter name="val2" type="gint" direction="in" />
+ <parameter name="v1" direction="in">
+ <type name="int" c:type="gint"/>
+ </parameter>
+ <parameter name="val2" direction="in">
+ <type name="int" c:type="gint"/>
+ </parameter>
</parameters>
</function>
- <boxed name="boxed2" type-name="BoxedType2" get-type="boxed2_get_type" deprecated="1">
- </boxed>
+ <glib:boxed glib:name="boxed2" glib:type-name="BoxedType2" glib:get-type="boxed2_get_type" deprecated="1">
+ </glib:boxed>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/constant.test
==============================================================================
--- trunk/tests/constant.test (original)
+++ trunk/tests/constant.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<constant name="constant1" type="gint" value="42" />
<constant name="constant2" type="guint" value="42" />
@@ -7,4 +10,4 @@
<constant name="constant4" type="gint32" value="42" />
<constant name="constant5" type="gfloat" value="42.000000" />
</namespace>
-</api>
+</repository>
Modified: trunk/tests/enum.test
==============================================================================
--- trunk/tests/enum.test (original)
+++ trunk/tests/enum.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<enum name="Enum1" type-name="FooEnum" get-type="foo_enum_get_type">
<member name="value1" value="0" />
@@ -17,4 +20,4 @@
<member name="value3" value="2" />
</enum>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/errors.test
==============================================================================
--- trunk/tests/errors.test (original)
+++ trunk/tests/errors.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<enum name="ErrorCodes1" type-name="ErrorCodes1" get-type="foo_error_codes1_get_type">
<member name="e1" value="0" />
@@ -19,4 +22,4 @@
</parameters>
</function>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/function.test
==============================================================================
--- trunk/tests/function.test (original)
+++ trunk/tests/function.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<boxed name="Boxed1" type-name="Boxed1" get-type="boxed1_get_type">
</boxed>
@@ -18,4 +21,4 @@
</parameters>
</callback>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/gobject.test
==============================================================================
--- trunk/tests/gobject.test (original)
+++ trunk/tests/gobject.test Fri Aug 8 19:09:17 2008
@@ -1,7 +1,10 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="GObject">
<object name="GObject" type-name="GObject" get-type="g_object_get_type">
</object>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/interface.test
==============================================================================
--- trunk/tests/interface.test (original)
+++ trunk/tests/interface.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<interface name="Iface1" type-name="Iface1" get-type="iface1_get_type">
<requires>
@@ -35,4 +38,4 @@
<interface name="Iface2" type-name="Iface2" get-type="iface2_get_type">
</interface>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/invoke/Makefile.am
==============================================================================
--- trunk/tests/invoke/Makefile.am (original)
+++ trunk/tests/invoke/Makefile.am Fri Aug 8 19:09:17 2008
@@ -16,11 +16,11 @@
BUILT_SOURCES = testfns-metadata.c test.repo
CLEANFILES = testfns-metadata.c test.repo
-testfns-metadata.c: testfns.xml $(top_builddir)/tools/g-idl-compiler
- $(top_builddir)/tools/g-idl-compiler $(srcdir)/testfns.xml -o testfns-metadata.c
+testfns-metadata.c: testfns.gir $(top_builddir)/tools/g-ir-compiler
+ $(CHECK_DEBUG) $(top_builddir)/tools/g-ir-compiler $(srcdir)/testfns.gir -o testfns-metadata.c
-test.repo: testfns.xml
- $(top_builddir)/tools/g-idl-compiler --shared-library testfns.la $< --raw -o $@
+test.repo: testfns.gir
+ $(CHECK_DEBUG) $(top_builddir)/tools/g-ir-compiler --shared-library testfns.la $< --raw -o $@
invoke_SOURCES = invoke.c
invoke_CFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
@@ -28,6 +28,6 @@
TESTS = invoke invoke-namespace-find.sh
-EXTRA_DIST = invoke-namespace-find.sh testfns.xml
+EXTRA_DIST = invoke-namespace-find.sh testfns.gir
TESTS_ENVIRONMENT = GIREPOPATH="."
Modified: trunk/tests/object.test
==============================================================================
--- trunk/tests/object.test (original)
+++ trunk/tests/object.test Fri Aug 8 19:09:17 2008
@@ -1,40 +1,61 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
- <object name="Object1" parent="Object2" type-name="Object1" get-type="object1_get_type">
+ <class name="Object1" parent="Object2" glib:type-name="Object1" glib:get-type="object1_get_type">
<implements>
<interface name="Iface1" />
</implements>
- <property name="prop1" readable="0" writable="0" type="gint" />
- <signal name="signal1" when="LAST">
- <return-type type="gboolean" />
+ <property name="prop1" readable="0" writable="0">
+ <type name="int" c:type="gint"/>
+ </property>
+ <glib:signal name="signal1" when="LAST">
+ <return-value>
+ <type name="boolean" c:type="gboolean"/>
+ </return-value>
<parameters>
- <parameter name="obj" type="Object1*" transfer="full" direction="in" />
+ <parameter name="obj" transfer="full" direction="in">
+ <type name="Object1" c:type="Object1*"/>
+ </parameter>
</parameters>
- </signal>
- <signal name="signal2" when="FIRST" no-recurse="1" detailed="1" action="1" no-hooks="1">
- <return-type type="void" />
+ </glib:signal>
+ <glib:signal name="signal2" when="FIRST" no-recurse="1" detailed="1" action="1" no-hooks="1">
+ <return-value>
+ <type name="void" c:type="void"/>
+ </return-value>
<parameters>
- <parameter name="obj" type="Object1*" transfer="full" direction="in" />
+ <parameter name="obj" transfer="full" direction="in">
+ <type name="Object1" c:type="Object1*"/>
+ </parameter>
</parameters>
- </signal>
+ </glib:signal>
<vfunc name="vfunc1" offset="20">
- <return-type type="Object2*" transfer="full" />
+ <return-value>
+ <type name="Object2" c:type="Object2*"/>
+ </return-value>
<parameters>
- <parameter name="param1" type="Object1*" transfer="full" direction="in" />
+ <parameter name="param1" transfer="full" direction="in">
+ <type name="Object1" c:type="Object1*"/>
+ </parameter>
</parameters>
</vfunc>
<vfunc name="vfunc2" offset="24">
- <return-type type="Object2*" transfer="full" />
+ <return-value>
+ <type name="Object2" c:type="Object2*"/>
+ </return-value>
<parameters>
- <parameter name="param1" type="Object1*" transfer="full" direction="in" />
+ <parameter name="param1" transfer="full" direction="in">
+ <type name="Object1" c:type="Object1*"/>
+ </parameter>
</parameters>
</vfunc>
- <constant name="constant1" type="gint" value="42" />
- </object>
- <interface name="Iface1" type-name="Iface1" get-type="iface1_get_type">
+ </class>
+ <constant name="constant1" c:type="gint" value="42" />
+ <interface name="Iface1" glib:type-name="Iface1" glib:get-type="iface1_get_type">
</interface>
- <object name="Object2" parent="GObject.GObject" type-name="Object2" get-type="object2_get_type">
- </object>
+ <class name="Object2" parent="GObject.GObject" glib:type-name="Object2" glib:get-type="object2_get_type">
+ </class>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/parser/Makefile.am
==============================================================================
--- trunk/tests/parser/Makefile.am (original)
+++ trunk/tests/parser/Makefile.am Fri Aug 8 19:09:17 2008
@@ -20,7 +20,7 @@
SCANNER = $(top_srcdir)/tools/g-ir-scanner
utility.gir: libutility.la utility.h $(SCANNER)
- @$(SCANNER) -v \
+ @$(CHECK_DEBUG) $(SCANNER) -v \
--include=$(top_srcdir)/gir/gobject-2.0.gir \
--library=libutility.la \
--namespace=utility \
@@ -29,7 +29,7 @@
--output $@
Foo.gir: libfoo.la foo-object.h $(SCANNER)
- @$(SCANNER) -v \
+ @$(CHECK_DEBUG) $(SCANNER) -v \
--include=$(top_srcdir)/gir/gobject-2.0.gir \
--include=$(top_builddir)/tests/parser/utility.gir \
--library=libfoo.la \
Modified: trunk/tests/roundtrips.sh
==============================================================================
--- trunk/tests/roundtrips.sh (original)
+++ trunk/tests/roundtrips.sh Fri Aug 8 19:09:17 2008
@@ -1,26 +1,28 @@
#! /bin/sh
-SIMPLE_TESTS="array.test boxed.test enum.test errors.test function.test interface.test struct.test union.test"
+set -x
+set -e
-for i in $SIMPLE_TESTS; do
- echo $i
- ../tools/g-idl-compiler --raw $srcdir/$i > $i.1;
- ../tools/g-idl-generate --raw $i.1 > $i.2;
+TESTFILES=$(echo "${srcdir}"/../../gir-repository/gir/*.gir)
+
+for i in $TESTFILES; do
+ ${CHECK_DEBUG} ../tools/g-ir-compiler --raw $i > $i.1;
+ ${CHECK_DEBUG} ../tools/g-ir-generate --raw $i.1 > $i.2;
diff -u $srcdir/$i $i.2 || exit 1;
rm $i.1 $i.2
done
-../tools/g-idl-compiler --raw --module=Foo $srcdir/object.test $srcdir/gobject.test > object.test.1
-../tools/g-idl-generate --raw object.test.1 > object.test.2
-diff -u $srcdir/object.test object.test.2 || exit 1
-rm object.test.1 object.test.2
-
-../tools/g-idl-compiler --raw --module=Foo $srcdir/xref1.test $srcdir/xref2.test > xref1.test.1
-../tools/g-idl-generate --raw xref1.test.1 > xref1.test.2
-diff -u $srcdir/xref1.test xref1.test.2 || exit 1
-rm xref1.test.1 xref1.test.2
-
-../tools/g-idl-compiler --raw --module=Bar $srcdir/xref1.test $srcdir/xref2.test > xref2.test.1
-../tools/g-idl-generate --raw xref2.test.1 > xref2.test.2
-diff -u $srcdir/xref2.test xref2.test.2 || exit 1
-rm xref2.test.1 xref2.test.2
+#../tools/g-ir-compiler --raw --module=Foo $srcdir/object.test $srcdir/gobject.test > object.test.1
+#../tools/g-ir-generate --raw object.test.1 > object.test.2
+#diff -u $srcdir/object.test object.test.2 || exit 1
+#rm object.test.1 object.test.2
+
+#../tools/g-ir-compiler --raw --module=Foo $srcdir/xref1.test $srcdir/xref2.test > xref1.test.1
+#../tools/g-ir-generate --raw xref1.test.1 > xref1.test.2
+#diff -u $srcdir/xref1.test xref1.test.2 || exit 1
+#rm xref1.test.1 xref1.test.2
+
+#../tools/g-ir-compiler --raw --module=Bar $srcdir/xref1.test $srcdir/xref2.test > xref2.test.1
+#../tools/g-ir-generate --raw xref2.test.1 > xref2.test.2
+#diff -u $srcdir/xref2.test xref2.test.2 || exit 1
+#rm xref2.test.1 xref2.test.2
Modified: trunk/tests/struct.test
==============================================================================
--- trunk/tests/struct.test (original)
+++ trunk/tests/struct.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<struct name="FooStruct">
<field name="foo_int" readable="1" writable="1" offset="0" type="gint" />
@@ -13,4 +16,4 @@
<field name="string" readable="1" writable="1" offset="24" type="utf8" />
</struct>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/types.test
==============================================================================
--- trunk/tests/types.test (original)
+++ trunk/tests/types.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<function name="lart" symbol="lart">
<return-type type="gboolean" />
@@ -11,4 +14,4 @@
</parameters>
</function>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/union.test
==============================================================================
--- trunk/tests/union.test (original)
+++ trunk/tests/union.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<union name="union1" type-name="UnionType1" get-type="union1_get_type">
<discriminator offset="-4" type="gint" />
@@ -11,4 +14,4 @@
<field name="field1" readable="1" writable="1" offset="0" type="gdouble" />
</union>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/xref1.test
==============================================================================
--- trunk/tests/xref1.test (original)
+++ trunk/tests/xref1.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Foo">
<boxed name="Boxed" type-name="FooBoxed" get-type="foo_boxed_get_type">
</boxed>
@@ -10,4 +13,4 @@
</parameters>
</function>
</namespace>
-</api>
+</repository>
Modified: trunk/tests/xref2.test
==============================================================================
--- trunk/tests/xref2.test (original)
+++ trunk/tests/xref2.test Fri Aug 8 19:09:17 2008
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
-<api version="1.0">
+<repository version="1.0"
+ 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">
<namespace name="Bar">
<boxed name="Boxed" type-name="BarBoxed" get-type="bar_boxed_get_type">
</boxed>
@@ -10,4 +13,4 @@
</parameters>
</function>
</namespace>
-</api>
+</repository>
Modified: trunk/tools/Makefile.am
==============================================================================
--- trunk/tools/Makefile.am (original)
+++ trunk/tools/Makefile.am Fri Aug 8 19:09:17 2008
@@ -8,29 +8,29 @@
EXTRA_DIST = g-ir-scanner
noinst_LTLIBRARIES = libgirepository-parser.la
-bin_PROGRAMS = g-idl-compiler g-idl-generate
+bin_PROGRAMS = g-ir-compiler g-ir-generate
bin_SCRIPTS = g-ir-scanner
libgirepository_parser_la_SOURCES = \
- gidlmodule.c \
- gidlmodule.h \
- gidlnode.c \
- gidlnode.h \
- gidlparser.c \
- gidlparser.h
+ girmodule.c \
+ girmodule.h \
+ girnode.c \
+ girnode.h \
+ girparser.c \
+ girparser.h
libgirepository_parser_la_CFLAGS = $(GIREPO_CFLAGS)
-g_idl_compiler_SOURCES = compiler.c
-g_idl_compiler_CFLAGS = $(GIREPO_CFLAGS)
-g_idl_compiler_LDADD = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository.la libgirepository-parser.la
-
-g_idl_generate_SOURCES = generate.c
-g_idl_generate_CFLAGS = $(GIREPO_CFLAGS)
-g_idl_generate_LDADD = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository.la
+g_ir_compiler_SOURCES = compiler.c
+g_ir_compiler_CFLAGS = $(GIREPO_CFLAGS)
+g_ir_compiler_LDADD = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository.la libgirepository-parser.la
+
+g_ir_generate_SOURCES = generate.c
+g_ir_generate_CFLAGS = $(GIREPO_CFLAGS)
+g_ir_generate_LDADD = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository.la
GCOVSOURCES = \
$(libgirepository_la_SOURCES) \
- $(g_idl_compiler_SOURCES) \
- $(g_idl_generate_SOURCES)
+ $(g_ir_compiler_SOURCES) \
+ $(g_ir_generate_SOURCES)
include $(top_srcdir)/gcov.mak
Modified: trunk/tools/compiler.c
==============================================================================
--- trunk/tools/compiler.c (original)
+++ trunk/tools/compiler.c Fri Aug 8 19:09:17 2008
@@ -24,9 +24,9 @@
#include <glib.h>
#include <glib/gstdio.h>
-#include "gidlmodule.h"
-#include "gidlnode.h"
-#include "gidlparser.h"
+#include "girmodule.h"
+#include "girnode.h"
+#include "girparser.h"
#include "gtypelib.h"
gboolean raw = FALSE;
@@ -179,6 +179,7 @@
logged_levels = logged_levels | G_LOG_LEVEL_DEBUG;
if (verbose)
logged_levels = logged_levels | G_LOG_LEVEL_MESSAGE;
+ g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL);
g_log_set_default_handler (log_handler, NULL);
@@ -189,11 +190,13 @@
return 1;
}
+ g_debug ("[parsing] start");
+
modules = NULL;
for (i = 0; input[i]; i++)
{
GList *mods;
- mods = g_idl_parse_file (input[i], &error);
+ mods = g_ir_parse_file (input[i], &error);
if (mods == NULL)
{
@@ -206,9 +209,13 @@
modules = g_list_concat (modules, mods);
}
+ g_debug ("[parsing] done");
+
+ g_debug ("[building] start");
+
for (m = modules; m; m = m->next)
{
- GIdlModule *module = m->data;
+ GIrModule *module = m->data;
gchar *prefix;
GTypelib *metadata;
@@ -220,7 +227,10 @@
g_free (module->shared_library);
module->shared_library = g_strdup (shlib);
}
- metadata = g_idl_module_build_metadata (module, modules);
+
+ g_debug ("[building] module %s", module->name);
+
+ metadata = g_ir_module_build_metadata (module, modules);
if (metadata == NULL)
{
g_error ("Failed to build metadata for module '%s'\n", module->name);
@@ -248,6 +258,8 @@
break;
}
}
-
+
+ g_debug ("[building] done");
+
return 0;
}
Modified: trunk/tools/generate.c
==============================================================================
--- trunk/tools/generate.c (original)
+++ trunk/tools/generate.c Fri Aug 8 19:09:17 2008
@@ -237,7 +237,7 @@
GITypeInfo *type;
gint i;
- g_fprintf (file, "%*s <return-type type=\"", indent, "");
+ g_fprintf (file, "%*s <return-type c:type=\"", indent, "");
type = g_callable_info_get_return_type (info);
write_type_info (namespace, type, file);
@@ -274,7 +274,7 @@
{
GIArgInfo *arg = g_callable_info_get_arg (info, i);
- g_fprintf (file, "%*s <parameter name=\"%s\" type=\"",
+ g_fprintf (file, "%*s <parameter name=\"%s\" c:type=\"",
indent, "", g_base_info_get_name ((GIBaseInfo *) arg));
type = g_arg_info_get_type (arg);
@@ -360,7 +360,7 @@
else
tag = "function";
- g_fprintf (file, "%*s<%s name=\"%s\" symbol=\"%s\"",
+ g_fprintf (file, "%*s<%s name=\"%s\" c:identifier=\"%s\"",
indent, "", tag, name, symbol);
if (flags & GI_FUNCTION_IS_SETTER)
@@ -1019,7 +1019,10 @@
}
g_fprintf (file, "<?xml version=\"1.0\"?>\n");
- g_fprintf (file, "<api version=\"1.0\">\n");
+ g_fprintf (file, "<repository version=\"1.0\"\n"
+ " xmlns=\"http://www.gtk.org/introspection/core/1.0\"\n"
+ " xmlns:c=\"http://www.gtk.org/introspection/c/1.0\"\n"
+ " xmlns:glib=\"http://www.gtk.org/introspection/glib/1.0\">\n");
for (i = 0; namespaces[i]; i++)
{
@@ -1085,7 +1088,7 @@
g_fprintf (file, " </namespace>\n");
}
- g_fprintf (file, "</api>\n");
+ g_fprintf (file, "</repository>\n");
if (output != NULL)
fclose (file);
Modified: trunk/tools/scanner.c
==============================================================================
--- trunk/tools/scanner.c (original)
+++ trunk/tools/scanner.c Fri Aug 8 19:09:17 2008
@@ -32,13 +32,12 @@
#include <gmodule.h>
#include "sourcescanner.h"
#include "scanner.h"
-#include "gidlparser.h"
-#include "gidlmodule.h"
-#include "gidlnode.h"
-#include "gidlwriter.h"
+#include "girparser.h"
+#include "girmodule.h"
+#include "girnode.h"
+#include "girwriter.h"
#include "grealpath.h"
-
typedef GType (*TypeFunction) (void);
static void g_igenerator_parse_macros (GIGenerator * igenerator);
@@ -82,13 +81,13 @@
g_free (generator);
}
-static GIdlNodeType *
+static GIrNodeType *
create_node_from_gtype (GType type_id)
{
- GIdlNodeType *node;
+ GIrNodeType *node;
GType fundamental;
- node = (GIdlNodeType *) g_idl_node_new (G_IDL_NODE_TYPE);
+ node = (GIrNodeType *) g_idl_node_new (G_IR_NODE_TYPE);
fundamental = g_type_fundamental (type_id);
switch (fundamental)
@@ -115,12 +114,12 @@
return node;
}
-static GIdlNodeType *
+static GIrNodeType *
create_node_from_ctype (GISourceType * ctype)
{
- GIdlNodeType *node;
+ GIrNodeType *node;
- node = (GIdlNodeType *) g_idl_node_new (G_IDL_NODE_TYPE);
+ node = (GIrNodeType *) g_idl_node_new (G_IR_NODE_TYPE);
switch (ctype->type)
{
@@ -160,13 +159,13 @@
node->unparsed = g_strdup ("GCallback");
else
{
- GIdlNodeType *gibasetype = create_node_from_ctype (ctype->base_type);
+ GIrNodeType *gibasetype = create_node_from_ctype (ctype->base_type);
node->unparsed = g_strdup_printf ("%s*", gibasetype->unparsed);
}
break;
case CTYPE_ARRAY:
{
- GIdlNodeType *gibasetype = create_node_from_ctype (ctype->base_type);
+ GIrNodeType *gibasetype = create_node_from_ctype (ctype->base_type);
node->unparsed = g_strdup_printf ("%s[]", gibasetype->unparsed);
break;
}
@@ -189,18 +188,18 @@
static void
g_igenerator_process_properties (GIGenerator * igenerator,
- GIdlNodeInterface * node, GType type_id)
+ GIrNodeInterface * node, GType type_id)
{
int i;
guint n_properties;
GParamSpec **properties;
- if (node->node.type == G_IDL_NODE_OBJECT)
+ if (node->node.type == G_IR_NODE_OBJECT)
{
GObjectClass *type_class = g_type_class_ref (type_id);
properties = g_object_class_list_properties (type_class, &n_properties);
}
- else if (node->node.type == G_IDL_NODE_INTERFACE)
+ else if (node->node.type == G_IR_NODE_INTERFACE)
{
GTypeInterface *iface = g_type_default_interface_ref (type_id);
properties = g_object_interface_list_properties (iface, &n_properties);
@@ -212,14 +211,14 @@
for (i = 0; i < n_properties; i++)
{
- GIdlNodeProperty *giprop;
+ GIrNodeProperty *giprop;
/* ignore inherited properties */
if (properties[i]->owner_type != type_id)
{
continue;
}
- giprop = (GIdlNodeProperty *) g_idl_node_new (G_IDL_NODE_PROPERTY);
+ giprop = (GIrNodeProperty *) g_idl_node_new (G_IR_NODE_PROPERTY);
giprop->node.name = g_strdup (properties[i]->name);
node->members =
g_list_insert_sorted (node->members, giprop,
@@ -235,7 +234,7 @@
static void
g_igenerator_process_signals (GIGenerator * igenerator,
- GIdlNodeInterface * node, GType type_id)
+ GIrNodeInterface * node, GType type_id)
{
int i, j;
guint n_signal_ids;
@@ -244,11 +243,11 @@
for (i = 0; i < n_signal_ids; i++)
{
GSignalQuery signal_query;
- GIdlNodeSignal *gisig;
- GIdlNodeParam *giparam;
+ GIrNodeSignal *gisig;
+ GIrNodeParam *giparam;
g_signal_query (signal_ids[i], &signal_query);
- gisig = (GIdlNodeSignal *) g_idl_node_new (G_IDL_NODE_SIGNAL);
+ gisig = (GIrNodeSignal *) g_idl_node_new (G_IR_NODE_SIGNAL);
gisig->node.name = g_strdup (signal_query.signal_name);
node->members =
g_list_insert_sorted (node->members, gisig,
@@ -261,19 +260,19 @@
(signal_query.signal_flags & G_SIGNAL_RUN_CLEANUP) != 0;
/* add sender parameter */
- giparam = (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ giparam = (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
gisig->parameters = g_list_append (gisig->parameters, giparam);
giparam->node.name = g_strdup ("object");
giparam->type = create_node_from_gtype (type_id);
for (j = 0; j < signal_query.n_params; j++)
{
- giparam = (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ giparam = (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
gisig->parameters = g_list_append (gisig->parameters, giparam);
giparam->node.name = g_strdup_printf ("p%d", j);
giparam->type = create_node_from_gtype (signal_query.param_types[j]);
}
- gisig->result = (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ gisig->result = (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
gisig->result->type = create_node_from_gtype (signal_query.return_type);
}
}
@@ -301,12 +300,12 @@
{
char *alt_lower_case_prefix;
- GIdlNodeInterface *node;
+ GIrNodeInterface *node;
guint n_type_interfaces;
GType *type_interfaces;
int i;
- node = (GIdlNodeInterface *) g_idl_node_new (G_IDL_NODE_OBJECT);
+ node = (GIrNodeInterface *) g_idl_node_new (G_IR_NODE_OBJECT);
node->node.name = g_strdup (g_type_name (type_id));
igenerator->module->entries =
g_list_insert_sorted (igenerator->module->entries, node,
@@ -366,13 +365,13 @@
char *lower_case_prefix)
{
- GIdlNodeInterface *node;
+ GIrNodeInterface *node;
gboolean is_gobject = FALSE;
guint n_iface_prereqs;
GType *iface_prereqs;
int i;
- node = (GIdlNodeInterface *) g_idl_node_new (G_IDL_NODE_INTERFACE);
+ node = (GIrNodeInterface *) g_idl_node_new (G_IR_NODE_INTERFACE);
node->node.name = g_strdup (g_type_name (type_id));
/* workaround for AtkImplementorIface */
@@ -419,8 +418,8 @@
GType type_id,
char *lower_case_prefix)
{
- GIdlNodeBoxed *node =
- (GIdlNodeBoxed *) g_idl_node_new (G_IDL_NODE_BOXED);
+ GIrNodeBoxed *node =
+ (GIrNodeBoxed *) g_idl_node_new (G_IR_NODE_BOXED);
node->node.name = g_strdup (g_type_name (type_id));
igenerator->module->entries =
g_list_insert_sorted (igenerator->module->entries, node,
@@ -439,11 +438,11 @@
GType type_id,
char *lower_case_prefix)
{
- GIdlNodeEnum *node;
+ GIrNodeEnum *node;
int i;
GEnumClass *type_class;
- node = (GIdlNodeEnum *) g_idl_node_new (G_IDL_NODE_ENUM);
+ node = (GIrNodeEnum *) g_idl_node_new (G_IR_NODE_ENUM);
node->node.name = g_strdup (g_type_name (type_id));
igenerator->module->entries =
g_list_insert_sorted (igenerator->module->entries, node,
@@ -459,8 +458,8 @@
for (i = 0; i < type_class->n_values; i++)
{
- GIdlNodeValue *gival =
- (GIdlNodeValue *) g_idl_node_new (G_IDL_NODE_VALUE);
+ GIrNodeValue *gival =
+ (GIrNodeValue *) g_idl_node_new (G_IR_NODE_VALUE);
node->values = g_list_append (node->values, gival);
gival->node.name =
g_strdup (type_class->values[i].value_name);
@@ -474,11 +473,11 @@
GType type_id,
char *lower_case_prefix)
{
- GIdlNodeEnum *node;
+ GIrNodeEnum *node;
GFlagsClass *type_class;
int i;
- node = (GIdlNodeEnum *) g_idl_node_new (G_IDL_NODE_FLAGS);
+ node = (GIrNodeEnum *) g_idl_node_new (G_IR_NODE_FLAGS);
node->node.name = g_strdup (g_type_name (type_id));
igenerator->module->entries =
g_list_insert_sorted (igenerator->module->entries, node,
@@ -494,8 +493,8 @@
for (i = 0; i < type_class->n_values; i++)
{
- GIdlNodeValue *gival =
- (GIdlNodeValue *) g_idl_node_new (G_IDL_NODE_VALUE);
+ GIrNodeValue *gival =
+ (GIrNodeValue *) g_idl_node_new (G_IR_NODE_VALUE);
node->values = g_list_append (node->values, gival);
gival->node.name =
g_strdup (type_class->values[i].value_name);
@@ -595,14 +594,14 @@
static void
g_igenerator_process_function_symbol (GIGenerator * igenerator, GISourceSymbol * sym)
{
- GIdlNodeFunction *func;
+ GIrNodeFunction *func;
char *last_underscore;
GList *param_l;
int i;
GList *l;
GSList *j, *directives;
- func = (GIdlNodeFunction *) g_idl_node_new (G_IDL_NODE_FUNCTION);
+ func = (GIrNodeFunction *) g_idl_node_new (G_IR_NODE_FUNCTION);
/* check whether this is a type method */
last_underscore = strrchr (sym->ident, '_');
@@ -610,7 +609,7 @@
while (last_underscore != NULL)
{
char *prefix;
- GIdlNode *node;
+ GIrNode *node;
prefix = g_strndup (sym->ident, last_underscore - sym->ident);
prefix = str_replace (prefix, "_", "");
@@ -625,8 +624,8 @@
if (strcmp (func->node.name, "get_type") == 0)
return;
- if ((node->type == G_IDL_NODE_OBJECT ||
- node->type == G_IDL_NODE_BOXED) &&
+ if ((node->type == G_IR_NODE_OBJECT ||
+ node->type == G_IR_NODE_BOXED) &&
g_str_has_prefix (func->node.name, "new"))
func->is_constructor = TRUE;
else
@@ -669,7 +668,7 @@
}
func->symbol = g_strdup (sym->ident);
- func->result = (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ func->result = (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
func->result->type = create_node_from_ctype (sym->base_type->base_type);
directives = g_hash_table_lookup (igenerator->scanner->directives_map, func->symbol);
@@ -693,9 +692,9 @@
param_l = param_l->next, i++)
{
GISourceSymbol *param_sym = param_l->data;
- GIdlNodeParam *param;
+ GIrNodeParam *param;
- param = (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ param = (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
param->type = create_node_from_ctype (param_sym->base_type);
for (j = directives; j; j = j->next)
@@ -750,8 +749,8 @@
GISourceSymbol * sym,
GISourceType * struct_type)
{
- GIdlNodeStruct *node =
- (GIdlNodeStruct *) g_idl_node_new (G_IDL_NODE_STRUCT);
+ GIrNodeStruct *node =
+ (GIrNodeStruct *) g_idl_node_new (G_IR_NODE_STRUCT);
GList *member_l;
char *lower_case_prefix;
@@ -768,8 +767,8 @@
member_l = member_l->next)
{
GISourceSymbol *member = member_l->data;
- GIdlNodeField *gifield =
- (GIdlNodeField *) g_idl_node_new (G_IDL_NODE_FIELD);
+ GIrNodeField *gifield =
+ (GIrNodeField *) g_idl_node_new (G_IR_NODE_FIELD);
node->members = g_list_append (node->members, gifield);
gifield->node.name = g_strdup (member->ident);
@@ -782,7 +781,7 @@
{
GISourceType *struct_type = sym->base_type;
gboolean opaque_type = FALSE;
- GIdlNode *type;
+ GIrNode *type;
if (struct_type->child_list == NULL)
{
@@ -807,10 +806,10 @@
{
/* struct of a GTypeInstance */
if (!opaque_type
- && (type->type == G_IDL_NODE_OBJECT
- || type->type == G_IDL_NODE_INTERFACE))
+ && (type->type == G_IR_NODE_OBJECT
+ || type->type == G_IR_NODE_INTERFACE))
{
- GIdlNodeInterface *node = (GIdlNodeInterface *) type;
+ GIrNodeInterface *node = (GIrNodeInterface *) type;
GList *member_l;
/* ignore first field => parent */
for (member_l = struct_type->child_list->next; member_l != NULL;
@@ -823,23 +822,23 @@
{
continue;
}
- GIdlNodeField *gifield =
- (GIdlNodeField *) g_idl_node_new (G_IDL_NODE_FIELD);
+ GIrNodeField *gifield =
+ (GIrNodeField *) g_idl_node_new (G_IR_NODE_FIELD);
node->members = g_list_append (node->members, gifield);
gifield->node.name = g_strdup (member->ident);
gifield->type = create_node_from_ctype (member->base_type);
}
}
- else if (type->type == G_IDL_NODE_BOXED)
+ else if (type->type == G_IR_NODE_BOXED)
{
- GIdlNodeBoxed *node = (GIdlNodeBoxed *) type;
+ GIrNodeBoxed *node = (GIrNodeBoxed *) type;
GList *member_l;
for (member_l = struct_type->child_list; member_l != NULL;
member_l = member_l->next)
{
GISourceSymbol *member = member_l->data;
- GIdlNodeField *gifield =
- (GIdlNodeField *) g_idl_node_new (G_IDL_NODE_FIELD);
+ GIrNodeField *gifield =
+ (GIrNodeField *) g_idl_node_new (G_IR_NODE_FIELD);
node->members = g_list_append (node->members, gifield);
gifield->node.name = g_strdup (member->ident);
gifield->type = create_node_from_ctype (member->base_type);
@@ -853,7 +852,7 @@
{
char *base_name;
GList *member_l;
- GIdlNodeInterface *node;
+ GIrNodeInterface *node;
if (g_str_has_suffix (sym->ident, "Interface"))
{
@@ -868,14 +867,14 @@
}
type = g_hash_table_lookup (igenerator->type_map, base_name);
if (type == NULL
- || (type->type != G_IDL_NODE_OBJECT
- && type->type != G_IDL_NODE_INTERFACE))
+ || (type->type != G_IR_NODE_OBJECT
+ && type->type != G_IR_NODE_INTERFACE))
{
g_igenerator_process_unregistered_struct_typedef (igenerator, sym,
struct_type);
return;
}
- node = (GIdlNodeInterface *) type;
+ node = (GIrNodeInterface *) type;
/* ignore first field => parent */
for (member_l = struct_type->child_list->next; member_l != NULL;
@@ -895,20 +894,20 @@
GList *type_member_l;
GList *param_l;
int i;
- GIdlNodeVFunc *givfunc;
+ GIrNodeVFunc *givfunc;
for (type_member_l = node->members; type_member_l != NULL;
type_member_l = type_member_l->next)
{
- GIdlNode *type_member = type_member_l->data;
+ GIrNode *type_member = type_member_l->data;
char *normalized_name =
str_replace (type_member->name, "-", "_");
- if (type_member->type == G_IDL_NODE_SIGNAL
+ if (type_member->type == G_IR_NODE_SIGNAL
&& strcmp (normalized_name, member->ident) == 0)
{
GList *vfunc_param_l;
GList *sig_param_l;
- GIdlNodeSignal *sig = (GIdlNodeSignal *) type_member;
+ GIrNodeSignal *sig = (GIrNodeSignal *) type_member;
found_signal = TRUE;
/* set signal parameter names */
for (vfunc_param_l =
@@ -919,7 +918,7 @@
sig_param_l->next)
{
GISourceSymbol *vfunc_param = vfunc_param_l->data;
- GIdlNodeParam *sig_param = sig_param_l->data;
+ GIrNodeParam *sig_param = sig_param_l->data;
if (vfunc_param->ident != NULL)
{
g_free (sig_param->node.name);
@@ -935,21 +934,21 @@
continue;
}
- givfunc = (GIdlNodeVFunc *) g_idl_node_new (G_IDL_NODE_VFUNC);
+ givfunc = (GIrNodeVFunc *) g_idl_node_new (G_IR_NODE_VFUNC);
givfunc->node.name = g_strdup (member->ident);
node->members =
g_list_insert_sorted (node->members, givfunc,
(GCompareFunc) g_idl_node_cmp);
givfunc->result =
- (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
givfunc->result->type =
create_node_from_ctype (member->base_type->base_type->base_type);
for (param_l = member->base_type->base_type->child_list, i = 1;
param_l != NULL; param_l = param_l->next, i++)
{
GISourceSymbol *param_sym = param_l->data;
- GIdlNodeParam *param =
- (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ GIrNodeParam *param =
+ (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
if (param_sym->ident == NULL)
{
param->node.name = g_strdup_printf ("p%d", i);
@@ -981,7 +980,7 @@
{
GISourceType *union_type = sym->base_type;
gboolean opaque_type = FALSE;
- GIdlNode *type;
+ GIrNode *type;
if (union_type->child_list == NULL)
{
@@ -1002,15 +1001,15 @@
type = g_hash_table_lookup (igenerator->type_map, sym->ident);
if (type != NULL)
{
- g_assert (type->type == G_IDL_NODE_BOXED);
- GIdlNodeBoxed *node = (GIdlNodeBoxed *) type;
+ g_assert (type->type == G_IR_NODE_BOXED);
+ GIrNodeBoxed *node = (GIrNodeBoxed *) type;
GList *member_l;
for (member_l = union_type->child_list; member_l != NULL;
member_l = member_l->next)
{
GISourceSymbol *member = member_l->data;
- GIdlNodeField *gifield =
- (GIdlNodeField *) g_idl_node_new (G_IDL_NODE_FIELD);
+ GIrNodeField *gifield =
+ (GIrNodeField *) g_idl_node_new (G_IR_NODE_FIELD);
node->members = g_list_append (node->members, gifield);
gifield->node.name = g_strdup (member->ident);
gifield->type = create_node_from_ctype (member->base_type);
@@ -1018,8 +1017,8 @@
}
else
{
- GIdlNodeUnion *node =
- (GIdlNodeUnion *) g_idl_node_new (G_IDL_NODE_UNION);
+ GIrNodeUnion *node =
+ (GIrNodeUnion *) g_idl_node_new (G_IR_NODE_UNION);
char *lower_case_prefix;
GList *member_l;
@@ -1037,8 +1036,8 @@
member_l = member_l->next)
{
GISourceSymbol *member = member_l->data;
- GIdlNodeField *gifield =
- (GIdlNodeField *) g_idl_node_new (G_IDL_NODE_FIELD);
+ GIrNodeField *gifield =
+ (GIrNodeField *) g_idl_node_new (G_IR_NODE_FIELD);
node->members = g_list_append (node->members, gifield);
gifield->node.name = g_strdup (member->ident);
gifield->type = create_node_from_ctype (member->base_type);
@@ -1051,7 +1050,7 @@
{
GISourceType *enum_type;
GList *member_l;
- GIdlNodeEnum *node;
+ GIrNodeEnum *node;
GISourceSymbol *enum_symbol;
enum_type = sym->base_type;
@@ -1078,7 +1077,7 @@
return;
}
- node = (GIdlNodeEnum *) g_idl_node_new (G_IDL_NODE_ENUM);
+ node = (GIrNodeEnum *) g_idl_node_new (G_IR_NODE_ENUM);
node->node.name = g_strdup (sym->ident);
igenerator->module->entries =
g_list_insert_sorted (igenerator->module->entries, node,
@@ -1088,8 +1087,8 @@
member_l = member_l->next)
{
GISourceSymbol *member = member_l->data;
- GIdlNodeValue *gival =
- (GIdlNodeValue *) g_idl_node_new (G_IDL_NODE_VALUE);
+ GIrNodeValue *gival =
+ (GIrNodeValue *) g_idl_node_new (G_IR_NODE_VALUE);
node->values = g_list_append (node->values, gival);
gival->node.name = g_strdup (member->ident);
gival->value = member->const_int;
@@ -1104,8 +1103,8 @@
int i;
/* handle callback types */
- GIdlNodeFunction *gifunc =
- (GIdlNodeFunction *) g_idl_node_new (G_IDL_NODE_CALLBACK);
+ GIrNodeFunction *gifunc =
+ (GIrNodeFunction *) g_idl_node_new (G_IR_NODE_CALLBACK);
gifunc->node.name = g_strdup (sym->ident);
igenerator->module->entries =
@@ -1113,7 +1112,7 @@
(GCompareFunc) g_idl_node_cmp);
gifunc->symbol = g_strdup (sym->ident);
- gifunc->result = (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ gifunc->result = (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
gifunc->result->type =
create_node_from_ctype (sym->base_type->base_type->base_type);
@@ -1121,8 +1120,8 @@
param_l != NULL; param_l = param_l->next, i++)
{
GISourceSymbol *param_sym = param_l->data;
- GIdlNodeParam *param =
- (GIdlNodeParam *) g_idl_node_new (G_IDL_NODE_PARAM);
+ GIrNodeParam *param =
+ (GIrNodeParam *) g_idl_node_new (G_IR_NODE_PARAM);
if (param_sym->ident == NULL)
{
param->node.name = g_strdup_printf ("p%d", i);
@@ -1139,14 +1138,14 @@
static void
g_igenerator_process_constant (GIGenerator * igenerator, GISourceSymbol * sym)
{
- GIdlNodeConstant *giconst =
- (GIdlNodeConstant *) g_idl_node_new (G_IDL_NODE_CONSTANT);
+ GIrNodeConstant *giconst =
+ (GIrNodeConstant *) g_idl_node_new (G_IR_NODE_CONSTANT);
giconst->node.name = g_strdup (sym->ident);
igenerator->module->entries =
g_list_insert_sorted (igenerator->module->entries, giconst,
(GCompareFunc) g_idl_node_cmp);
- giconst->type = (GIdlNodeType *) g_idl_node_new (G_IDL_NODE_TYPE);
+ giconst->type = (GIrNodeType *) g_idl_node_new (G_IR_NODE_TYPE);
if (sym->const_int_set)
{
giconst->type->unparsed = g_strdup ("int");
@@ -1194,8 +1193,8 @@
}
else
{
- GIdlNodeStruct *node =
- (GIdlNodeStruct *) g_idl_node_new (G_IDL_NODE_STRUCT);
+ GIrNodeStruct *node =
+ (GIrNodeStruct *) g_idl_node_new (G_IR_NODE_STRUCT);
char *lower_case_prefix;
node->node.name = g_strdup (sym->ident);
@@ -1449,17 +1448,17 @@
static void
g_igenerator_add_module (GIGenerator *igenerator,
- GIdlModule *module)
+ GIrModule *module)
{
GList *l;
for (l = module->entries; l; l = l->next)
{
- GIdlNode *node = (GIdlNode*)l->data;
+ GIrNode *node = (GIrNode*)l->data;
- if (node->type == G_IDL_NODE_OBJECT)
+ if (node->type == G_IR_NODE_OBJECT)
{
- GIdlNodeInterface *object = (GIdlNodeInterface*)node;
+ GIrNodeInterface *object = (GIrNodeInterface*)node;
gchar *name;
if (strcmp(module->name, igenerator->namespace) == 0)
name = g_strdup (node->name);
@@ -1491,7 +1490,7 @@
for (l = modules; l; l = l->next)
{
- GIdlModule *module = (GIdlModule*)l->data;
+ GIrModule *module = (GIrModule*)l->data;
g_igenerator_add_module (igenerator, module);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]