From 58999bddac74c176fbd8544fa2cd30e2f067d863 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 17 Apr 2009 15:45:42 +0100 Subject: [node] Add is_null() method The json_node_is_null() function is just a quick check for nodes set to null. --- json-glib/json-node.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'json-glib/json-node.c') 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 + * + * A null node is not the same as a %NULL #JsonNode + * + * 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; +} -- cgit v1.2.1