diff options
author | Emmanuele Bassi <ebassi@openedhand.com> | 2007-10-05 11:57:53 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@openedhand.com> | 2007-10-05 11:57:53 +0100 |
commit | aa2b31234f7cfac63b870e8d9d74e682b3121d4a (patch) | |
tree | a40f58176289391ed6b5d7fe745d91aa548c5fdf /json-glib/json-object.c | |
parent | bd41854505f47d2176ea4cfba8083ce998c482cc (diff) | |
download | json-glib-aa2b31234f7cfac63b870e8d9d74e682b3121d4a.tar.gz |
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).
Diffstat (limited to 'json-glib/json-object.c')
-rw-r--r-- | json-glib/json-object.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/json-glib/json-object.c b/json-glib/json-object.c index 96fcdbe..bbea83d 100644 --- a/json-glib/json-object.c +++ b/json-glib/json-object.c @@ -47,6 +47,19 @@ struct _JsonObject volatile gint ref_count; }; +GType +json_object_get_type (void) +{ + static GType object_type = 0; + + if (G_UNLIKELY (!object_type)) + object_type = g_boxed_type_register_static ("JsonObject", + (GBoxedCopyFunc) json_object_ref, + (GBoxedFreeFunc) json_object_unref); + + return object_type; +} + /** * json_object_new: * |