summaryrefslogtreecommitdiff
path: root/json-glib/json-node.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@openedhand.com>2007-10-01 16:25:11 +0100
committerEmmanuele Bassi <ebassi@openedhand.com>2007-10-01 16:25:11 +0100
commit2211e4e60b90b92d868c9b5f6b61e133d2435b4d (patch)
tree191221f785771fe0f0a0b0b4ce80f2f47333f20e /json-glib/json-node.c
parent29feafc236f888021b817fdfe0cfe685f5e3b65e (diff)
downloadjson-glib-2211e4e60b90b92d868c9b5f6b61e133d2435b4d.tar.gz
Implement json_node_get_parent()
It seems that the parent accessor fell through. This commit implements the declared json_node_get_parent() function.
Diffstat (limited to 'json-glib/json-node.c')
-rw-r--r--json-glib/json-node.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/json-glib/json-node.c b/json-glib/json-node.c
index 2758585..8be735e 100644
--- a/json-glib/json-node.c
+++ b/json-glib/json-node.c
@@ -303,3 +303,19 @@ json_node_type_name (JsonNode *node)
return "unknown";
}
+
+/**
+ * json_node_get_parent:
+ * @node: a #JsonNode
+ *
+ * Retrieves the parent #JsonNode of @node.
+ *
+ * Return value: the parent node, or %NULL if @node is the root node
+ */
+JsonNode *
+json_node_get_parent (JsonNode *node)
+{
+ g_return_val_if_fail (node != NULL, NULL);
+
+ return node->parent;
+}