summaryrefslogtreecommitdiff
path: root/json-glib/json-node.c
diff options
context:
space:
mode:
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;
+}