From 2211e4e60b90b92d868c9b5f6b61e133d2435b4d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 1 Oct 2007 16:25:11 +0100 Subject: Implement json_node_get_parent() It seems that the parent accessor fell through. This commit implements the declared json_node_get_parent() function. --- json-glib/json-node.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'json-glib/json-node.c') 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; +} -- cgit v1.2.1