From aa2b31234f7cfac63b870e8d9d74e682b3121d4a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 5 Oct 2007 11:57:53 +0100 Subject: Implement the GType functions for JsonObject and JsonArray The type functions for the JsonObject and JsonArray types were declared, albeit with the wrong return value, but not implemented. This commit fixed the return value and implements them. JsonObject and JsonArray are boxed types because we don't need them to be GObjects (no signals, no inheritance and their implementation must be completely opaque for the developer). --- json-glib/json-array.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'json-glib/json-array.c') diff --git a/json-glib/json-array.c b/json-glib/json-array.c index 4b17825..e9727e8 100644 --- a/json-glib/json-array.c +++ b/json-glib/json-array.c @@ -44,6 +44,19 @@ struct _JsonArray volatile gint ref_count; }; +GType +json_array_get_type (void) +{ + static GType array_type = 0; + + if (G_UNLIKELY (!array_type)) + array_type = g_boxed_type_register_static ("JsonArray", + (GBoxedCopyFunc) json_array_ref, + (GBoxedFreeFunc) json_array_unref); + + return array_type; +} + /** * json_array_new: * -- cgit v1.2.1