summaryrefslogtreecommitdiff
path: root/json-glib/json-node.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2009-04-17 15:45:42 +0100
committerEmmanuele Bassi <ebassi@linux.intel.com>2009-04-17 15:45:42 +0100
commit58999bddac74c176fbd8544fa2cd30e2f067d863 (patch)
tree4bad996ca4910c2001b7f7ce642b43cae86908de /json-glib/json-node.c
parentba46d8e07a8e2dd50a3b1fff8b8c3303e3686480 (diff)
downloadjson-glib-58999bddac74c176fbd8544fa2cd30e2f067d863.tar.gz
[node] Add is_null() method
The json_node_is_null() function is just a quick check for nodes set to null.
Diffstat (limited to 'json-glib/json-node.c')
-rw-r--r--json-glib/json-node.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/json-glib/json-node.c b/json-glib/json-node.c
index 508b3dd..04570dd 100644
--- a/json-glib/json-node.c
+++ b/json-glib/json-node.c
@@ -707,3 +707,23 @@ json_node_get_node_type (JsonNode *node)
return node->type;
}
+
+/**
+ * json_node_is_null:
+ * @node: a #JsonNode
+ *
+ * Checks whether @node is a %JSON_NODE_NULL
+ *
+ * <note>A null node is not the same as a %NULL #JsonNode</note>
+ *
+ * Return value: %TRUE if the node is null
+ *
+ * Since: 0.8
+ */
+gboolean
+json_node_is_null (JsonNode *node)
+{
+ g_return_val_if_fail (node != NULL, TRUE);
+
+ return node->type == JSON_NODE_NULL;
+}