summaryrefslogtreecommitdiff
path: root/json-glib/json-node.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2009-04-17 15:36:09 +0100
committerEmmanuele Bassi <ebassi@linux.intel.com>2009-04-17 15:36:09 +0100
commitd1e7d1ecd05687624f7149dad75a5fac9a645e72 (patch)
treec8e123762bfaabd38f246c708ee46e83b08e553b /json-glib/json-node.c
parentf2f43d17254317d35ea0cc8206592ecbcb856b68 (diff)
downloadjson-glib-d1e7d1ecd05687624f7149dad75a5fac9a645e72.tar.gz
[node] Add function version of JSON_NODE_TYPE macro
First pass at adding some type safety to the JsonNode type checks, and at removing every mention of the JsonNode interna fields.
Diffstat (limited to 'json-glib/json-node.c')
-rw-r--r--json-glib/json-node.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/json-glib/json-node.c b/json-glib/json-node.c
index 7043de3..508b3dd 100644
--- a/json-glib/json-node.c
+++ b/json-glib/json-node.c
@@ -689,3 +689,21 @@ json_node_get_boolean (JsonNode *node)
return FALSE;
}
+
+/**
+ * json_node_get_node_type:
+ * @node: a #JsonNode
+ *
+ * Retrieves the #JsonNodeType of @node
+ *
+ * Return value: the type of the node
+ *
+ * Since: 0.8
+ */
+JsonNodeType
+json_node_get_node_type (JsonNode *node)
+{
+ g_return_val_if_fail (node != NULL, JSON_NODE_NULL);
+
+ return node->type;
+}