glibrdf

GLib wrapper for the Redland RDF library
git clone https://code.djc.id.au/git/glibrdf/
commit 44a6bb7a68edf9780c5683436203a9579645de81
parent 756e52a83f32c3f1a0b2ed2e58317183ee33887d
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sat, 21 Jul 2012 20:58:26 +1000

glib boxed type for librdf_node

Diffstat:
Mglibrdf.c | 11++++++++++-
Mglibrdf.h | 3++-
Mglibrdf.vapi | 5+++--
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/glibrdf.c b/glibrdf.c
@@ -1,4 +1,13 @@
 
 #include "glibrdf.h"
 
-/* nothing here yet... */
+GType librdf_node_get_gtype(void) {
+    static volatile gsize _librdf_node_type_id = 0;
+    if (g_once_init_enter(&_librdf_node_type_id)) {
+        GType type_id = g_boxed_type_register_static("librdf_node",
+                (GBoxedCopyFunc) librdf_new_node_from_node,
+                (GBoxedFreeFunc) librdf_free_node);
+        g_once_init_leave(&_librdf_node_type_id, type_id);
+    }
+    return _librdf_node_type_id;
+}
diff --git a/glibrdf.h b/glibrdf.h
@@ -5,6 +5,7 @@
 #include <glib-object.h>
 #include <librdf.h>
 
-/* nothing here yet... */
+GType librdf_node_get_gtype(void);
+#define G_TYPE_RDF_NODE librdf_node_get_gtype()
 
 #endif
diff --git a/glibrdf.vapi b/glibrdf.vapi
@@ -26,7 +26,7 @@
 
 using GLib;
 
-[CCode (cheader_filename = "librdf.h")]
+[CCode (cheader_filename = "glibrdf.h")]
 namespace Rdf {
 	/***************************************************************************
 	 * World
@@ -402,7 +402,8 @@ namespace Rdf {
 	[CCode (cname = "librdf_node",
                 const_cname = "librdf_node",
 	        copy_function = "librdf_new_node_from_node",
-	        free_function = "librdf_free_node")]
+                free_function = "librdf_free_node",
+                type_id = "G_TYPE_RDF_NODE")]
 	public class Node {
 		[CCode (cname = "librdf_new_node")]
 		public Node (World world);