<p>Retrieves a JSON sub-object from inside another JSON object using the JSON pointer notation as defined in RFC 6901 <ahref="https://tools.ietf.org/html/rfc6901">https://tools.ietf.org/html/rfc6901</a></p>
<p>The returned JSON sub-object is equivalent to parsing manually the 'obj' JSON tree ; i.e. it's not a new object that is created, but rather a pointer inside the JSON tree.</p>
<p>Internally, this is equivalent to doing a series of '<aclass="el"href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a>' and '<aclass="el"href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx()</a>' along the given 'path'.</p>
<p>Note that the 'path' string supports 'printf()' type arguments, so, whatever is added after the 'res' param will be treated as an argument for 'path' Example: json_pointer_get(obj, "/foo/%d/%s", &res, 0, bar) This means, that you need to escape '' with '%' (just like in printf())</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">obj</td><td>the <aclass="el"href="structjson__object.html">json_object</a> instance/tree from where to retrieve sub-objects </td></tr>
<tr><tdclass="paramname">path</td><td>a (RFC6901) string notation for the sub-object to retrieve </td></tr>
<tr><tdclass="paramname">res</td><td>a pointer where to store a reference to the <aclass="el"href="structjson__object.html">json_object</a> associated with the given path</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>negative if an error (or not found), or 0 if succeeded </dd></dl>
<p>This is a variant of '<aclass="el"href="json__pointer_8h.html#abf47f34be3386a5eb510604f05ae9491">json_pointer_get()</a>' that supports printf() style arguments.</p>
<p>Example: json_pointer_getf(obj, res, "/foo/%d/%s", 0, bak) This also means that you need to escape '' with '%' (just like in printf())</p>
<p>Please take into consideration all recommended 'printf()' format security aspects when using this function.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">obj</td><td>the <aclass="el"href="structjson__object.html">json_object</a> instance/tree to which to add a sub-object </td></tr>
<tr><tdclass="paramname">res</td><td>a pointer where to store a reference to the <aclass="el"href="structjson__object.html">json_object</a> associated with the given path </td></tr>
<tr><tdclass="paramname">path_fmt</td><td>a printf() style format for the path</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>negative if an error (or not found), or 0 if succeeded </dd></dl>
<p>Sets JSON object 'value' in the 'obj' tree at the location specified by the 'path'. 'path' is JSON pointer notation as defined in RFC 6901 <ahref="https://tools.ietf.org/html/rfc6901">https://tools.ietf.org/html/rfc6901</a></p>
<p>Note that 'obj' is a double pointer, mostly for the "" (empty string) case, where the entire JSON object would be replaced by 'value'. In the case of the "" path, the object at '*obj' will have it's refcount decremented with '<aclass="el"href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>' and the 'value' object will be assigned to it.</p>
<p>For other cases (JSON sub-objects) ownership of 'value' will be transferred into '*obj' via '<aclass="el"href="json__object_8h.html#a27bd808a022251059a43f1f6370441cd">json_object_object_add()</a>' & '<aclass="el"href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object_array_put_idx()</a>', so the only time the refcount should be decremented for 'value' is when the return value of '<aclass="el"href="json__pointer_8h.html#ab06a9fd172593748b2dc8d3a11c74fa0">json_pointer_set()</a>' is negative (meaning the 'value' object did not get set into '*obj').</p>
<p>That also implies that '<aclass="el"href="json__pointer_8h.html#ab06a9fd172593748b2dc8d3a11c74fa0">json_pointer_set()</a>' does not do any refcount incrementing. (Just that single decrement that was mentioned above).</p>
<p>Note that the 'path' string supports 'printf()' type arguments, so, whatever is added after the 'value' param will be treated as an argument for 'path' Example: json_pointer_set(obj, "/foo/%d/%s", value, 0, bak) This means, that you need to escape '' with '%' (just like in printf())</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">obj</td><td>the <aclass="el"href="structjson__object.html">json_object</a> instance/tree to which to add a sub-object </td></tr>
<tr><tdclass="paramname">path</td><td>a (RFC6901) string notation for the sub-object to set in the tree </td></tr>
<tr><tdclass="paramname">value</td><td>object to set at path</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>negative if an error (or not found), or 0 if succeeded </dd></dl>
<p>This is a variant of '<aclass="el"href="json__pointer_8h.html#ab06a9fd172593748b2dc8d3a11c74fa0">json_pointer_set()</a>' that supports printf() style arguments.</p>
<p>Example: json_pointer_setf(obj, value, "/foo/%d/%s", 0, bak) This also means that you need to escape '' with '%' (just like in printf())</p>
<p>Please take into consideration all recommended 'printf()' format security aspects when using this function.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">obj</td><td>the <aclass="el"href="structjson__object.html">json_object</a> instance/tree to which to add a sub-object </td></tr>
<tr><tdclass="paramname">value</td><td>object to set at path </td></tr>
<tr><tdclass="paramname">path_fmt</td><td>a printf() style format for the path</td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>negative if an error (or not found), or 0 if succeeded </dd></dl>