<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSON Node: JSON-GLib Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="index.html" title="JSON-GLib Reference Manual"> <link rel="up" href="ch01.html" title="Data Types"> <link rel="prev" href="ch01.html" title="Data Types"> <link rel="next" href="json-glib-JSON-Array.html" title="JSON Array"> <meta name="generator" content="GTK-Doc V1.24 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#json-glib-JSON-Node.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#json-glib-JSON-Node.object-hierarchy" class="shortcut">Object Hierarchy</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="ch01.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="json-glib-JSON-Array.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="json-glib-JSON-Node"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="json-glib-JSON-Node.top_of_page"></a>JSON Node</span></h2> <p>JSON Node — Node in a JSON object model</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="json-glib-JSON-Node.functions"></a><h2>Functions</h2> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="functions_return"> <col class="functions_name"> </colgroup> <tbody> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-TYPE:CAPS" title="JSON_NODE_TYPE()">JSON_NODE_TYPE</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-HOLDS:CAPS" title="JSON_NODE_HOLDS()">JSON_NODE_HOLDS</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-HOLDS-VALUE:CAPS" title="JSON_NODE_HOLDS_VALUE()">JSON_NODE_HOLDS_VALUE</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-HOLDS-OBJECT:CAPS" title="JSON_NODE_HOLDS_OBJECT()">JSON_NODE_HOLDS_OBJECT</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-HOLDS-ARRAY:CAPS" title="JSON_NODE_HOLDS_ARRAY()">JSON_NODE_HOLDS_ARRAY</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-HOLDS-NULL:CAPS" title="JSON_NODE_HOLDS_NULL()">JSON_NODE_HOLDS_NULL</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-alloc" title="json_node_alloc ()">json_node_alloc</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init" title="json_node_init ()">json_node_init</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-int" title="json_node_init_int ()">json_node_init_int</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-double" title="json_node_init_double ()">json_node_init_double</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-boolean" title="json_node_init_boolean ()">json_node_init_boolean</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-string" title="json_node_init_string ()">json_node_init_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-null" title="json_node_init_null ()">json_node_init_null</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-object" title="json_node_init_object ()">json_node_init_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-init-array" title="json_node_init_array ()">json_node_init_array</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-new" title="json_node_new ()">json_node_new</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-copy" title="json_node_copy ()">json_node_copy</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-free" title="json_node_free ()">json_node_free</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-ref" title="json_node_ref ()">json_node_ref</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-unref" title="json_node_unref ()">json_node_unref</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-is-immutable" title="json_node_is_immutable ()">json_node_is_immutable</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-seal" title="json_node_seal ()">json_node_seal</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-hash" title="json_node_hash ()">json_node_hash</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-equal" title="json_node_equal ()">json_node_equal</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-array" title="json_node_set_array ()">json_node_set_array</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-take-array" title="json_node_take_array ()">json_node_take_array</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-array" title="json_node_get_array ()">json_node_get_array</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-dup-array" title="json_node_dup_array ()">json_node_dup_array</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-object" title="json_node_set_object ()">json_node_set_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-take-object" title="json_node_take_object ()">json_node_take_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-object" title="json_node_get_object ()">json_node_get_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-dup-object" title="json_node_dup_object ()">json_node_dup_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-value" title="json_node_set_value ()">json_node_set_value</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-value" title="json_node_get_value ()">json_node_get_value</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-boolean" title="json_node_set_boolean ()">json_node_set_boolean</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-boolean" title="json_node_get_boolean ()">json_node_get_boolean</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-double" title="json_node_set_double ()">json_node_set_double</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gdouble</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-double" title="json_node_get_double ()">json_node_get_double</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-int" title="json_node_set_int ()">json_node_set_int</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gint64</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-int" title="json_node_get_int ()">json_node_get_int</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-string" title="json_node_set_string ()">json_node_set_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-string" title="json_node_get_string ()">json_node_get_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-dup-string" title="json_node_dup_string ()">json_node_dup_string</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-set-parent" title="json_node_set_parent ()">json_node_set_parent</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-parent" title="json_node_get_parent ()">json_node_get_parent</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-type-name" title="json_node_type_name ()">json_node_type_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GType</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-value-type" title="json_node_get_value_type ()">json_node_get_value_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="returnvalue">JsonNodeType</span></a> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-get-node-type" title="json_node_get_node_type ()">json_node_get_node_type</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-node-is-null" title="json_node_is_null ()">json_node_is_null</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-string-hash" title="json_string_hash ()">json_string_hash</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-string-equal" title="json_string_equal ()">json_string_equal</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gint</span> </td> <td class="function_name"> <a class="link" href="json-glib-JSON-Node.html#json-string-compare" title="json_string_compare ()">json_string_compare</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <a name="JsonNode"></a><div class="refsect1"> <a name="json-glib-JSON-Node.other"></a><h2>Types and Values</h2> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="name"> <col class="description"> </colgroup> <tbody> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType">JsonNodeType</a></td> </tr> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="json-glib-JSON-Node.html#JsonNode-struct" title="JsonNode">JsonNode</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="json-glib-JSON-Node.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> GBoxed <span class="lineart">╰──</span> JsonNode </pre> </div> <div class="refsect1"> <a name="json-glib-JSON-Node.description"></a><h2>Description</h2> <p>A <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> is a generic container of elements inside a JSON stream. It can contain fundamental types (integers, booleans, floating point numbers, strings) and complex types (arrays and objects).</p> <p>When parsing a JSON data stream you extract the root node and walk the node tree by retrieving the type of data contained inside the node with the <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-TYPE:CAPS" title="JSON_NODE_TYPE()"><code class="literal">JSON_NODE_TYPE</code></a> macro. If the node contains a fundamental type you can retrieve a copy of the <span class="type">GValue</span> holding it with the <a class="link" href="json-glib-JSON-Node.html#json-node-get-value" title="json_node_get_value ()"><code class="function">json_node_get_value()</code></a> function, and then use the <span class="type">GValue</span> API to extract the data; if the node contains a complex type you can retrieve the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> or the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> using <a class="link" href="json-glib-JSON-Node.html#json-node-get-object" title="json_node_get_object ()"><code class="function">json_node_get_object()</code></a> or <a class="link" href="json-glib-JSON-Node.html#json-node-get-array" title="json_node_get_array ()"><code class="function">json_node_get_array()</code></a> respectively, and then retrieve the nodes they contain.</p> <p>A <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> may be marked as immutable using <a class="link" href="json-glib-JSON-Node.html#json-node-seal" title="json_node_seal ()"><code class="function">json_node_seal()</code></a>. This marks the node and all its descendents as read-only, and means that subsequent calls to setter functions (such as <a class="link" href="json-glib-JSON-Node.html#json-node-set-array" title="json_node_set_array ()"><code class="function">json_node_set_array()</code></a>) on them will abort as a programmer error. By marking a node tree as immutable, it may be referenced in multiple places and its hash value cached for fast lookups, without the possibility of a value deep within the tree changing and affecting hash values. Immutable <a href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNodes</span></a> may be passed to functions which retain a reference to them without needing to take a copy.</p> <p><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> supports two types of memory management: alloc/free semantics, and ref/unref semantics. The two may be mixed to a limited extent: nodes may be allocated (which gives them a reference count of 1), referenced zero or more times, unreferenced exactly that number of times (using <a class="link" href="json-glib-JSON-Node.html#json-node-unref" title="json_node_unref ()"><code class="function">json_node_unref()</code></a>), then either unreferenced exactly once more or freed (using <a class="link" href="json-glib-JSON-Node.html#json-node-free" title="json_node_free ()"><code class="function">json_node_free()</code></a>) to destroy them. <a class="link" href="json-glib-JSON-Node.html#json-node-free" title="json_node_free ()"><code class="function">json_node_free()</code></a> must not be used when a node might have a reference count not equal to 1. To this end, json-glib uses <a class="link" href="json-glib-JSON-Node.html#json-node-copy" title="json_node_copy ()"><code class="function">json_node_copy()</code></a> and <a class="link" href="json-glib-JSON-Node.html#json-node-unref" title="json_node_unref ()"><code class="function">json_node_unref()</code></a> internally.</p> </div> <div class="refsect1"> <a name="json-glib-JSON-Node.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="JSON-NODE-TYPE:CAPS"></a><h3>JSON_NODE_TYPE()</h3> <pre class="programlisting">#define JSON_NODE_TYPE(node) (json_node_get_node_type ((node))) </pre> <p>Evaluates to the <a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="type">JsonNodeType</span></a> contained by <em class="parameter"><code>node</code></em> </p> <div class="refsect3"> <a name="id-1.3.3.2.8.2.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="JSON-NODE-HOLDS:CAPS"></a><h3>JSON_NODE_HOLDS()</h3> <pre class="programlisting">#define JSON_NODE_HOLDS(node,t) (json_node_get_node_type ((node)) == (t)) </pre> <p>Evaluates to <code class="literal">TRUE</code> if the <em class="parameter"><code>node</code></em> holds type <em class="parameter"><code>t</code></em> </p> <div class="refsect3"> <a name="id-1.3.3.2.8.3.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>t</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="type">JsonNodeType</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> <hr> <div class="refsect2"> <a name="JSON-NODE-HOLDS-VALUE:CAPS"></a><h3>JSON_NODE_HOLDS_VALUE()</h3> <pre class="programlisting">#define JSON_NODE_HOLDS_VALUE(node) (JSON_NODE_HOLDS ((node), JSON_NODE_VALUE)) </pre> <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em> holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.4.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> <hr> <div class="refsect2"> <a name="JSON-NODE-HOLDS-OBJECT:CAPS"></a><h3>JSON_NODE_HOLDS_OBJECT()</h3> <pre class="programlisting">#define JSON_NODE_HOLDS_OBJECT(node) (JSON_NODE_HOLDS ((node), JSON_NODE_OBJECT)) </pre> <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em> holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-OBJECT:CAPS"><code class="literal">JSON_NODE_OBJECT</code></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.5.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> <hr> <div class="refsect2"> <a name="JSON-NODE-HOLDS-ARRAY:CAPS"></a><h3>JSON_NODE_HOLDS_ARRAY()</h3> <pre class="programlisting">#define JSON_NODE_HOLDS_ARRAY(node) (JSON_NODE_HOLDS ((node), JSON_NODE_ARRAY)) </pre> <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em> holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-ARRAY:CAPS"><code class="literal">JSON_NODE_ARRAY</code></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.6.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> <hr> <div class="refsect2"> <a name="JSON-NODE-HOLDS-NULL:CAPS"></a><h3>JSON_NODE_HOLDS_NULL()</h3> <pre class="programlisting">#define JSON_NODE_HOLDS_NULL(node) (JSON_NODE_HOLDS ((node), JSON_NODE_NULL)) </pre> <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em> holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.7.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-alloc"></a><h3>json_node_alloc ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_alloc (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> <p>Allocates a new <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. Use <a class="link" href="json-glib-JSON-Node.html#json-node-init" title="json_node_init ()"><code class="function">json_node_init()</code></a> and its variants to initialize the returned value.</p> <p><span class="annotation">[<acronym title="This symbol is a constructor, not a static method."><span class="acronym">constructor</span></acronym>]</span></p> <div class="refsect3"> <a name="id-1.3.3.2.8.8.6"></a><h4>Returns</h4> <p> the newly allocated <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. Use <a class="link" href="json-glib-JSON-Node.html#json-node-free" title="json_node_free ()"><code class="function">json_node_free()</code></a> to free the resources allocated by this function. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init"></a><h3>json_node_init ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="type">JsonNodeType</span></a> type</code></em>);</pre> <p>Initializes a <em class="parameter"><code>node</code></em> to a specific <em class="parameter"><code>type</code></em> .</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.9.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>the type of JSON node to initialize <em class="parameter"><code>node</code></em> to</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.9.7"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-int"></a><h3>json_node_init_int ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_int (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">gint64</span> value</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a> and sets <em class="parameter"><code>value</code></em> into it.</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.10.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>an integer</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.10.7"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-double"></a><h3>json_node_init_double ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_double (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">gdouble</span> value</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a> and sets <em class="parameter"><code>value</code></em> into it.</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.11.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a floating point value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.11.7"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-boolean"></a><h3>json_node_init_boolean ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_boolean (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a> and sets <em class="parameter"><code>value</code></em> into it.</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.12.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a boolean value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.12.7"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-string"></a><h3>json_node_init_string ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_string (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a> and sets <em class="parameter"><code>value</code></em> into it.</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.13.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p> a string value. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.13.7"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-null"></a><h3>json_node_init_null ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_null (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a>.</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.14.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.14.7"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-object"></a><h3>json_node_init_object ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_object (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *object</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-OBJECT:CAPS"><code class="literal">JSON_NODE_OBJECT</code></a> and sets <em class="parameter"><code>object</code></em> into it.</p> <p>This function will take a reference on <em class="parameter"><code>object</code></em> .</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.15.7"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object</p></td> <td class="parameter_description"><p> the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> to initialize <em class="parameter"><code>node</code></em> with, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.15.8"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-init-array"></a><h3>json_node_init_array ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_init_array (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre> <p>Initializes <em class="parameter"><code>node</code></em> to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-ARRAY:CAPS"><code class="literal">JSON_NODE_ARRAY</code></a> and sets <em class="parameter"><code>array</code></em> into it.</p> <p>This function will take a reference on <em class="parameter"><code>array</code></em> .</p> <p>If the node has already been initialized once, it will be reset to the given type, and any data contained will be cleared.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.16.7"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> to initialize</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>array</p></td> <td class="parameter_description"><p> the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> to initialize <em class="parameter"><code>node</code></em> with, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.16.8"></a><h4>Returns</h4> <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-new"></a><h3>json_node_new ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_new (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="type">JsonNodeType</span></a> type</code></em>);</pre> <p>Creates a new <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of <em class="parameter"><code>type</code></em> .</p> <p>This is a convenience function for <a class="link" href="json-glib-JSON-Node.html#json-node-alloc" title="json_node_alloc ()"><code class="function">json_node_alloc()</code></a> and <a class="link" href="json-glib-JSON-Node.html#json-node-init" title="json_node_init ()"><code class="function">json_node_init()</code></a>, and it's the equivalent of:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1</pre></td> <td class="listing_code"><pre class="programlisting"><span class="function"><a href="json-glib-JSON-Node.html#json-node-init">json_node_init</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="json-glib-JSON-Node.html#json-node-alloc">json_node_alloc</a></span><span class="normal"> </span><span class="symbol">(),</span><span class="normal"> type</span><span class="symbol">);</span></pre></td> </tr> </tbody> </table> </div> <p></p> <p><span class="annotation">[<acronym title="This symbol is a constructor, not a static method."><span class="acronym">constructor</span></acronym>]</span></p> <div class="refsect3"> <a name="id-1.3.3.2.8.17.9"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>type</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="type">JsonNodeType</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.17.10"></a><h4>Returns</h4> <p> the newly created <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-copy"></a><h3>json_node_copy ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_copy (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Copies <em class="parameter"><code>node</code></em> . If the node contains complex data types, their reference counts are increased, regardless of whether the node is mutable or immutable.</p> <p>The copy will be immutable if, and only if, <em class="parameter"><code>node</code></em> is immutable. However, there should be no need to copy an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.18.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.18.7"></a><h4>Returns</h4> <p> the copied <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-free"></a><h3>json_node_free ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_free (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Frees the resources allocated by <em class="parameter"><code>node</code></em> .</p> <div class="refsect3"> <a name="id-1.3.3.2.8.19.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-ref"></a><h3>json_node_ref ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_ref (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Increment the reference count of <em class="parameter"><code>node</code></em> .</p> <div class="refsect3"> <a name="id-1.3.3.2.8.20.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.20.6"></a><h4>Returns</h4> <p> a pointer to <em class="parameter"><code>node</code></em> . </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-unref"></a><h3>json_node_unref ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_unref (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Decrement the reference count of <em class="parameter"><code>node</code></em> . If it reaches zero, the node is freed.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.21.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-is-immutable"></a><h3>json_node_is_immutable ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> json_node_is_immutable (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Check whether the given <em class="parameter"><code>node</code></em> has been marked as immutable by calling <a class="link" href="json-glib-JSON-Node.html#json-node-seal" title="json_node_seal ()"><code class="function">json_node_seal()</code></a> on it.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.22.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.22.6"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>node</code></em> is immutable</p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-seal"></a><h3>json_node_seal ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_seal (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Seals the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>, making it immutable to further changes. In order to be sealed, the <em class="parameter"><code>node</code></em> must have a type and value set. The value will be recursively sealed — if the node holds an object, that <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> will be sealed, etc.</p> <p>If the <em class="parameter"><code>node</code></em> is already immutable, this is a no-op.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.23.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-hash"></a><h3>json_node_hash ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> json_node_hash (<em class="parameter"><code><span class="type">gconstpointer</span> key</code></em>);</pre> <p>Calculate a hash value for the given <em class="parameter"><code>key</code></em> (a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>).</p> <p>The hash is calculated over the node and its value, recursively. If the node is immutable, this is a fast operation; otherwise, it scales proportionally with the size of the node’s value (for example, with the number of members in the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> if this node contains an object).</p> <div class="refsect3"> <a name="id-1.3.3.2.8.24.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>key</p></td> <td class="parameter_description"><p> a JSON node to hash. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> JsonNode]</span></td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.24.7"></a><h4>Returns</h4> <p> hash value for <em class="parameter"><code>key</code></em> </p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-equal"></a><h3>json_node_equal ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> json_node_equal (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>, <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre> <p>Check whether <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> are equal <a href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNodes</span></a>, meaning they have the same type and same values (checked recursively). Note that integer values are compared numerically, ignoring type, so a double value 4.0 is equal to the integer value 4.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.25.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>a</p></td> <td class="parameter_description"><p> a JSON node. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> JsonNode]</span></td> </tr> <tr> <td class="parameter_name"><p>b</p></td> <td class="parameter_description"><p> another JSON node. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> JsonNode]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.25.6"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> are equal; <code class="literal">FALSE</code> otherwise</p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-set-array"></a><h3>json_node_set_array ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_array (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre> <p>Sets <em class="parameter"><code>array</code></em> inside <em class="parameter"><code>node</code></em> and increases the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> reference count.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.26.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> initialized to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-ARRAY:CAPS"><code class="literal">JSON_NODE_ARRAY</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>array</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-take-array"></a><h3>json_node_take_array ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_take_array (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre> <p>Sets <em class="parameter"><code>array</code></em> into <em class="parameter"><code>node</code></em> without increasing the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> reference count.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.27.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> initialized to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-ARRAY:CAPS"><code class="literal">JSON_NODE_ARRAY</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>array</p></td> <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-array"></a><h3>json_node_get_array ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> * json_node_get_array (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.28.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.28.6"></a><h4>Returns</h4> <p> the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-dup-array"></a><h3>json_node_dup_array ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> * json_node_dup_array (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> and returns it with its reference count increased by one.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.29.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.29.6"></a><h4>Returns</h4> <p> the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> with its reference count increased. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-object"></a><h3>json_node_set_object ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_object (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *object</code></em>);</pre> <p>Sets <em class="parameter"><code>objects</code></em> inside <em class="parameter"><code>node</code></em> . The reference count of <em class="parameter"><code>object</code></em> is increased.</p> <p>If <em class="parameter"><code>object</code></em> is <code class="literal">NULL</code>, the node’s existing object is cleared.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.30.7"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> initialized to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-OBJECT:CAPS"><code class="literal">JSON_NODE_OBJECT</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object</p></td> <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-take-object"></a><h3>json_node_take_object ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_take_object (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *object</code></em>);</pre> <p>Sets <em class="parameter"><code>object</code></em> inside <em class="parameter"><code>node</code></em> . The reference count of <em class="parameter"><code>object</code></em> is not increased.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.31.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> initialized to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-OBJECT:CAPS"><code class="literal">JSON_NODE_OBJECT</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object</p></td> <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-object"></a><h3>json_node_get_object ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> * json_node_get_object (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.32.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.32.6"></a><h4>Returns</h4> <p> the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-dup-object"></a><h3>json_node_dup_object ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> * json_node_dup_object (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> inside <em class="parameter"><code>node</code></em> . The reference count of the returned object is increased.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.33.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.33.6"></a><h4>Returns</h4> <p> the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-value"></a><h3>json_node_set_value ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_value (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>);</pre> <p>Sets <em class="parameter"><code>value</code></em> inside <em class="parameter"><code>node</code></em> . The passed <span class="type">GValue</span> is copied into the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.34.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> initialized to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>the <span class="type">GValue</span> to set</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-value"></a><h3>json_node_get_value ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_get_value (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">GValue</span> *value</code></em>);</pre> <p>Retrieves a value from a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> and copies into <em class="parameter"><code>value</code></em> . When done using it, call <code class="function">g_value_unset()</code> on the <span class="type">GValue</span>.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.35.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p> return location for an uninitialized value. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-boolean"></a><h3>json_node_set_boolean ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_boolean (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre> <p>Sets <em class="parameter"><code>value</code></em> as the boolean content of the <em class="parameter"><code>node</code></em> , replacing any existing content.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.36.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a boolean value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-boolean"></a><h3>json_node_get_boolean ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> json_node_get_boolean (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Gets the boolean value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.37.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.37.6"></a><h4>Returns</h4> <p> a boolean value.</p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-double"></a><h3>json_node_set_double ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_double (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">gdouble</span> value</code></em>);</pre> <p>Sets <em class="parameter"><code>value</code></em> as the double content of the <em class="parameter"><code>node</code></em> , replacing any existing content.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.38.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a double value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-double"></a><h3>json_node_get_double ()</h3> <pre class="programlisting"><span class="returnvalue">gdouble</span> json_node_get_double (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Gets the double value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.39.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.39.6"></a><h4>Returns</h4> <p> a double value.</p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-int"></a><h3>json_node_set_int ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_int (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><span class="type">gint64</span> value</code></em>);</pre> <p>Sets <em class="parameter"><code>value</code></em> as the integer content of the <em class="parameter"><code>node</code></em> , replacing any existing content.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.40.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>an integer value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-int"></a><h3>json_node_get_int ()</h3> <pre class="programlisting"><span class="returnvalue">gint64</span> json_node_get_int (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Gets the integer value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.41.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.41.6"></a><h4>Returns</h4> <p> an integer value.</p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-string"></a><h3>json_node_set_string ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_string (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *value</code></em>);</pre> <p>Sets <em class="parameter"><code>value</code></em> as the string content of the <em class="parameter"><code>node</code></em> , replacing any existing content.</p> <p>It is an error to call this on an immutable node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.42.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> initialized to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>a string value</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-string"></a><h3>json_node_get_string ()</h3> <pre class="programlisting">const <span class="returnvalue">gchar</span> * json_node_get_string (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Gets the string value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.43.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.43.6"></a><h4>Returns</h4> <p> a string value.</p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-dup-string"></a><h3>json_node_dup_string ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> * json_node_dup_string (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Gets a copy of the string value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p> <div class="refsect3"> <a name="id-1.3.3.2.8.44.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of type <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.44.6"></a><h4>Returns</h4> <p> a newly allocated string containing a copy of the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> contents. Use <code class="function">g_free()</code> to free the allocated resources. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-set-parent"></a><h3>json_node_set_parent ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> json_node_set_parent (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>, <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *parent</code></em>);</pre> <p>Sets the parent <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of <em class="parameter"><code>node</code></em> .</p> <p>It is an error to call this with an immutable <em class="parameter"><code>parent</code></em> . <em class="parameter"><code>node</code></em> may be immutable.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.45.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parent</p></td> <td class="parameter_description"><p> the parent <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of <em class="parameter"><code>node</code></em> . </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-get-parent"></a><h3>json_node_get_parent ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> * json_node_get_parent (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the parent <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> of <em class="parameter"><code>node</code></em> .</p> <div class="refsect3"> <a name="id-1.3.3.2.8.46.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.46.6"></a><h4>Returns</h4> <p> the parent node, or <code class="literal">NULL</code> if <em class="parameter"><code>node</code></em> is the root node. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-type-name"></a><h3>json_node_type_name ()</h3> <pre class="programlisting">const <span class="returnvalue">gchar</span> * json_node_type_name (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the user readable name of the data type contained by <em class="parameter"><code>node</code></em> .</p> <div class="refsect3"> <a name="id-1.3.3.2.8.47.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.47.6"></a><h4>Returns</h4> <p> a string containing the name of the type. The returned string is owned by the node and should never be modified or freed</p> </div> </div> <hr> <div class="refsect2"> <a name="json-node-get-value-type"></a><h3>json_node_get_value_type ()</h3> <pre class="programlisting"><span class="returnvalue">GType</span> json_node_get_value_type (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Returns the <span class="type">GType</span> of the payload of the node.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.48.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.48.6"></a><h4>Returns</h4> <p> a <span class="type">GType</span> for the payload.</p> </div> <p class="since">Since: <a class="link" href="ix03.html#api-index-0.4">0.4</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-get-node-type"></a><h3>json_node_get_node_type ()</h3> <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="returnvalue">JsonNodeType</span></a> json_node_get_node_type (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Retrieves the <a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="type">JsonNodeType</span></a> of <em class="parameter"><code>node</code></em> </p> <div class="refsect3"> <a name="id-1.3.3.2.8.49.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.49.6"></a><h4>Returns</h4> <p> the type of the node</p> </div> <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p> </div> <hr> <div class="refsect2"> <a name="json-node-is-null"></a><h3>json_node_is_null ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> json_node_is_null (<em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *node</code></em>);</pre> <p>Checks whether <em class="parameter"><code>node</code></em> is a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a>.</p> <p>A <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a> node is not the same as a <code class="literal">NULL</code> <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>; a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a> represents a 'null' value in the JSON tree.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.50.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.50.7"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the node is null</p> </div> <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p> </div> <hr> <div class="refsect2"> <a name="json-string-hash"></a><h3>json_string_hash ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> json_string_hash (<em class="parameter"><code><span class="type">gconstpointer</span> key</code></em>);</pre> <p>Calculate a hash value for the given <em class="parameter"><code>key</code></em> (a UTF-8 JSON string).</p> <p>Note: Member names are compared byte-wise, without applying any Unicode decomposition or normalisation. This is not explicitly mentioned in the JSON standard (ECMA-404), but is assumed.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.51.6"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>key</p></td> <td class="parameter_description"><p> a JSON string to hash. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> utf8]</span></td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.51.7"></a><h4>Returns</h4> <p> hash value for <em class="parameter"><code>key</code></em> </p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-string-equal"></a><h3>json_string_equal ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> json_string_equal (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>, <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre> <p>Check whether <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> are equal UTF-8 JSON strings.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.52.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>a</p></td> <td class="parameter_description"><p> a JSON string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> utf8]</span></td> </tr> <tr> <td class="parameter_name"><p>b</p></td> <td class="parameter_description"><p> another JSON string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> utf8]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.52.6"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> are equal; <code class="literal">FALSE</code> otherwise</p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> <hr> <div class="refsect2"> <a name="json-string-compare"></a><h3>json_string_compare ()</h3> <pre class="programlisting"><span class="returnvalue">gint</span> json_string_compare (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>, <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre> <p>Check whether <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> are equal UTF-8 JSON strings and return an ordering over them in <code class="function">strcmp()</code> style.</p> <div class="refsect3"> <a name="id-1.3.3.2.8.53.5"></a><h4>Parameters</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>a</p></td> <td class="parameter_description"><p> a JSON string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> utf8]</span></td> </tr> <tr> <td class="parameter_name"><p>b</p></td> <td class="parameter_description"><p> another JSON string. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> utf8]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="id-1.3.3.2.8.53.6"></a><h4>Returns</h4> <p> an integer less than zero if <em class="parameter"><code>a</code></em> < <em class="parameter"><code>b</code></em> , equal to zero if <em class="parameter"><code>a</code></em> == <em class="parameter"><code>b</code></em> , and greater than zero if <em class="parameter"><code>a</code></em> > <em class="parameter"><code>b</code></em> </p> </div> <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p> </div> </div> <div class="refsect1"> <a name="json-glib-JSON-Node.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="JsonNodeType"></a><h3>enum JsonNodeType</h3> <p>Indicates the content of a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>.</p> <div class="refsect3"> <a name="id-1.3.3.2.9.2.4"></a><h4>Members</h4> <div class="informaltable"><table width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="JSON-NODE-OBJECT:CAPS"></a>JSON_NODE_OBJECT</p></td> <td class="enum_member_description"> <p>The node contains a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a></p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="JSON-NODE-ARRAY:CAPS"></a>JSON_NODE_ARRAY</p></td> <td class="enum_member_description"> <p>The node contains a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="JSON-NODE-VALUE:CAPS"></a>JSON_NODE_VALUE</p></td> <td class="enum_member_description"> <p>The node contains a fundamental type</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="JSON-NODE-NULL:CAPS"></a>JSON_NODE_NULL</p></td> <td class="enum_member_description"> <p>Special type, for nodes containing null</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> </div> <hr> <div class="refsect2"> <a name="JsonNode-struct"></a><h3>JsonNode</h3> <pre class="programlisting">typedef struct _JsonNode JsonNode;</pre> <p>A generic container of JSON data types. The contents of the <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> structure are private and should only be accessed via the provided functions and never directly.</p> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.24</div> </body> </html>