1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>JSON Node: JSON-GLib Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="JSON-GLib Reference Manual">
8 <link rel="up" href="ch01.html" title="Data Types">
9 <link rel="prev" href="ch01.html" title="Data Types">
10 <link rel="next" href="json-glib-JSON-Array.html" title="JSON Array">
11 <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18 <a href="#json-glib-JSON-Node.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
19 <a href="#json-glib-JSON-Node.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="ch01.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="json-glib-JSON-Array.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26 <div class="refentry">
27 <a name="json-glib-JSON-Node"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
30 <h2><span class="refentrytitle"><a name="json-glib-JSON-Node.top_of_page"></a>JSON Node</span></h2>
31 <p>JSON Node — Node in a JSON object model</p>
33 <td class="gallery_image" valign="top" align="right"></td>
35 <div class="refsect1">
36 <a name="json-glib-JSON-Node.functions"></a><h2>Functions</h2>
37 <div class="informaltable"><table class="informaltable" width="100%" border="0">
39 <col width="150px" class="functions_return">
40 <col class="functions_name">
44 <td class="define_keyword">#define</td>
45 <td class="function_name">
46 <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>
50 <td class="define_keyword">#define</td>
51 <td class="function_name">
52 <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>
56 <td class="define_keyword">#define</td>
57 <td class="function_name">
58 <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>
62 <td class="define_keyword">#define</td>
63 <td class="function_name">
64 <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>
68 <td class="define_keyword">#define</td>
69 <td class="function_name">
70 <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>
74 <td class="define_keyword">#define</td>
75 <td class="function_name">
76 <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>
80 <td class="function_type">
81 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
83 <td class="function_name">
84 <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>
88 <td class="function_type">
89 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
91 <td class="function_name">
92 <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>
96 <td class="function_type">
97 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
99 <td class="function_name">
100 <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>
104 <td class="function_type">
105 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
107 <td class="function_name">
108 <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>
112 <td class="function_type">
113 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
115 <td class="function_name">
116 <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>
120 <td class="function_type">
121 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
123 <td class="function_name">
124 <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>
128 <td class="function_type">
129 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
131 <td class="function_name">
132 <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>
136 <td class="function_type">
137 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
139 <td class="function_name">
140 <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>
144 <td class="function_type">
145 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
147 <td class="function_name">
148 <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>
152 <td class="function_type">
153 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
155 <td class="function_name">
156 <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>
160 <td class="function_type">
161 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
163 <td class="function_name">
164 <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>
168 <td class="function_type">
169 <span class="returnvalue">void</span>
171 <td class="function_name">
172 <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>
176 <td class="function_type">
177 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
179 <td class="function_name">
180 <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>
184 <td class="function_type">
185 <span class="returnvalue">void</span>
187 <td class="function_name">
188 <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>
192 <td class="function_type">
193 <span class="returnvalue">gboolean</span>
195 <td class="function_name">
196 <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>
200 <td class="function_type">
201 <span class="returnvalue">void</span>
203 <td class="function_name">
204 <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>
208 <td class="function_type">
209 <span class="returnvalue">guint</span>
211 <td class="function_name">
212 <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>
216 <td class="function_type">
217 <span class="returnvalue">gboolean</span>
219 <td class="function_name">
220 <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>
224 <td class="function_type">
225 <span class="returnvalue">void</span>
227 <td class="function_name">
228 <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>
232 <td class="function_type">
233 <span class="returnvalue">void</span>
235 <td class="function_name">
236 <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>
240 <td class="function_type">
241 <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
243 <td class="function_name">
244 <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>
248 <td class="function_type">
249 <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
251 <td class="function_name">
252 <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>
256 <td class="function_type">
257 <span class="returnvalue">void</span>
259 <td class="function_name">
260 <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>
264 <td class="function_type">
265 <span class="returnvalue">void</span>
267 <td class="function_name">
268 <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>
272 <td class="function_type">
273 <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> *
275 <td class="function_name">
276 <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>
280 <td class="function_type">
281 <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> *
283 <td class="function_name">
284 <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>
288 <td class="function_type">
289 <span class="returnvalue">void</span>
291 <td class="function_name">
292 <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>
296 <td class="function_type">
297 <span class="returnvalue">void</span>
299 <td class="function_name">
300 <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>
304 <td class="function_type">
305 <span class="returnvalue">void</span>
307 <td class="function_name">
308 <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>
312 <td class="function_type">
313 <span class="returnvalue">gboolean</span>
315 <td class="function_name">
316 <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>
320 <td class="function_type">
321 <span class="returnvalue">void</span>
323 <td class="function_name">
324 <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>
328 <td class="function_type">
329 <span class="returnvalue">gdouble</span>
331 <td class="function_name">
332 <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>
336 <td class="function_type">
337 <span class="returnvalue">void</span>
339 <td class="function_name">
340 <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>
344 <td class="function_type">
345 <span class="returnvalue">gint64</span>
347 <td class="function_name">
348 <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>
352 <td class="function_type">
353 <span class="returnvalue">void</span>
355 <td class="function_name">
356 <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>
360 <td class="function_type">const <span class="returnvalue">gchar</span> *
362 <td class="function_name">
363 <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>
367 <td class="function_type">
368 <span class="returnvalue">gchar</span> *
370 <td class="function_name">
371 <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>
375 <td class="function_type">
376 <span class="returnvalue">void</span>
378 <td class="function_name">
379 <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>
383 <td class="function_type">
384 <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
386 <td class="function_name">
387 <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>
391 <td class="function_type">const <span class="returnvalue">gchar</span> *
393 <td class="function_name">
394 <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>
398 <td class="function_type">
399 <span class="returnvalue">GType</span>
401 <td class="function_name">
402 <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>
406 <td class="function_type">
407 <a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="returnvalue">JsonNodeType</span></a>
409 <td class="function_name">
410 <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>
414 <td class="function_type">
415 <span class="returnvalue">gboolean</span>
417 <td class="function_name">
418 <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>
422 <td class="function_type">
423 <span class="returnvalue">guint</span>
425 <td class="function_name">
426 <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>
430 <td class="function_type">
431 <span class="returnvalue">gboolean</span>
433 <td class="function_name">
434 <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>
438 <td class="function_type">
439 <span class="returnvalue">gint</span>
441 <td class="function_name">
442 <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>
448 <a name="JsonNode"></a><div class="refsect1">
449 <a name="json-glib-JSON-Node.other"></a><h2>Types and Values</h2>
450 <div class="informaltable"><table class="informaltable" width="100%" border="0">
452 <col width="150px" class="name">
453 <col class="description">
457 <td class="datatype_keyword">enum</td>
458 <td class="function_name"><a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType">JsonNodeType</a></td>
461 <td class="datatype_keyword"> </td>
462 <td class="function_name"><a class="link" href="json-glib-JSON-Node.html#JsonNode-struct" title="JsonNode">JsonNode</a></td>
467 <div class="refsect1">
468 <a name="json-glib-JSON-Node.object-hierarchy"></a><h2>Object Hierarchy</h2>
469 <pre class="screen"> <a href="/home/ebassi/gnome/install/share/gtk-doc/html/gobject/gobject-Boxed-Types.html">GBoxed</a>
470 <span class="lineart">╰──</span> JsonNode
473 <div class="refsect1">
474 <a name="json-glib-JSON-Node.description"></a><h2>Description</h2>
475 <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.
476 It can contain fundamental types (integers, booleans, floating point
477 numbers, strings) and complex types (arrays and objects).</p>
478 <p>When parsing a JSON data stream you extract the root node and walk
479 the node tree by retrieving the type of data contained inside the
480 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
481 type you can retrieve a copy of the <span class="type">GValue</span> holding it with the
482 <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
483 the data; if the node contains a complex type you can retrieve the
484 <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
485 <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
487 <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
488 node and all its descendents as read-only, and means that subsequent calls to
489 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
490 programmer error. By marking a node tree as immutable, it may be referenced
491 in multiple places and its hash value cached for fast lookups, without the
492 possibility of a value deep within the tree changing and affecting hash
493 values. Immutable <a href="json-glib-JSON-Node.html#JsonNode-struct"><span class="type">JsonNodes</span></a> may be passed to functions which retain a
494 reference to them without needing to take a copy.</p>
495 <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
496 ref/unref semantics. The two may be mixed to a limited extent: nodes may be
497 allocated (which gives them a reference count of 1), referenced zero or more
498 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>),
499 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>)
500 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
501 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>
502 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>
504 <div class="refsect1">
505 <a name="json-glib-JSON-Node.functions_details"></a><h2>Functions</h2>
506 <div class="refsect2">
507 <a name="JSON-NODE-TYPE:CAPS"></a><h3>JSON_NODE_TYPE()</h3>
508 <pre class="programlisting">#define JSON_NODE_TYPE(node) (json_node_get_node_type ((node)))
510 <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>
512 <div class="refsect3">
513 <a name="JSON-NODE-TYPE.parameters"></a><h4>Parameters</h4>
514 <div class="informaltable"><table class="informaltable" width="100%" border="0">
516 <col width="150px" class="parameters_name">
517 <col class="parameters_description">
518 <col width="200px" class="parameters_annotations">
521 <td class="parameter_name"><p>node</p></td>
522 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
523 <td class="parameter_annotations"> </td>
529 <div class="refsect2">
530 <a name="JSON-NODE-HOLDS:CAPS"></a><h3>JSON_NODE_HOLDS()</h3>
531 <pre class="programlisting">#define JSON_NODE_HOLDS(node,t) (json_node_get_node_type ((node)) == (t))
533 <p>Evaluates to <code class="literal">TRUE</code> if the <em class="parameter"><code>node</code></em>
534 holds type <em class="parameter"><code>t</code></em>
536 <div class="refsect3">
537 <a name="JSON-NODE-HOLDS.parameters"></a><h4>Parameters</h4>
538 <div class="informaltable"><table class="informaltable" width="100%" border="0">
540 <col width="150px" class="parameters_name">
541 <col class="parameters_description">
542 <col width="200px" class="parameters_annotations">
546 <td class="parameter_name"><p>node</p></td>
547 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
548 <td class="parameter_annotations"> </td>
551 <td class="parameter_name"><p>t</p></td>
552 <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>
553 <td class="parameter_annotations"> </td>
558 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
561 <div class="refsect2">
562 <a name="JSON-NODE-HOLDS-VALUE:CAPS"></a><h3>JSON_NODE_HOLDS_VALUE()</h3>
563 <pre class="programlisting">#define JSON_NODE_HOLDS_VALUE(node) (JSON_NODE_HOLDS ((node), JSON_NODE_VALUE))
565 <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em>
566 holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-VALUE:CAPS"><code class="literal">JSON_NODE_VALUE</code></a></p>
567 <div class="refsect3">
568 <a name="JSON-NODE-HOLDS-VALUE.parameters"></a><h4>Parameters</h4>
569 <div class="informaltable"><table class="informaltable" width="100%" border="0">
571 <col width="150px" class="parameters_name">
572 <col class="parameters_description">
573 <col width="200px" class="parameters_annotations">
576 <td class="parameter_name"><p>node</p></td>
577 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
578 <td class="parameter_annotations"> </td>
582 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
585 <div class="refsect2">
586 <a name="JSON-NODE-HOLDS-OBJECT:CAPS"></a><h3>JSON_NODE_HOLDS_OBJECT()</h3>
587 <pre class="programlisting">#define JSON_NODE_HOLDS_OBJECT(node) (JSON_NODE_HOLDS ((node), JSON_NODE_OBJECT))
589 <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em>
590 holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-OBJECT:CAPS"><code class="literal">JSON_NODE_OBJECT</code></a></p>
591 <div class="refsect3">
592 <a name="JSON-NODE-HOLDS-OBJECT.parameters"></a><h4>Parameters</h4>
593 <div class="informaltable"><table class="informaltable" width="100%" border="0">
595 <col width="150px" class="parameters_name">
596 <col class="parameters_description">
597 <col width="200px" class="parameters_annotations">
600 <td class="parameter_name"><p>node</p></td>
601 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
602 <td class="parameter_annotations"> </td>
606 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
609 <div class="refsect2">
610 <a name="JSON-NODE-HOLDS-ARRAY:CAPS"></a><h3>JSON_NODE_HOLDS_ARRAY()</h3>
611 <pre class="programlisting">#define JSON_NODE_HOLDS_ARRAY(node) (JSON_NODE_HOLDS ((node), JSON_NODE_ARRAY))
613 <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em>
614 holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-ARRAY:CAPS"><code class="literal">JSON_NODE_ARRAY</code></a></p>
615 <div class="refsect3">
616 <a name="JSON-NODE-HOLDS-ARRAY.parameters"></a><h4>Parameters</h4>
617 <div class="informaltable"><table class="informaltable" width="100%" border="0">
619 <col width="150px" class="parameters_name">
620 <col class="parameters_description">
621 <col width="200px" class="parameters_annotations">
624 <td class="parameter_name"><p>node</p></td>
625 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
626 <td class="parameter_annotations"> </td>
630 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
633 <div class="refsect2">
634 <a name="JSON-NODE-HOLDS-NULL:CAPS"></a><h3>JSON_NODE_HOLDS_NULL()</h3>
635 <pre class="programlisting">#define JSON_NODE_HOLDS_NULL(node) (JSON_NODE_HOLDS ((node), JSON_NODE_NULL))
637 <p>Evaluates to <code class="literal">TRUE</code> if <em class="parameter"><code>node</code></em>
638 holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a></p>
639 <div class="refsect3">
640 <a name="JSON-NODE-HOLDS-NULL.parameters"></a><h4>Parameters</h4>
641 <div class="informaltable"><table class="informaltable" width="100%" border="0">
643 <col width="150px" class="parameters_name">
644 <col class="parameters_description">
645 <col width="200px" class="parameters_annotations">
648 <td class="parameter_name"><p>node</p></td>
649 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
650 <td class="parameter_annotations"> </td>
654 <p class="since">Since: <a class="link" href="ix06.html#api-index-0.10">0.10</a></p>
657 <div class="refsect2">
658 <a name="json-node-alloc"></a><h3>json_node_alloc ()</h3>
659 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
660 json_node_alloc (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
661 <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
662 to initialize the returned value.</p>
663 <p><span class="annotation">[<acronym title="This symbol is a constructor, not a static method."><span class="acronym">constructor</span></acronym>]</span></p>
664 <div class="refsect3">
665 <a name="json-node-alloc.returns"></a><h4>Returns</h4>
666 <p> the newly allocated <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. Use
667 <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>
668 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
670 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
673 <div class="refsect2">
674 <a name="json-node-init"></a><h3>json_node_init ()</h3>
675 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
676 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>,
677 <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>
678 <p>Initializes a <em class="parameter"><code>node</code></em>
679 to a specific <em class="parameter"><code>type</code></em>
681 <p>If the node has already been initialized once, it will be reset to
682 the given type, and any data contained will be cleared.</p>
683 <div class="refsect3">
684 <a name="json-node-init.parameters"></a><h4>Parameters</h4>
685 <div class="informaltable"><table class="informaltable" width="100%" border="0">
687 <col width="150px" class="parameters_name">
688 <col class="parameters_description">
689 <col width="200px" class="parameters_annotations">
693 <td class="parameter_name"><p>node</p></td>
694 <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>
695 <td class="parameter_annotations"> </td>
698 <td class="parameter_name"><p>type</p></td>
699 <td class="parameter_description"><p>the type of JSON node to initialize <em class="parameter"><code>node</code></em>
701 <td class="parameter_annotations"> </td>
706 <div class="refsect3">
707 <a name="json-node-init.returns"></a><h4>Returns</h4>
708 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
709 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
711 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
714 <div class="refsect2">
715 <a name="json-node-init-int"></a><h3>json_node_init_int ()</h3>
716 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
717 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>,
718 <em class="parameter"><code><span class="type">gint64</span> value</code></em>);</pre>
719 <p>Initializes <em class="parameter"><code>node</code></em>
720 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>
722 <p>If the node has already been initialized once, it will be reset to
723 the given type, and any data contained will be cleared.</p>
724 <div class="refsect3">
725 <a name="json-node-init-int.parameters"></a><h4>Parameters</h4>
726 <div class="informaltable"><table class="informaltable" width="100%" border="0">
728 <col width="150px" class="parameters_name">
729 <col class="parameters_description">
730 <col width="200px" class="parameters_annotations">
734 <td class="parameter_name"><p>node</p></td>
735 <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>
736 <td class="parameter_annotations"> </td>
739 <td class="parameter_name"><p>value</p></td>
740 <td class="parameter_description"><p>an integer</p></td>
741 <td class="parameter_annotations"> </td>
746 <div class="refsect3">
747 <a name="json-node-init-int.returns"></a><h4>Returns</h4>
748 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
749 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
751 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
754 <div class="refsect2">
755 <a name="json-node-init-double"></a><h3>json_node_init_double ()</h3>
756 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
757 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>,
758 <em class="parameter"><code><span class="type">gdouble</span> value</code></em>);</pre>
759 <p>Initializes <em class="parameter"><code>node</code></em>
760 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>
762 <p>If the node has already been initialized once, it will be reset to
763 the given type, and any data contained will be cleared.</p>
764 <div class="refsect3">
765 <a name="json-node-init-double.parameters"></a><h4>Parameters</h4>
766 <div class="informaltable"><table class="informaltable" width="100%" border="0">
768 <col width="150px" class="parameters_name">
769 <col class="parameters_description">
770 <col width="200px" class="parameters_annotations">
774 <td class="parameter_name"><p>node</p></td>
775 <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>
776 <td class="parameter_annotations"> </td>
779 <td class="parameter_name"><p>value</p></td>
780 <td class="parameter_description"><p>a floating point value</p></td>
781 <td class="parameter_annotations"> </td>
786 <div class="refsect3">
787 <a name="json-node-init-double.returns"></a><h4>Returns</h4>
788 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
789 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
791 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
794 <div class="refsect2">
795 <a name="json-node-init-boolean"></a><h3>json_node_init_boolean ()</h3>
796 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
797 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>,
798 <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre>
799 <p>Initializes <em class="parameter"><code>node</code></em>
800 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>
802 <p>If the node has already been initialized once, it will be reset to
803 the given type, and any data contained will be cleared.</p>
804 <div class="refsect3">
805 <a name="json-node-init-boolean.parameters"></a><h4>Parameters</h4>
806 <div class="informaltable"><table class="informaltable" width="100%" border="0">
808 <col width="150px" class="parameters_name">
809 <col class="parameters_description">
810 <col width="200px" class="parameters_annotations">
814 <td class="parameter_name"><p>node</p></td>
815 <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>
816 <td class="parameter_annotations"> </td>
819 <td class="parameter_name"><p>value</p></td>
820 <td class="parameter_description"><p>a boolean value</p></td>
821 <td class="parameter_annotations"> </td>
826 <div class="refsect3">
827 <a name="json-node-init-boolean.returns"></a><h4>Returns</h4>
828 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
829 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
831 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
834 <div class="refsect2">
835 <a name="json-node-init-string"></a><h3>json_node_init_string ()</h3>
836 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
837 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>,
838 <em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
839 <p>Initializes <em class="parameter"><code>node</code></em>
840 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>
842 <p>If the node has already been initialized once, it will be reset to
843 the given type, and any data contained will be cleared.</p>
844 <div class="refsect3">
845 <a name="json-node-init-string.parameters"></a><h4>Parameters</h4>
846 <div class="informaltable"><table class="informaltable" width="100%" border="0">
848 <col width="150px" class="parameters_name">
849 <col class="parameters_description">
850 <col width="200px" class="parameters_annotations">
854 <td class="parameter_name"><p>node</p></td>
855 <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>
856 <td class="parameter_annotations"> </td>
859 <td class="parameter_name"><p>value</p></td>
860 <td class="parameter_description"><p> a string value. </p></td>
861 <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>
866 <div class="refsect3">
867 <a name="json-node-init-string.returns"></a><h4>Returns</h4>
868 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
869 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
871 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
874 <div class="refsect2">
875 <a name="json-node-init-null"></a><h3>json_node_init_null ()</h3>
876 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
877 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>
878 <p>Initializes <em class="parameter"><code>node</code></em>
879 to <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a>.</p>
880 <p>If the node has already been initialized once, it will be reset to
881 the given type, and any data contained will be cleared.</p>
882 <div class="refsect3">
883 <a name="json-node-init-null.parameters"></a><h4>Parameters</h4>
884 <div class="informaltable"><table class="informaltable" width="100%" border="0">
886 <col width="150px" class="parameters_name">
887 <col class="parameters_description">
888 <col width="200px" class="parameters_annotations">
891 <td class="parameter_name"><p>node</p></td>
892 <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>
893 <td class="parameter_annotations"> </td>
897 <div class="refsect3">
898 <a name="json-node-init-null.returns"></a><h4>Returns</h4>
899 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
900 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
902 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
905 <div class="refsect2">
906 <a name="json-node-init-object"></a><h3>json_node_init_object ()</h3>
907 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
908 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>,
909 <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *object</code></em>);</pre>
910 <p>Initializes <em class="parameter"><code>node</code></em>
911 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>
913 <p>This function will take a reference on <em class="parameter"><code>object</code></em>
915 <p>If the node has already been initialized once, it will be reset to
916 the given type, and any data contained will be cleared.</p>
917 <div class="refsect3">
918 <a name="json-node-init-object.parameters"></a><h4>Parameters</h4>
919 <div class="informaltable"><table class="informaltable" width="100%" border="0">
921 <col width="150px" class="parameters_name">
922 <col class="parameters_description">
923 <col width="200px" class="parameters_annotations">
927 <td class="parameter_name"><p>node</p></td>
928 <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>
929 <td class="parameter_annotations"> </td>
932 <td class="parameter_name"><p>object</p></td>
933 <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>
934 with, or <code class="literal">NULL</code>. </p></td>
935 <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>
940 <div class="refsect3">
941 <a name="json-node-init-object.returns"></a><h4>Returns</h4>
942 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
943 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
945 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
948 <div class="refsect2">
949 <a name="json-node-init-array"></a><h3>json_node_init_array ()</h3>
950 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
951 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>,
952 <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
953 <p>Initializes <em class="parameter"><code>node</code></em>
954 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>
956 <p>This function will take a reference on <em class="parameter"><code>array</code></em>
958 <p>If the node has already been initialized once, it will be reset to
959 the given type, and any data contained will be cleared.</p>
960 <div class="refsect3">
961 <a name="json-node-init-array.parameters"></a><h4>Parameters</h4>
962 <div class="informaltable"><table class="informaltable" width="100%" border="0">
964 <col width="150px" class="parameters_name">
965 <col class="parameters_description">
966 <col width="200px" class="parameters_annotations">
970 <td class="parameter_name"><p>node</p></td>
971 <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>
972 <td class="parameter_annotations"> </td>
975 <td class="parameter_name"><p>array</p></td>
976 <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>
977 with, or <code class="literal">NULL</code>. </p></td>
978 <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>
983 <div class="refsect3">
984 <a name="json-node-init-array.returns"></a><h4>Returns</h4>
985 <p> the initialized <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
986 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
988 <p class="since">Since: <a class="link" href="ix09.html#api-index-0.16">0.16</a></p>
991 <div class="refsect2">
992 <a name="json-node-new"></a><h3>json_node_new ()</h3>
993 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
994 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>
995 <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>
997 <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>,
998 and it's the equivalent of:</p>
999 <div class="informalexample">
1000 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
1003 <td class="listing_lines" align="right"><pre>1</pre></td>
1004 <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>
1011 <p><span class="annotation">[<acronym title="This symbol is a constructor, not a static method."><span class="acronym">constructor</span></acronym>]</span></p>
1012 <div class="refsect3">
1013 <a name="json-node-new.parameters"></a><h4>Parameters</h4>
1014 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1016 <col width="150px" class="parameters_name">
1017 <col class="parameters_description">
1018 <col width="200px" class="parameters_annotations">
1021 <td class="parameter_name"><p>type</p></td>
1022 <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>
1023 <td class="parameter_annotations"> </td>
1027 <div class="refsect3">
1028 <a name="json-node-new.returns"></a><h4>Returns</h4>
1029 <p> the newly created <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
1030 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
1034 <div class="refsect2">
1035 <a name="json-node-copy"></a><h3>json_node_copy ()</h3>
1036 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
1037 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>
1038 <p>Copies <em class="parameter"><code>node</code></em>
1039 . If the node contains complex data types, their reference
1040 counts are increased, regardless of whether the node is mutable or
1042 <p>The copy will be immutable if, and only if, <em class="parameter"><code>node</code></em>
1043 is immutable. However,
1044 there should be no need to copy an immutable node.</p>
1045 <div class="refsect3">
1046 <a name="json-node-copy.parameters"></a><h4>Parameters</h4>
1047 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1049 <col width="150px" class="parameters_name">
1050 <col class="parameters_description">
1051 <col width="200px" class="parameters_annotations">
1054 <td class="parameter_name"><p>node</p></td>
1055 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1056 <td class="parameter_annotations"> </td>
1060 <div class="refsect3">
1061 <a name="json-node-copy.returns"></a><h4>Returns</h4>
1062 <p> the copied <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p>
1063 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
1067 <div class="refsect2">
1068 <a name="json-node-free"></a><h3>json_node_free ()</h3>
1069 <pre class="programlisting"><span class="returnvalue">void</span>
1070 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>
1071 <p>Frees the resources allocated by <em class="parameter"><code>node</code></em>
1073 <div class="refsect3">
1074 <a name="json-node-free.parameters"></a><h4>Parameters</h4>
1075 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1077 <col width="150px" class="parameters_name">
1078 <col class="parameters_description">
1079 <col width="200px" class="parameters_annotations">
1082 <td class="parameter_name"><p>node</p></td>
1083 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1084 <td class="parameter_annotations"> </td>
1090 <div class="refsect2">
1091 <a name="json-node-ref"></a><h3>json_node_ref ()</h3>
1092 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
1093 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>
1094 <p>Increment the reference count of <em class="parameter"><code>node</code></em>
1096 <div class="refsect3">
1097 <a name="json-node-ref.parameters"></a><h4>Parameters</h4>
1098 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1100 <col width="150px" class="parameters_name">
1101 <col class="parameters_description">
1102 <col width="200px" class="parameters_annotations">
1105 <td class="parameter_name"><p>node</p></td>
1106 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1107 <td class="parameter_annotations"> </td>
1111 <div class="refsect3">
1112 <a name="json-node-ref.returns"></a><h4>Returns</h4>
1113 <p> a pointer to <em class="parameter"><code>node</code></em>
1115 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
1117 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
1120 <div class="refsect2">
1121 <a name="json-node-unref"></a><h3>json_node_unref ()</h3>
1122 <pre class="programlisting"><span class="returnvalue">void</span>
1123 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>
1124 <p>Decrement the reference count of <em class="parameter"><code>node</code></em>
1125 . If it reaches zero, the node is
1127 <div class="refsect3">
1128 <a name="json-node-unref.parameters"></a><h4>Parameters</h4>
1129 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1131 <col width="150px" class="parameters_name">
1132 <col class="parameters_description">
1133 <col width="200px" class="parameters_annotations">
1136 <td class="parameter_name"><p>node</p></td>
1137 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. </p></td>
1138 <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>
1142 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
1145 <div class="refsect2">
1146 <a name="json-node-is-immutable"></a><h3>json_node_is_immutable ()</h3>
1147 <pre class="programlisting"><span class="returnvalue">gboolean</span>
1148 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>
1149 <p>Check whether the given <em class="parameter"><code>node</code></em>
1150 has been marked as immutable by calling
1151 <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>
1152 <div class="refsect3">
1153 <a name="json-node-is-immutable.parameters"></a><h4>Parameters</h4>
1154 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1156 <col width="150px" class="parameters_name">
1157 <col class="parameters_description">
1158 <col width="200px" class="parameters_annotations">
1161 <td class="parameter_name"><p>node</p></td>
1162 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1163 <td class="parameter_annotations"> </td>
1167 <div class="refsect3">
1168 <a name="json-node-is-immutable.returns"></a><h4>Returns</h4>
1169 <p> <code class="literal">TRUE</code> if the <em class="parameter"><code>node</code></em>
1172 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
1175 <div class="refsect2">
1176 <a name="json-node-seal"></a><h3>json_node_seal ()</h3>
1177 <pre class="programlisting"><span class="returnvalue">void</span>
1178 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>
1179 <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
1180 sealed, the <em class="parameter"><code>node</code></em>
1181 must have a type and value set. The value will be
1182 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
1184 <p>If the <em class="parameter"><code>node</code></em>
1185 is already immutable, this is a no-op.</p>
1186 <div class="refsect3">
1187 <a name="json-node-seal.parameters"></a><h4>Parameters</h4>
1188 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1190 <col width="150px" class="parameters_name">
1191 <col class="parameters_description">
1192 <col width="200px" class="parameters_annotations">
1195 <td class="parameter_name"><p>node</p></td>
1196 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1197 <td class="parameter_annotations"> </td>
1201 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
1204 <div class="refsect2">
1205 <a name="json-node-hash"></a><h3>json_node_hash ()</h3>
1206 <pre class="programlisting"><span class="returnvalue">guint</span>
1207 json_node_hash (<em class="parameter"><code><span class="type">gconstpointer</span> key</code></em>);</pre>
1208 <p>Calculate a hash value for the given <em class="parameter"><code>key</code></em>
1209 (a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>).</p>
1210 <p>The hash is calculated over the node and its value, recursively. If the node
1211 is immutable, this is a fast operation; otherwise, it scales proportionally
1212 with the size of the node’s value (for example, with the number of members
1213 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>
1214 <div class="refsect3">
1215 <a name="json-node-hash.parameters"></a><h4>Parameters</h4>
1216 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1218 <col width="150px" class="parameters_name">
1219 <col class="parameters_description">
1220 <col width="200px" class="parameters_annotations">
1223 <td class="parameter_name"><p>key</p></td>
1224 <td class="parameter_description"><p> a JSON node to hash. </p></td>
1225 <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>
1229 <div class="refsect3">
1230 <a name="json-node-hash.returns"></a><h4>Returns</h4>
1231 <p> hash value for <em class="parameter"><code>key</code></em>
1234 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
1237 <div class="refsect2">
1238 <a name="json-node-equal"></a><h3>json_node_equal ()</h3>
1239 <pre class="programlisting"><span class="returnvalue">gboolean</span>
1240 json_node_equal (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>,
1241 <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre>
1242 <p>Check whether <em class="parameter"><code>a</code></em>
1243 and <em class="parameter"><code>b</code></em>
1244 are equal <a href="json-glib-JSON-Node.html#JsonNode-struct"><span class="type">JsonNodes</span></a>, meaning they have the same
1245 type and same values (checked recursively). Note that integer values are
1246 compared numerically, ignoring type, so a double value 4.0 is equal to the
1247 integer value 4.</p>
1248 <div class="refsect3">
1249 <a name="json-node-equal.parameters"></a><h4>Parameters</h4>
1250 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1252 <col width="150px" class="parameters_name">
1253 <col class="parameters_description">
1254 <col width="200px" class="parameters_annotations">
1258 <td class="parameter_name"><p>a</p></td>
1259 <td class="parameter_description"><p> a JSON node. </p></td>
1260 <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>
1263 <td class="parameter_name"><p>b</p></td>
1264 <td class="parameter_description"><p> another JSON node. </p></td>
1265 <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>
1270 <div class="refsect3">
1271 <a name="json-node-equal.returns"></a><h4>Returns</h4>
1272 <p> <code class="literal">TRUE</code> if <em class="parameter"><code>a</code></em>
1273 and <em class="parameter"><code>b</code></em>
1274 are equal; <code class="literal">FALSE</code> otherwise</p>
1276 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
1279 <div class="refsect2">
1280 <a name="json-node-set-array"></a><h3>json_node_set_array ()</h3>
1281 <pre class="programlisting"><span class="returnvalue">void</span>
1282 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>,
1283 <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
1284 <p>Sets <em class="parameter"><code>array</code></em>
1285 inside <em class="parameter"><code>node</code></em>
1286 and increases the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> reference count.</p>
1287 <p>It is an error to call this on an immutable node.</p>
1288 <div class="refsect3">
1289 <a name="json-node-set-array.parameters"></a><h4>Parameters</h4>
1290 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1292 <col width="150px" class="parameters_name">
1293 <col class="parameters_description">
1294 <col width="200px" class="parameters_annotations">
1298 <td class="parameter_name"><p>node</p></td>
1299 <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>
1300 <td class="parameter_annotations"> </td>
1303 <td class="parameter_name"><p>array</p></td>
1304 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p></td>
1305 <td class="parameter_annotations"> </td>
1312 <div class="refsect2">
1313 <a name="json-node-take-array"></a><h3>json_node_take_array ()</h3>
1314 <pre class="programlisting"><span class="returnvalue">void</span>
1315 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>,
1316 <em class="parameter"><code><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> *array</code></em>);</pre>
1317 <p>Sets <em class="parameter"><code>array</code></em>
1318 into <em class="parameter"><code>node</code></em>
1319 without increasing the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> reference count.</p>
1320 <p>It is an error to call this on an immutable node.</p>
1321 <div class="refsect3">
1322 <a name="json-node-take-array.parameters"></a><h4>Parameters</h4>
1323 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1325 <col width="150px" class="parameters_name">
1326 <col class="parameters_description">
1327 <col width="200px" class="parameters_annotations">
1331 <td class="parameter_name"><p>node</p></td>
1332 <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>
1333 <td class="parameter_annotations"> </td>
1336 <td class="parameter_name"><p>array</p></td>
1337 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p></td>
1338 <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>
1345 <div class="refsect2">
1346 <a name="json-node-get-array"></a><h3>json_node_get_array ()</h3>
1347 <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
1348 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>
1349 <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>. If the node does not
1350 hold an array value, <code class="literal">NULL</code> is returned.</p>
1351 <div class="refsect3">
1352 <a name="json-node-get-array.parameters"></a><h4>Parameters</h4>
1353 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1355 <col width="150px" class="parameters_name">
1356 <col class="parameters_description">
1357 <col width="200px" class="parameters_annotations">
1360 <td class="parameter_name"><p>node</p></td>
1361 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1362 <td class="parameter_annotations"> </td>
1366 <div class="refsect3">
1367 <a name="json-node-get-array.returns"></a><h4>Returns</h4>
1368 <p> the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a>. </p>
1369 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<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></p>
1373 <div class="refsect2">
1374 <a name="json-node-dup-array"></a><h3>json_node_dup_array ()</h3>
1375 <pre class="programlisting"><a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="returnvalue">JsonArray</span></a> *
1376 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>
1377 <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
1378 with its reference count increased by one. If the node does not hold an
1379 array value, <code class="literal">NULL</code> is returned.</p>
1380 <div class="refsect3">
1381 <a name="json-node-dup-array.parameters"></a><h4>Parameters</h4>
1382 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1384 <col width="150px" class="parameters_name">
1385 <col class="parameters_description">
1386 <col width="200px" class="parameters_annotations">
1389 <td class="parameter_name"><p>node</p></td>
1390 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1391 <td class="parameter_annotations"> </td>
1395 <div class="refsect3">
1396 <a name="json-node-dup-array.returns"></a><h4>Returns</h4>
1397 <p> the <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a> with its reference
1398 count increased. </p>
1399 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<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></p>
1403 <div class="refsect2">
1404 <a name="json-node-set-object"></a><h3>json_node_set_object ()</h3>
1405 <pre class="programlisting"><span class="returnvalue">void</span>
1406 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>,
1407 <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *object</code></em>);</pre>
1408 <p>Sets <em class="parameter"><code>objects</code></em>
1409 inside <em class="parameter"><code>node</code></em>
1410 . The reference count of <em class="parameter"><code>object</code></em>
1412 <p>If <em class="parameter"><code>object</code></em>
1413 is <code class="literal">NULL</code>, the node’s existing object is cleared.</p>
1414 <p>It is an error to call this on an immutable node.</p>
1415 <div class="refsect3">
1416 <a name="json-node-set-object.parameters"></a><h4>Parameters</h4>
1417 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1419 <col width="150px" class="parameters_name">
1420 <col class="parameters_description">
1421 <col width="200px" class="parameters_annotations">
1425 <td class="parameter_name"><p>node</p></td>
1426 <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>
1427 <td class="parameter_annotations"> </td>
1430 <td class="parameter_name"><p>object</p></td>
1431 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p></td>
1432 <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>
1439 <div class="refsect2">
1440 <a name="json-node-take-object"></a><h3>json_node_take_object ()</h3>
1441 <pre class="programlisting"><span class="returnvalue">void</span>
1442 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>,
1443 <em class="parameter"><code><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a> *object</code></em>);</pre>
1444 <p>Sets <em class="parameter"><code>object</code></em>
1445 inside <em class="parameter"><code>node</code></em>
1446 . The reference count of <em class="parameter"><code>object</code></em>
1447 is not increased.</p>
1448 <p>It is an error to call this on an immutable node.</p>
1449 <div class="refsect3">
1450 <a name="json-node-take-object.parameters"></a><h4>Parameters</h4>
1451 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1453 <col width="150px" class="parameters_name">
1454 <col class="parameters_description">
1455 <col width="200px" class="parameters_annotations">
1459 <td class="parameter_name"><p>node</p></td>
1460 <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>
1461 <td class="parameter_annotations"> </td>
1464 <td class="parameter_name"><p>object</p></td>
1465 <td class="parameter_description"><p> a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p></td>
1466 <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>
1473 <div class="refsect2">
1474 <a name="json-node-get-object"></a><h3>json_node_get_object ()</h3>
1475 <pre class="programlisting"><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> *
1476 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>
1477 <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>. If the node does not
1478 hold an object value, <code class="literal">NULL</code> is returned.</p>
1479 <div class="refsect3">
1480 <a name="json-node-get-object.parameters"></a><h4>Parameters</h4>
1481 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1483 <col width="150px" class="parameters_name">
1484 <col class="parameters_description">
1485 <col width="200px" class="parameters_annotations">
1488 <td class="parameter_name"><p>node</p></td>
1489 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1490 <td class="parameter_annotations"> </td>
1494 <div class="refsect3">
1495 <a name="json-node-get-object.returns"></a><h4>Returns</h4>
1496 <p> the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p>
1497 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<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></p>
1501 <div class="refsect2">
1502 <a name="json-node-dup-object"></a><h3>json_node_dup_object ()</h3>
1503 <pre class="programlisting"><a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="returnvalue">JsonObject</span></a> *
1504 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>
1505 <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>
1506 . The reference count of
1507 the returned object is increased. If the node does not hold an object value,
1508 <code class="literal">NULL</code> is returned.</p>
1509 <div class="refsect3">
1510 <a name="json-node-dup-object.parameters"></a><h4>Parameters</h4>
1511 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1513 <col width="150px" class="parameters_name">
1514 <col class="parameters_description">
1515 <col width="200px" class="parameters_annotations">
1518 <td class="parameter_name"><p>node</p></td>
1519 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1520 <td class="parameter_annotations"> </td>
1524 <div class="refsect3">
1525 <a name="json-node-dup-object.returns"></a><h4>Returns</h4>
1526 <p> the <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a>. </p>
1527 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<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></p>
1531 <div class="refsect2">
1532 <a name="json-node-set-value"></a><h3>json_node_set_value ()</h3>
1533 <pre class="programlisting"><span class="returnvalue">void</span>
1534 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>,
1535 <em class="parameter"><code>const <span class="type">GValue</span> *value</code></em>);</pre>
1536 <p>Sets <em class="parameter"><code>value</code></em>
1537 inside <em class="parameter"><code>node</code></em>
1538 . 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>
1539 <p>It is an error to call this on an immutable node.</p>
1540 <div class="refsect3">
1541 <a name="json-node-set-value.parameters"></a><h4>Parameters</h4>
1542 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1544 <col width="150px" class="parameters_name">
1545 <col class="parameters_description">
1546 <col width="200px" class="parameters_annotations">
1550 <td class="parameter_name"><p>node</p></td>
1551 <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>
1552 <td class="parameter_annotations"> </td>
1555 <td class="parameter_name"><p>value</p></td>
1556 <td class="parameter_description"><p>the <span class="type">GValue</span> to set</p></td>
1557 <td class="parameter_annotations"> </td>
1564 <div class="refsect2">
1565 <a name="json-node-get-value"></a><h3>json_node_get_value ()</h3>
1566 <pre class="programlisting"><span class="returnvalue">void</span>
1567 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>,
1568 <em class="parameter"><code><span class="type">GValue</span> *value</code></em>);</pre>
1569 <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>
1571 using it, call <code class="function">g_value_unset()</code> on the <span class="type">GValue</span>. If the node does not hold a
1572 scalar value, <em class="parameter"><code>value</code></em>
1573 is not modified.</p>
1574 <div class="refsect3">
1575 <a name="json-node-get-value.parameters"></a><h4>Parameters</h4>
1576 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1578 <col width="150px" class="parameters_name">
1579 <col class="parameters_description">
1580 <col width="200px" class="parameters_annotations">
1584 <td class="parameter_name"><p>node</p></td>
1585 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1586 <td class="parameter_annotations"> </td>
1589 <td class="parameter_name"><p>value</p></td>
1590 <td class="parameter_description"><p> return location for an uninitialized value. </p></td>
1591 <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>
1598 <div class="refsect2">
1599 <a name="json-node-set-boolean"></a><h3>json_node_set_boolean ()</h3>
1600 <pre class="programlisting"><span class="returnvalue">void</span>
1601 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>,
1602 <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre>
1603 <p>Sets <em class="parameter"><code>value</code></em>
1604 as the boolean content of the <em class="parameter"><code>node</code></em>
1605 , replacing any existing
1607 <p>It is an error to call this on an immutable node.</p>
1608 <div class="refsect3">
1609 <a name="json-node-set-boolean.parameters"></a><h4>Parameters</h4>
1610 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1612 <col width="150px" class="parameters_name">
1613 <col class="parameters_description">
1614 <col width="200px" class="parameters_annotations">
1618 <td class="parameter_name"><p>node</p></td>
1619 <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>
1620 <td class="parameter_annotations"> </td>
1623 <td class="parameter_name"><p>value</p></td>
1624 <td class="parameter_description"><p>a boolean value</p></td>
1625 <td class="parameter_annotations"> </td>
1632 <div class="refsect2">
1633 <a name="json-node-get-boolean"></a><h3>json_node_get_boolean ()</h3>
1634 <pre class="programlisting"><span class="returnvalue">gboolean</span>
1635 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>
1636 <p>Gets the boolean value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. If the node holds an
1637 integer or double value which is zero, <code class="literal">FALSE</code> is returned; otherwise <code class="literal">TRUE</code>
1638 is returned. If the node holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a> value or a value of another
1639 non-boolean type, <code class="literal">FALSE</code> is returned.</p>
1640 <div class="refsect3">
1641 <a name="json-node-get-boolean.parameters"></a><h4>Parameters</h4>
1642 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1644 <col width="150px" class="parameters_name">
1645 <col class="parameters_description">
1646 <col width="200px" class="parameters_annotations">
1649 <td class="parameter_name"><p>node</p></td>
1650 <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>
1651 <td class="parameter_annotations"> </td>
1655 <div class="refsect3">
1656 <a name="json-node-get-boolean.returns"></a><h4>Returns</h4>
1657 <p> a boolean value.</p>
1661 <div class="refsect2">
1662 <a name="json-node-set-double"></a><h3>json_node_set_double ()</h3>
1663 <pre class="programlisting"><span class="returnvalue">void</span>
1664 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>,
1665 <em class="parameter"><code><span class="type">gdouble</span> value</code></em>);</pre>
1666 <p>Sets <em class="parameter"><code>value</code></em>
1667 as the double content of the <em class="parameter"><code>node</code></em>
1668 , replacing any existing
1670 <p>It is an error to call this on an immutable node.</p>
1671 <div class="refsect3">
1672 <a name="json-node-set-double.parameters"></a><h4>Parameters</h4>
1673 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1675 <col width="150px" class="parameters_name">
1676 <col class="parameters_description">
1677 <col width="200px" class="parameters_annotations">
1681 <td class="parameter_name"><p>node</p></td>
1682 <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>
1683 <td class="parameter_annotations"> </td>
1686 <td class="parameter_name"><p>value</p></td>
1687 <td class="parameter_description"><p>a double value</p></td>
1688 <td class="parameter_annotations"> </td>
1695 <div class="refsect2">
1696 <a name="json-node-get-double"></a><h3>json_node_get_double ()</h3>
1697 <pre class="programlisting"><span class="returnvalue">gdouble</span>
1698 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>
1699 <p>Gets the double value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. If the node holds an integer
1700 value, it is returned as a double. If the node holds a <code class="literal">FALSE</code> boolean value,
1701 <code class="literal">0.0</code> is returned; otherwise a non-zero double is returned. If the node holds
1702 a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a> value or a value of another non-double type, <code class="literal">0.0</code> is
1704 <div class="refsect3">
1705 <a name="json-node-get-double.parameters"></a><h4>Parameters</h4>
1706 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1708 <col width="150px" class="parameters_name">
1709 <col class="parameters_description">
1710 <col width="200px" class="parameters_annotations">
1713 <td class="parameter_name"><p>node</p></td>
1714 <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>
1715 <td class="parameter_annotations"> </td>
1719 <div class="refsect3">
1720 <a name="json-node-get-double.returns"></a><h4>Returns</h4>
1721 <p> a double value.</p>
1725 <div class="refsect2">
1726 <a name="json-node-set-int"></a><h3>json_node_set_int ()</h3>
1727 <pre class="programlisting"><span class="returnvalue">void</span>
1728 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>,
1729 <em class="parameter"><code><span class="type">gint64</span> value</code></em>);</pre>
1730 <p>Sets <em class="parameter"><code>value</code></em>
1731 as the integer content of the <em class="parameter"><code>node</code></em>
1732 , replacing any existing
1734 <p>It is an error to call this on an immutable node.</p>
1735 <div class="refsect3">
1736 <a name="json-node-set-int.parameters"></a><h4>Parameters</h4>
1737 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1739 <col width="150px" class="parameters_name">
1740 <col class="parameters_description">
1741 <col width="200px" class="parameters_annotations">
1745 <td class="parameter_name"><p>node</p></td>
1746 <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>
1747 <td class="parameter_annotations"> </td>
1750 <td class="parameter_name"><p>value</p></td>
1751 <td class="parameter_description"><p>an integer value</p></td>
1752 <td class="parameter_annotations"> </td>
1759 <div class="refsect2">
1760 <a name="json-node-get-int"></a><h3>json_node_get_int ()</h3>
1761 <pre class="programlisting"><span class="returnvalue">gint64</span>
1762 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>
1763 <p>Gets the integer value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. If the node holds a double
1764 value, its integer component is returned. If the node holds a <code class="literal">FALSE</code> boolean
1765 value, <code class="literal">0</code> is returned; otherwise a non-zero integer is returned. If the
1766 node holds a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a> value or a value of another non-integer type,
1767 <code class="literal">0</code> is returned.</p>
1768 <div class="refsect3">
1769 <a name="json-node-get-int.parameters"></a><h4>Parameters</h4>
1770 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1772 <col width="150px" class="parameters_name">
1773 <col class="parameters_description">
1774 <col width="200px" class="parameters_annotations">
1777 <td class="parameter_name"><p>node</p></td>
1778 <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>
1779 <td class="parameter_annotations"> </td>
1783 <div class="refsect3">
1784 <a name="json-node-get-int.returns"></a><h4>Returns</h4>
1785 <p> an integer value.</p>
1789 <div class="refsect2">
1790 <a name="json-node-set-string"></a><h3>json_node_set_string ()</h3>
1791 <pre class="programlisting"><span class="returnvalue">void</span>
1792 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>,
1793 <em class="parameter"><code>const <span class="type">gchar</span> *value</code></em>);</pre>
1794 <p>Sets <em class="parameter"><code>value</code></em>
1795 as the string content of the <em class="parameter"><code>node</code></em>
1796 , replacing any existing
1798 <p>It is an error to call this on an immutable node.</p>
1799 <div class="refsect3">
1800 <a name="json-node-set-string.parameters"></a><h4>Parameters</h4>
1801 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1803 <col width="150px" class="parameters_name">
1804 <col class="parameters_description">
1805 <col width="200px" class="parameters_annotations">
1809 <td class="parameter_name"><p>node</p></td>
1810 <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>
1811 <td class="parameter_annotations"> </td>
1814 <td class="parameter_name"><p>value</p></td>
1815 <td class="parameter_description"><p>a string value</p></td>
1816 <td class="parameter_annotations"> </td>
1823 <div class="refsect2">
1824 <a name="json-node-get-string"></a><h3>json_node_get_string ()</h3>
1825 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
1826 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>
1827 <p>Gets the string value stored inside a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>. If the node does not hold a
1828 string value, <code class="literal">NULL</code> is returned.</p>
1829 <div class="refsect3">
1830 <a name="json-node-get-string.parameters"></a><h4>Parameters</h4>
1831 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1833 <col width="150px" class="parameters_name">
1834 <col class="parameters_description">
1835 <col width="200px" class="parameters_annotations">
1838 <td class="parameter_name"><p>node</p></td>
1839 <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>
1840 <td class="parameter_annotations"> </td>
1844 <div class="refsect3">
1845 <a name="json-node-get-string.returns"></a><h4>Returns</h4>
1846 <p> a string value. </p>
1847 <p><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></p>
1851 <div class="refsect2">
1852 <a name="json-node-dup-string"></a><h3>json_node_dup_string ()</h3>
1853 <pre class="programlisting"><span class="returnvalue">gchar</span> *
1854 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>
1855 <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>. If the node does
1856 not hold a string value, <code class="literal">NULL</code> is returned.</p>
1857 <div class="refsect3">
1858 <a name="json-node-dup-string.parameters"></a><h4>Parameters</h4>
1859 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1861 <col width="150px" class="parameters_name">
1862 <col class="parameters_description">
1863 <col width="200px" class="parameters_annotations">
1866 <td class="parameter_name"><p>node</p></td>
1867 <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>
1868 <td class="parameter_annotations"> </td>
1872 <div class="refsect3">
1873 <a name="json-node-dup-string.returns"></a><h4>Returns</h4>
1874 <p> a newly allocated string
1875 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
1876 allocated resources. </p>
1877 <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<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></p>
1881 <div class="refsect2">
1882 <a name="json-node-set-parent"></a><h3>json_node_set_parent ()</h3>
1883 <pre class="programlisting"><span class="returnvalue">void</span>
1884 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>,
1885 <em class="parameter"><code><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *parent</code></em>);</pre>
1886 <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>
1888 <p>It is an error to call this with an immutable <em class="parameter"><code>parent</code></em>
1889 . <em class="parameter"><code>node</code></em>
1892 <div class="refsect3">
1893 <a name="json-node-set-parent.parameters"></a><h4>Parameters</h4>
1894 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1896 <col width="150px" class="parameters_name">
1897 <col class="parameters_description">
1898 <col width="200px" class="parameters_annotations">
1902 <td class="parameter_name"><p>node</p></td>
1903 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1904 <td class="parameter_annotations"> </td>
1907 <td class="parameter_name"><p>parent</p></td>
1908 <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>
1910 <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>
1915 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
1918 <div class="refsect2">
1919 <a name="json-node-get-parent"></a><h3>json_node_get_parent ()</h3>
1920 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="returnvalue">JsonNode</span></a> *
1921 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>
1922 <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>
1924 <div class="refsect3">
1925 <a name="json-node-get-parent.parameters"></a><h4>Parameters</h4>
1926 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1928 <col width="150px" class="parameters_name">
1929 <col class="parameters_description">
1930 <col width="200px" class="parameters_annotations">
1933 <td class="parameter_name"><p>node</p></td>
1934 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1935 <td class="parameter_annotations"> </td>
1939 <div class="refsect3">
1940 <a name="json-node-get-parent.returns"></a><h4>Returns</h4>
1941 <p> the parent node, or <code class="literal">NULL</code> if <em class="parameter"><code>node</code></em>
1942 is the root node. </p>
1943 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<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></p>
1947 <div class="refsect2">
1948 <a name="json-node-type-name"></a><h3>json_node_type_name ()</h3>
1949 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
1950 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>
1951 <p>Retrieves the user readable name of the data type contained by <em class="parameter"><code>node</code></em>
1953 <div class="refsect3">
1954 <a name="json-node-type-name.parameters"></a><h4>Parameters</h4>
1955 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1957 <col width="150px" class="parameters_name">
1958 <col class="parameters_description">
1959 <col width="200px" class="parameters_annotations">
1962 <td class="parameter_name"><p>node</p></td>
1963 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1964 <td class="parameter_annotations"> </td>
1968 <div class="refsect3">
1969 <a name="json-node-type-name.returns"></a><h4>Returns</h4>
1970 <p> a string containing the name of the type. The returned string
1971 is owned by the node and should never be modified or freed</p>
1975 <div class="refsect2">
1976 <a name="json-node-get-value-type"></a><h3>json_node_get_value_type ()</h3>
1977 <pre class="programlisting"><span class="returnvalue">GType</span>
1978 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>
1979 <p>Returns the <span class="type">GType</span> of the payload of the node.</p>
1980 <div class="refsect3">
1981 <a name="json-node-get-value-type.parameters"></a><h4>Parameters</h4>
1982 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1984 <col width="150px" class="parameters_name">
1985 <col class="parameters_description">
1986 <col width="200px" class="parameters_annotations">
1989 <td class="parameter_name"><p>node</p></td>
1990 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
1991 <td class="parameter_annotations"> </td>
1995 <div class="refsect3">
1996 <a name="json-node-get-value-type.returns"></a><h4>Returns</h4>
1997 <p> a <span class="type">GType</span> for the payload.</p>
1999 <p class="since">Since: <a class="link" href="ix03.html#api-index-0.4">0.4</a></p>
2002 <div class="refsect2">
2003 <a name="json-node-get-node-type"></a><h3>json_node_get_node_type ()</h3>
2004 <pre class="programlisting"><a class="link" href="json-glib-JSON-Node.html#JsonNodeType" title="enum JsonNodeType"><span class="returnvalue">JsonNodeType</span></a>
2005 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>
2006 <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>
2008 <div class="refsect3">
2009 <a name="json-node-get-node-type.parameters"></a><h4>Parameters</h4>
2010 <div class="informaltable"><table class="informaltable" width="100%" border="0">
2012 <col width="150px" class="parameters_name">
2013 <col class="parameters_description">
2014 <col width="200px" class="parameters_annotations">
2017 <td class="parameter_name"><p>node</p></td>
2018 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
2019 <td class="parameter_annotations"> </td>
2023 <div class="refsect3">
2024 <a name="json-node-get-node-type.returns"></a><h4>Returns</h4>
2025 <p> the type of the node</p>
2027 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
2030 <div class="refsect2">
2031 <a name="json-node-is-null"></a><h3>json_node_is_null ()</h3>
2032 <pre class="programlisting"><span class="returnvalue">gboolean</span>
2033 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>
2034 <p>Checks whether <em class="parameter"><code>node</code></em>
2035 is a <a class="link" href="json-glib-JSON-Node.html#JSON-NODE-NULL:CAPS"><code class="literal">JSON_NODE_NULL</code></a>.</p>
2036 <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
2037 <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>
2038 <div class="refsect3">
2039 <a name="json-node-is-null.parameters"></a><h4>Parameters</h4>
2040 <div class="informaltable"><table class="informaltable" width="100%" border="0">
2042 <col width="150px" class="parameters_name">
2043 <col class="parameters_description">
2044 <col width="200px" class="parameters_annotations">
2047 <td class="parameter_name"><p>node</p></td>
2048 <td class="parameter_description"><p>a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a></p></td>
2049 <td class="parameter_annotations"> </td>
2053 <div class="refsect3">
2054 <a name="json-node-is-null.returns"></a><h4>Returns</h4>
2055 <p> <code class="literal">TRUE</code> if the node is null</p>
2057 <p class="since">Since: <a class="link" href="ix05.html#api-index-0.8">0.8</a></p>
2060 <div class="refsect2">
2061 <a name="json-string-hash"></a><h3>json_string_hash ()</h3>
2062 <pre class="programlisting"><span class="returnvalue">guint</span>
2063 json_string_hash (<em class="parameter"><code><span class="type">gconstpointer</span> key</code></em>);</pre>
2064 <p>Calculate a hash value for the given <em class="parameter"><code>key</code></em>
2065 (a UTF-8 JSON string).</p>
2066 <p>Note: Member names are compared byte-wise, without applying any Unicode
2067 decomposition or normalisation. This is not explicitly mentioned in the JSON
2068 standard (ECMA-404), but is assumed.</p>
2069 <div class="refsect3">
2070 <a name="json-string-hash.parameters"></a><h4>Parameters</h4>
2071 <div class="informaltable"><table class="informaltable" width="100%" border="0">
2073 <col width="150px" class="parameters_name">
2074 <col class="parameters_description">
2075 <col width="200px" class="parameters_annotations">
2078 <td class="parameter_name"><p>key</p></td>
2079 <td class="parameter_description"><p> a JSON string to hash. </p></td>
2080 <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>
2084 <div class="refsect3">
2085 <a name="json-string-hash.returns"></a><h4>Returns</h4>
2086 <p> hash value for <em class="parameter"><code>key</code></em>
2089 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
2092 <div class="refsect2">
2093 <a name="json-string-equal"></a><h3>json_string_equal ()</h3>
2094 <pre class="programlisting"><span class="returnvalue">gboolean</span>
2095 json_string_equal (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>,
2096 <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre>
2097 <p>Check whether <em class="parameter"><code>a</code></em>
2098 and <em class="parameter"><code>b</code></em>
2099 are equal UTF-8 JSON strings.</p>
2100 <div class="refsect3">
2101 <a name="json-string-equal.parameters"></a><h4>Parameters</h4>
2102 <div class="informaltable"><table class="informaltable" width="100%" border="0">
2104 <col width="150px" class="parameters_name">
2105 <col class="parameters_description">
2106 <col width="200px" class="parameters_annotations">
2110 <td class="parameter_name"><p>a</p></td>
2111 <td class="parameter_description"><p> a JSON string. </p></td>
2112 <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>
2115 <td class="parameter_name"><p>b</p></td>
2116 <td class="parameter_description"><p> another JSON string. </p></td>
2117 <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>
2122 <div class="refsect3">
2123 <a name="json-string-equal.returns"></a><h4>Returns</h4>
2124 <p> <code class="literal">TRUE</code> if <em class="parameter"><code>a</code></em>
2125 and <em class="parameter"><code>b</code></em>
2126 are equal; <code class="literal">FALSE</code> otherwise</p>
2128 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
2131 <div class="refsect2">
2132 <a name="json-string-compare"></a><h3>json_string_compare ()</h3>
2133 <pre class="programlisting"><span class="returnvalue">gint</span>
2134 json_string_compare (<em class="parameter"><code><span class="type">gconstpointer</span> a</code></em>,
2135 <em class="parameter"><code><span class="type">gconstpointer</span> b</code></em>);</pre>
2136 <p>Check whether <em class="parameter"><code>a</code></em>
2137 and <em class="parameter"><code>b</code></em>
2138 are equal UTF-8 JSON strings and return an ordering
2139 over them in <code class="function">strcmp()</code> style.</p>
2140 <div class="refsect3">
2141 <a name="json-string-compare.parameters"></a><h4>Parameters</h4>
2142 <div class="informaltable"><table class="informaltable" width="100%" border="0">
2144 <col width="150px" class="parameters_name">
2145 <col class="parameters_description">
2146 <col width="200px" class="parameters_annotations">
2150 <td class="parameter_name"><p>a</p></td>
2151 <td class="parameter_description"><p> a JSON string. </p></td>
2152 <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>
2155 <td class="parameter_name"><p>b</p></td>
2156 <td class="parameter_description"><p> another JSON string. </p></td>
2157 <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>
2162 <div class="refsect3">
2163 <a name="json-string-compare.returns"></a><h4>Returns</h4>
2164 <p> an integer less than zero if <em class="parameter"><code>a</code></em>
2165 < <em class="parameter"><code>b</code></em>
2166 , equal to zero if <em class="parameter"><code>a</code></em>
2167 == <em class="parameter"><code>b</code></em>
2169 greater than zero if <em class="parameter"><code>a</code></em>
2170 > <em class="parameter"><code>b</code></em>
2173 <p class="since">Since: <a class="link" href="ix11.html#api-index-1.2">1.2</a></p>
2176 <div class="refsect1">
2177 <a name="json-glib-JSON-Node.other_details"></a><h2>Types and Values</h2>
2178 <div class="refsect2">
2179 <a name="JsonNodeType"></a><h3>enum JsonNodeType</h3>
2180 <p>Indicates the content of a <a class="link" href="json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a>.</p>
2181 <div class="refsect3">
2182 <a name="JsonNodeType.members"></a><h4>Members</h4>
2183 <div class="informaltable"><table class="informaltable" width="100%" border="0">
2185 <col width="300px" class="enum_members_name">
2186 <col class="enum_members_description">
2187 <col width="200px" class="enum_members_annotations">
2191 <td class="enum_member_name"><p><a name="JSON-NODE-OBJECT:CAPS"></a>JSON_NODE_OBJECT</p></td>
2192 <td class="enum_member_description">
2193 <p>The node contains a <a class="link" href="json-glib-JSON-Object.html#JsonObject"><span class="type">JsonObject</span></a></p>
2195 <td class="enum_member_annotations"> </td>
2198 <td class="enum_member_name"><p><a name="JSON-NODE-ARRAY:CAPS"></a>JSON_NODE_ARRAY</p></td>
2199 <td class="enum_member_description">
2200 <p>The node contains a <a class="link" href="json-glib-JSON-Array.html#JsonArray"><span class="type">JsonArray</span></a></p>
2202 <td class="enum_member_annotations"> </td>
2205 <td class="enum_member_name"><p><a name="JSON-NODE-VALUE:CAPS"></a>JSON_NODE_VALUE</p></td>
2206 <td class="enum_member_description">
2207 <p>The node contains a fundamental type</p>
2209 <td class="enum_member_annotations"> </td>
2212 <td class="enum_member_name"><p><a name="JSON-NODE-NULL:CAPS"></a>JSON_NODE_NULL</p></td>
2213 <td class="enum_member_description">
2214 <p>Special type, for nodes containing null</p>
2216 <td class="enum_member_annotations"> </td>
2223 <div class="refsect2">
2224 <a name="JsonNode-struct"></a><h3>JsonNode</h3>
2225 <pre class="programlisting">typedef struct _JsonNode JsonNode;</pre>
2226 <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>
2227 structure are private and should only be accessed via the provided
2228 functions and never directly.</p>
2232 <div class="footer">
2233 <hr>Generated by GTK-Doc V1.25.1</div>