1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5 <meta http-equiv="X-UA-Compatible" content="IE=9"/> 6 <title>json-c: /home/erh/json-c-0.15/json_object.h File Reference</title> 7 <link href="tabs.css" rel="stylesheet" type="text/css"/> 8 <script type="text/javascript" src="jquery.js"></script> 9 <script type="text/javascript" src="dynsections.js"></script> 10 <link href="doxygen.css" rel="stylesheet" type="text/css" /> 11 </head> 12 <body> 13 <div id="top"><!-- do not remove this div, it is closed by doxygen! --> 14 <div id="titlearea"> 15 <table cellspacing="0" cellpadding="0"> 16 <tbody> 17 <tr style="height: 56px;"> 18 <td style="padding-left: 0.5em;"> 19 <div id="projectname">json-c 20  <span id="projectnumber">0.15</span> 21 </div> 22 </td> 23 </tr> 24 </tbody> 25 </table> 26 </div> 27 <!-- end header part --> 28 <!-- Generated by Doxygen 1.8.2 --> 29 <div id="navrow1" class="tabs"> 30 <ul class="tablist"> 31 <li><a href="index.html"><span>Main Page</span></a></li> 32 <li><a href="pages.html"><span>Related Pages</span></a></li> 33 <li><a href="annotated.html"><span>Data Structures</span></a></li> 34 <li class="current"><a href="files.html"><span>Files</span></a></li> 35 </ul> 36 </div> 37 <div id="navrow2" class="tabs2"> 38 <ul class="tablist"> 39 <li><a href="files.html"><span>File List</span></a></li> 40 <li><a href="globals.html"><span>Globals</span></a></li> 41 </ul> 42 </div> 43 <div id="nav-path" class="navpath"> 44 <ul> 45 <li class="navelem"><a class="el" href="dir_71f13e590eb9d766c31051438785ada5.html">json-c-0.15</a></li> </ul> 46 </div> 47 </div><!-- top --> 48 <div class="header"> 49 <div class="summary"> 50 <a href="#define-members">Macros</a> | 51 <a href="#typedef-members">Typedefs</a> | 52 <a href="#func-members">Functions</a> | 53 <a href="#var-members">Variables</a> </div> 54 <div class="headertitle"> 55 <div class="title">json_object.h File Reference</div> </div> 56 </div><!--header--> 57 <div class="contents"> 58 59 <p>Core json-c API. Start here, or with <a class="el" href="json__tokener_8h.html" title="Methods to parse an input string into a tree of json_object objects.">json_tokener.h</a>. 60 <a href="#details">More...</a></p> 61 <table class="memberdecls"> 62 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> 63 Macros</h2></td></tr> 64 <tr class="memitem:a878f59e029f19db79ff9eb41fdcf4c6d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a878f59e029f19db79ff9eb41fdcf4c6d">JSON_C_CONST_FUNCTION</a>(func)   func</td></tr> 65 <tr class="separator:a878f59e029f19db79ff9eb41fdcf4c6d"><td class="memSeparator" colspan="2"> </td></tr> 66 <tr class="memitem:a268a63dd1b2e6d81559e268a4529e9bf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a268a63dd1b2e6d81559e268a4529e9bf">JSON_OBJECT_DEF_HASH_ENTRIES</a>   16</td></tr> 67 <tr class="separator:a268a63dd1b2e6d81559e268a4529e9bf"><td class="memSeparator" colspan="2"> </td></tr> 68 <tr class="memitem:a3294cb92765cdeb497cfd346644d1059"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a3294cb92765cdeb497cfd346644d1059">JSON_C_TO_STRING_PLAIN</a>   0</td></tr> 69 <tr class="separator:a3294cb92765cdeb497cfd346644d1059"><td class="memSeparator" colspan="2"> </td></tr> 70 <tr class="memitem:aa821746c8668e6ad62bed90ec9e00103"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aa821746c8668e6ad62bed90ec9e00103">JSON_C_TO_STRING_SPACED</a>   (1 << 0)</td></tr> 71 <tr class="separator:aa821746c8668e6ad62bed90ec9e00103"><td class="memSeparator" colspan="2"> </td></tr> 72 <tr class="memitem:a2025bc677c35f130e117dfda5bf1ef73"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a2025bc677c35f130e117dfda5bf1ef73">JSON_C_TO_STRING_PRETTY</a>   (1 << 1)</td></tr> 73 <tr class="separator:a2025bc677c35f130e117dfda5bf1ef73"><td class="memSeparator" colspan="2"> </td></tr> 74 <tr class="memitem:afc1486af21f6b1653c6f523025bdfd3b"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#afc1486af21f6b1653c6f523025bdfd3b">JSON_C_TO_STRING_PRETTY_TAB</a>   (1 << 3)</td></tr> 75 <tr class="separator:afc1486af21f6b1653c6f523025bdfd3b"><td class="memSeparator" colspan="2"> </td></tr> 76 <tr class="memitem:a34f027c147babf69fc530d088f2b49b0"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a34f027c147babf69fc530d088f2b49b0">JSON_C_TO_STRING_NOZERO</a>   (1 << 2)</td></tr> 77 <tr class="separator:a34f027c147babf69fc530d088f2b49b0"><td class="memSeparator" colspan="2"> </td></tr> 78 <tr class="memitem:a5c11d72c55f3ab7c088f19e7bf118163"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a5c11d72c55f3ab7c088f19e7bf118163">JSON_C_TO_STRING_NOSLASHESCAPE</a>   (1 << 4)</td></tr> 79 <tr class="separator:a5c11d72c55f3ab7c088f19e7bf118163"><td class="memSeparator" colspan="2"> </td></tr> 80 <tr class="memitem:a8cd01c484155ac99043a35b7c85ae411"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a8cd01c484155ac99043a35b7c85ae411">JSON_C_OBJECT_ADD_KEY_IS_NEW</a>   (1 << 1)</td></tr> 81 <tr class="separator:a8cd01c484155ac99043a35b7c85ae411"><td class="memSeparator" colspan="2"> </td></tr> 82 <tr class="memitem:a134ffafc6116799a20134dc7646b5a37"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a134ffafc6116799a20134dc7646b5a37">JSON_C_OBJECT_KEY_IS_CONSTANT</a>   (1 << 2)</td></tr> 83 <tr class="separator:a134ffafc6116799a20134dc7646b5a37"><td class="memSeparator" colspan="2"> </td></tr> 84 <tr class="memitem:a45837b8c6564f9e605f8a2bc76243750"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a45837b8c6564f9e605f8a2bc76243750">JSON_C_OPTION_GLOBAL</a>   (0)</td></tr> 85 <tr class="separator:a45837b8c6564f9e605f8a2bc76243750"><td class="memSeparator" colspan="2"> </td></tr> 86 <tr class="memitem:a50d1490598fe476d7a53e204e02cdc9d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a50d1490598fe476d7a53e204e02cdc9d">JSON_C_OPTION_THREAD</a>   (1)</td></tr> 87 <tr class="separator:a50d1490598fe476d7a53e204e02cdc9d"><td class="memSeparator" colspan="2"> </td></tr> 88 <tr class="memitem:acf5f514a9e0061c10fc08055762639ee"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#acf5f514a9e0061c10fc08055762639ee">json_object_object_foreach</a>(obj, key, val)</td></tr> 89 <tr class="separator:acf5f514a9e0061c10fc08055762639ee"><td class="memSeparator" colspan="2"> </td></tr> 90 <tr class="memitem:a71f07006c12d78f7bbf4cb716a5af3a6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a71f07006c12d78f7bbf4cb716a5af3a6">json_object_object_foreachC</a>(obj, iter)</td></tr> 91 <tr class="separator:a71f07006c12d78f7bbf4cb716a5af3a6"><td class="memSeparator" colspan="2"> </td></tr> 92 </table><table class="memberdecls"> 93 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> 94 Typedefs</h2></td></tr> 95 <tr class="memitem:af4562514916f62ea56adf752ada10b52"><td class="memItemLeft" align="right" valign="top">typedef int( </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_c_shallow_copy_fn</a> )(<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *src, <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *parent, const char *key, size_t index, <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **dst)</td></tr> 96 <tr class="separator:af4562514916f62ea56adf752ada10b52"><td class="memSeparator" colspan="2"> </td></tr> 97 </table><table class="memberdecls"> 98 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 99 Functions</h2></td></tr> 100 <tr class="memitem:a675aa3a9cced685dbfd1c1a770a0c3e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object_get</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 101 <tr class="separator:a675aa3a9cced685dbfd1c1a770a0c3e4"><td class="memSeparator" colspan="2"> </td></tr> 102 <tr class="memitem:afabf61f932cd64a4122ca8092452eed5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 103 <tr class="separator:afabf61f932cd64a4122ca8092452eed5"><td class="memSeparator" colspan="2"> </td></tr> 104 <tr class="memitem:a8ab506a3d8f4ba5eb6a12ce0a6bbd37b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a8ab506a3d8f4ba5eb6a12ce0a6bbd37b">json_object_is_type</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, enum <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06c">json_type</a> type)</td></tr> 105 <tr class="separator:a8ab506a3d8f4ba5eb6a12ce0a6bbd37b"><td class="memSeparator" colspan="2"> </td></tr> 106 <tr class="memitem:af256a3a7910e271a2b9735e5044c3827"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> enum <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06c">json_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#af256a3a7910e271a2b9735e5044c3827">json_object_get_type</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 107 <tr class="separator:af256a3a7910e271a2b9735e5044c3827"><td class="memSeparator" colspan="2"> </td></tr> 108 <tr class="memitem:ab7390c22baa1700d977c2af6b22d43a4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ab7390c22baa1700d977c2af6b22d43a4">json_object_to_json_string</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 109 <tr class="separator:ab7390c22baa1700d977c2af6b22d43a4"><td class="memSeparator" colspan="2"> </td></tr> 110 <tr class="memitem:a9db613127bd4ef7db42307e43a85fc1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int flags)</td></tr> 111 <tr class="separator:a9db613127bd4ef7db42307e43a85fc1b"><td class="memSeparator" colspan="2"> </td></tr> 112 <tr class="memitem:add3770a3ba3d01a8f9adedfcd6bd8dbb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#add3770a3ba3d01a8f9adedfcd6bd8dbb">json_object_to_json_string_length</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int flags, size_t *length)</td></tr> 113 <tr class="separator:add3770a3ba3d01a8f9adedfcd6bd8dbb"><td class="memSeparator" colspan="2"> </td></tr> 114 <tr class="memitem:ae925f3ec0f61cba5ea3dd50e0315f194"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae925f3ec0f61cba5ea3dd50e0315f194">json_object_get_userdata</a> (<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso)</td></tr> 115 <tr class="separator:ae925f3ec0f61cba5ea3dd50e0315f194"><td class="memSeparator" colspan="2"> </td></tr> 116 <tr class="memitem:a4ee4281ccd123c62878e931a0a3bc43b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a4ee4281ccd123c62878e931a0a3bc43b">json_object_set_userdata</a> (<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso, void *userdata, <a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_object_delete_fn</a> *user_delete)</td></tr> 117 <tr class="separator:a4ee4281ccd123c62878e931a0a3bc43b"><td class="memSeparator" colspan="2"> </td></tr> 118 <tr class="memitem:a889345512a214b8f78f6a73561523c7c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer</a> (<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso, <a class="el" href="json__types_8h.html#af84078100a9025df418f31626ea866fa">json_object_to_json_string_fn</a> *to_string_func, void *userdata, <a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_object_delete_fn</a> *user_delete)</td></tr> 119 <tr class="separator:a889345512a214b8f78f6a73561523c7c"><td class="memSeparator" colspan="2"> </td></tr> 120 <tr class="memitem:a68c383f54544fca19b5f2425be397600"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a68c383f54544fca19b5f2425be397600">json_object_new_object</a> (void)</td></tr> 121 <tr class="separator:a68c383f54544fca19b5f2425be397600"><td class="memSeparator" colspan="2"> </td></tr> 122 <tr class="memitem:a2caa52ae1863bd073444f3737138a4db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structlh__table.html">lh_table</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object_get_object</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 123 <tr class="separator:a2caa52ae1863bd073444f3737138a4db"><td class="memSeparator" colspan="2"> </td></tr> 124 <tr class="memitem:ad59a0ad2ec914a5eef90af53acae06d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ad59a0ad2ec914a5eef90af53acae06d9">json_object_object_length</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 125 <tr class="separator:ad59a0ad2ec914a5eef90af53acae06d9"><td class="memSeparator" colspan="2"> </td></tr> 126 <tr class="memitem:a922b2d76c73da57174beec82d471743b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a922b2d76c73da57174beec82d471743b">JSON_C_CONST_FUNCTION</a> (<a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> size_t json_c_object_sizeof(void))</td></tr> 127 <tr class="separator:a922b2d76c73da57174beec82d471743b"><td class="memSeparator" colspan="2"> </td></tr> 128 <tr class="memitem:a27bd808a022251059a43f1f6370441cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a27bd808a022251059a43f1f6370441cd">json_object_object_add</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *key, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *val)</td></tr> 129 <tr class="separator:a27bd808a022251059a43f1f6370441cd"><td class="memSeparator" colspan="2"> </td></tr> 130 <tr class="memitem:a57d3e444dd7db6b4510d21bf3716a002"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a57d3e444dd7db6b4510d21bf3716a002">json_object_object_add_ex</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *const key, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *const val, const unsigned opts)</td></tr> 131 <tr class="separator:a57d3e444dd7db6b4510d21bf3716a002"><td class="memSeparator" colspan="2"> </td></tr> 132 <tr class="memitem:a1a097805abb53b4c8a60d573730a8939"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *key)</td></tr> 133 <tr class="separator:a1a097805abb53b4c8a60d573730a8939"><td class="memSeparator" colspan="2"> </td></tr> 134 <tr class="memitem:a90d5f16d58636f01d2ed1a6030c7366a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a90d5f16d58636f01d2ed1a6030c7366a">json_object_object_get_ex</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *key, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **value)</td></tr> 135 <tr class="separator:a90d5f16d58636f01d2ed1a6030c7366a"><td class="memSeparator" colspan="2"> </td></tr> 136 <tr class="memitem:ac6605fdafca20bd5d33c84f4f80a3bda"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ac6605fdafca20bd5d33c84f4f80a3bda">json_object_object_del</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *key)</td></tr> 137 <tr class="separator:ac6605fdafca20bd5d33c84f4f80a3bda"><td class="memSeparator" colspan="2"> </td></tr> 138 <tr class="memitem:a84f7f8c0774c4600d958561d7548d649"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a84f7f8c0774c4600d958561d7548d649">json_object_new_array</a> (void)</td></tr> 139 <tr class="separator:a84f7f8c0774c4600d958561d7548d649"><td class="memSeparator" colspan="2"> </td></tr> 140 <tr class="memitem:a62af9fb3b02fb153190369d949394b26"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a62af9fb3b02fb153190369d949394b26">json_object_new_array_ext</a> (int initial_size)</td></tr> 141 <tr class="separator:a62af9fb3b02fb153190369d949394b26"><td class="memSeparator" colspan="2"> </td></tr> 142 <tr class="memitem:a23d20e3f886c1638a7116be66b7b5ec2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structarray__list.html">array_list</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a23d20e3f886c1638a7116be66b7b5ec2">json_object_get_array</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 143 <tr class="separator:a23d20e3f886c1638a7116be66b7b5ec2"><td class="memSeparator" colspan="2"> </td></tr> 144 <tr class="memitem:ab9ea8f9c72d5adf83fdcbfe69f97fa44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ab9ea8f9c72d5adf83fdcbfe69f97fa44">json_object_array_length</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 145 <tr class="separator:ab9ea8f9c72d5adf83fdcbfe69f97fa44"><td class="memSeparator" colspan="2"> </td></tr> 146 <tr class="memitem:a5584e2f2051cd1faa7fafd07ba888fd1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a5584e2f2051cd1faa7fafd07ba888fd1">json_object_array_sort</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso, int(*sort_fn)(const void *, const void *))</td></tr> 147 <tr class="separator:a5584e2f2051cd1faa7fafd07ba888fd1"><td class="memSeparator" colspan="2"> </td></tr> 148 <tr class="memitem:aed353084ed3ad84e7b7575afbe7e719d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aed353084ed3ad84e7b7575afbe7e719d">json_object_array_bsearch</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *key, const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso, int(*sort_fn)(const void *, const void *))</td></tr> 149 <tr class="separator:aed353084ed3ad84e7b7575afbe7e719d"><td class="memSeparator" colspan="2"> </td></tr> 150 <tr class="memitem:a18cdd9a7455e09f36cdf6e5756b7f586"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a18cdd9a7455e09f36cdf6e5756b7f586">json_object_array_add</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *val)</td></tr> 151 <tr class="separator:a18cdd9a7455e09f36cdf6e5756b7f586"><td class="memSeparator" colspan="2"> </td></tr> 152 <tr class="memitem:a1ac0ccdbc13a25da7d8b2dc9e421dfad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a1ac0ccdbc13a25da7d8b2dc9e421dfad">json_object_array_put_idx</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *val)</td></tr> 153 <tr class="separator:a1ac0ccdbc13a25da7d8b2dc9e421dfad"><td class="memSeparator" colspan="2"> </td></tr> 154 <tr class="memitem:a676711a76545d4ec65cc75f100f5fd19"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx)</td></tr> 155 <tr class="separator:a676711a76545d4ec65cc75f100f5fd19"><td class="memSeparator" colspan="2"> </td></tr> 156 <tr class="memitem:a722eca9f578704d3af38b97549242c1f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a722eca9f578704d3af38b97549242c1f">json_object_array_del_idx</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, size_t idx, size_t count)</td></tr> 157 <tr class="separator:a722eca9f578704d3af38b97549242c1f"><td class="memSeparator" colspan="2"> </td></tr> 158 <tr class="memitem:a95552402a95c9470b230052d92270247"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a95552402a95c9470b230052d92270247">json_object_array_shrink</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso, int empty_slots)</td></tr> 159 <tr class="separator:a95552402a95c9470b230052d92270247"><td class="memSeparator" colspan="2"> </td></tr> 160 <tr class="memitem:a2e290acd80e72cca745f89fb4600fb78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a2e290acd80e72cca745f89fb4600fb78">json_object_new_boolean</a> (<a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> b)</td></tr> 161 <tr class="separator:a2e290acd80e72cca745f89fb4600fb78"><td class="memSeparator" colspan="2"> </td></tr> 162 <tr class="memitem:ac003fb99db7ecd674bb16d983d2f92ee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ac003fb99db7ecd674bb16d983d2f92ee">json_object_get_boolean</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 163 <tr class="separator:ac003fb99db7ecd674bb16d983d2f92ee"><td class="memSeparator" colspan="2"> </td></tr> 164 <tr class="memitem:a23863c1503f3a8dd8a460a6405da0a65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a23863c1503f3a8dd8a460a6405da0a65">json_object_set_boolean</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> new_value)</td></tr> 165 <tr class="separator:a23863c1503f3a8dd8a460a6405da0a65"><td class="memSeparator" colspan="2"> </td></tr> 166 <tr class="memitem:ae92f0770fb4b3c884ce35de52d3d7de8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae92f0770fb4b3c884ce35de52d3d7de8">json_object_new_int</a> (int32_t i)</td></tr> 167 <tr class="separator:ae92f0770fb4b3c884ce35de52d3d7de8"><td class="memSeparator" colspan="2"> </td></tr> 168 <tr class="memitem:a7847f74494645c2b076505c37cc4cb93"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7847f74494645c2b076505c37cc4cb93">json_object_new_int64</a> (int64_t i)</td></tr> 169 <tr class="separator:a7847f74494645c2b076505c37cc4cb93"><td class="memSeparator" colspan="2"> </td></tr> 170 <tr class="memitem:aa602ee5f6182b35f3f75a927320b4efd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aa602ee5f6182b35f3f75a927320b4efd">json_object_new_uint64</a> (uint64_t i)</td></tr> 171 <tr class="separator:aa602ee5f6182b35f3f75a927320b4efd"><td class="memSeparator" colspan="2"> </td></tr> 172 <tr class="memitem:a8c56dc58a02f92cd6789ba5dcb9fe7b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a8c56dc58a02f92cd6789ba5dcb9fe7b1">json_object_get_int</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 173 <tr class="separator:a8c56dc58a02f92cd6789ba5dcb9fe7b1"><td class="memSeparator" colspan="2"> </td></tr> 174 <tr class="memitem:a4ab3568f12e01fd2967e765a72456caa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a4ab3568f12e01fd2967e765a72456caa">json_object_set_int</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int new_value)</td></tr> 175 <tr class="separator:a4ab3568f12e01fd2967e765a72456caa"><td class="memSeparator" colspan="2"> </td></tr> 176 <tr class="memitem:a25691322b2d1ab24a3797e5752eb659f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a25691322b2d1ab24a3797e5752eb659f">json_object_int_inc</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int64_t val)</td></tr> 177 <tr class="separator:a25691322b2d1ab24a3797e5752eb659f"><td class="memSeparator" colspan="2"> </td></tr> 178 <tr class="memitem:a1a14750b3af4df18ec8dc93b090a8e8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a1a14750b3af4df18ec8dc93b090a8e8a">json_object_get_int64</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 179 <tr class="separator:a1a14750b3af4df18ec8dc93b090a8e8a"><td class="memSeparator" colspan="2"> </td></tr> 180 <tr class="memitem:a82c27579b6d25d9d0eb3b72758d8b71d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> uint64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a82c27579b6d25d9d0eb3b72758d8b71d">json_object_get_uint64</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 181 <tr class="separator:a82c27579b6d25d9d0eb3b72758d8b71d"><td class="memSeparator" colspan="2"> </td></tr> 182 <tr class="memitem:a7d3948600dde732abed0e261264ef53a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7d3948600dde732abed0e261264ef53a">json_object_set_int64</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, int64_t new_value)</td></tr> 183 <tr class="separator:a7d3948600dde732abed0e261264ef53a"><td class="memSeparator" colspan="2"> </td></tr> 184 <tr class="memitem:a9900aa9a425e6f14e295b298460b65d4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a9900aa9a425e6f14e295b298460b65d4">json_object_set_uint64</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, uint64_t new_value)</td></tr> 185 <tr class="separator:a9900aa9a425e6f14e295b298460b65d4"><td class="memSeparator" colspan="2"> </td></tr> 186 <tr class="memitem:a594a093bafb9091f843da3197e0638aa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a594a093bafb9091f843da3197e0638aa">json_object_new_double</a> (double d)</td></tr> 187 <tr class="separator:a594a093bafb9091f843da3197e0638aa"><td class="memSeparator" colspan="2"> </td></tr> 188 <tr class="memitem:ae49671c026fe1ada370a75321e4e65f6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae49671c026fe1ada370a75321e4e65f6">json_object_new_double_s</a> (double d, const char *ds)</td></tr> 189 <tr class="separator:ae49671c026fe1ada370a75321e4e65f6"><td class="memSeparator" colspan="2"> </td></tr> 190 <tr class="memitem:ac099272b46fde595831118720b155656"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ac099272b46fde595831118720b155656">json_c_set_serialization_double_format</a> (const char *double_format, int global_or_thread)</td></tr> 191 <tr class="separator:ac099272b46fde595831118720b155656"><td class="memSeparator" colspan="2"> </td></tr> 192 <tr class="memitem:ada262c62364e3819b6a64b1e3a632336"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ada262c62364e3819b6a64b1e3a632336">json_object_double_to_json_string</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *jso, struct <a class="el" href="structprintbuf.html">printbuf</a> *pb, int level, int flags)</td></tr> 193 <tr class="separator:ada262c62364e3819b6a64b1e3a632336"><td class="memSeparator" colspan="2"> </td></tr> 194 <tr class="memitem:a94a70cff6a14398b581b7b10b0792c5b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> double </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a94a70cff6a14398b581b7b10b0792c5b">json_object_get_double</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 195 <tr class="separator:a94a70cff6a14398b581b7b10b0792c5b"><td class="memSeparator" colspan="2"> </td></tr> 196 <tr class="memitem:a3a7b7ce585565558cb69dad8d45d7757"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a3a7b7ce585565558cb69dad8d45d7757">json_object_set_double</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, double new_value)</td></tr> 197 <tr class="separator:a3a7b7ce585565558cb69dad8d45d7757"><td class="memSeparator" colspan="2"> </td></tr> 198 <tr class="memitem:a7b7b5302b3903c9347eeb1f4a64d657b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a7b7b5302b3903c9347eeb1f4a64d657b">json_object_new_string</a> (const char *s)</td></tr> 199 <tr class="separator:a7b7b5302b3903c9347eeb1f4a64d657b"><td class="memSeparator" colspan="2"> </td></tr> 200 <tr class="memitem:a778a1aa34a508d08daac3bdb83e24b52"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a778a1aa34a508d08daac3bdb83e24b52">json_object_new_string_len</a> (const char *s, const int len)</td></tr> 201 <tr class="separator:a778a1aa34a508d08daac3bdb83e24b52"><td class="memSeparator" colspan="2"> </td></tr> 202 <tr class="memitem:a9ee29ca8d79896e15007131527f6002e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a9ee29ca8d79896e15007131527f6002e">json_object_get_string</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 203 <tr class="separator:a9ee29ca8d79896e15007131527f6002e"><td class="memSeparator" colspan="2"> </td></tr> 204 <tr class="memitem:ac1d1f95a27a5e5d93bb66a8adfc1a2f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ac1d1f95a27a5e5d93bb66a8adfc1a2f4">json_object_get_string_len</a> (const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj)</td></tr> 205 <tr class="separator:ac1d1f95a27a5e5d93bb66a8adfc1a2f4"><td class="memSeparator" colspan="2"> </td></tr> 206 <tr class="memitem:ac35013e51cdc0651512801c947df431c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ac35013e51cdc0651512801c947df431c">json_object_set_string</a> (<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *new_value)</td></tr> 207 <tr class="separator:ac35013e51cdc0651512801c947df431c"><td class="memSeparator" colspan="2"> </td></tr> 208 <tr class="memitem:ae48707a0c8689e14aaa3a9b831db27fc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#ae48707a0c8689e14aaa3a9b831db27fc">json_object_set_string_len</a> (<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj, const char *new_value, int len)</td></tr> 209 <tr class="separator:ae48707a0c8689e14aaa3a9b831db27fc"><td class="memSeparator" colspan="2"> </td></tr> 210 <tr class="memitem:a29e23b5be729c679960242b3b81bcde0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a29e23b5be729c679960242b3b81bcde0">json_object_new_null</a> (void)</td></tr> 211 <tr class="separator:a29e23b5be729c679960242b3b81bcde0"><td class="memSeparator" colspan="2"> </td></tr> 212 <tr class="memitem:a5a1d4640525e0217059868e312f20579"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a5a1d4640525e0217059868e312f20579">json_object_equal</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj1, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *obj2)</td></tr> 213 <tr class="separator:a5a1d4640525e0217059868e312f20579"><td class="memSeparator" colspan="2"> </td></tr> 214 <tr class="memitem:aaac16505f13bc56accfad82604d8bcdc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aaac16505f13bc56accfad82604d8bcdc">json_object_deep_copy</a> (struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *src, struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **dst, <a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_c_shallow_copy_fn</a> *shallow_copy)</td></tr> 215 <tr class="separator:aaac16505f13bc56accfad82604d8bcdc"><td class="memSeparator" colspan="2"> </td></tr> 216 </table><table class="memberdecls"> 217 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> 218 Variables</h2></td></tr> 219 <tr class="memitem:aff3190c34884bea3b4e65e286b973d89"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_object_delete_fn</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#aff3190c34884bea3b4e65e286b973d89">json_object_free_userdata</a></td></tr> 220 <tr class="separator:aff3190c34884bea3b4e65e286b973d89"><td class="memSeparator" colspan="2"> </td></tr> 221 <tr class="memitem:a56091ddbd2ec6d6200558cbeff1b86b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <br class="typebreak"/> 222 <a class="el" href="json__types_8h.html#af84078100a9025df418f31626ea866fa">json_object_to_json_string_fn</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a56091ddbd2ec6d6200558cbeff1b86b8">json_object_userdata_to_json_string</a></td></tr> 223 <tr class="separator:a56091ddbd2ec6d6200558cbeff1b86b8"><td class="memSeparator" colspan="2"> </td></tr> 224 <tr class="memitem:a86ea08e75ddf054742bf806a3bc3f983"><td class="memItemLeft" align="right" valign="top"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_c_shallow_copy_fn</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="json__object_8h.html#a86ea08e75ddf054742bf806a3bc3f983">json_c_shallow_copy_default</a></td></tr> 225 <tr class="separator:a86ea08e75ddf054742bf806a3bc3f983"><td class="memSeparator" colspan="2"> </td></tr> 226 </table> 227 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 228 <div class="textblock"><p>Core json-c API. Start here, or with <a class="el" href="json__tokener_8h.html" title="Methods to parse an input string into a tree of json_object objects.">json_tokener.h</a>. </p> 229 </div><h2 class="groupheader">Macro Definition Documentation</h2> 230 <a class="anchor" id="a878f59e029f19db79ff9eb41fdcf4c6d"></a> 231 <div class="memitem"> 232 <div class="memproto"> 233 <table class="memname"> 234 <tr> 235 <td class="memname">#define JSON_C_CONST_FUNCTION</td> 236 <td>(</td> 237 <td class="paramtype"> </td> 238 <td class="paramname">func </td><td>)</td> 239 <td>   func</td> 240 </tr> 241 </table> 242 </div><div class="memdoc"> 243 244 </div> 245 </div> 246 <a class="anchor" id="a8cd01c484155ac99043a35b7c85ae411"></a> 247 <div class="memitem"> 248 <div class="memproto"> 249 <table class="memname"> 250 <tr> 251 <td class="memname">#define JSON_C_OBJECT_ADD_KEY_IS_NEW   (1 << 1)</td> 252 </tr> 253 </table> 254 </div><div class="memdoc"> 255 <p>A flag for the json_object_object_add_ex function which causes the value to be added without a check if it already exists. Note: it is the responsibility of the caller to ensure that no key is added multiple times. If this is done, results are unpredictable. While this option is somewhat dangerous, it permits potentially large performance savings in code that knows for sure the key values are unique (e.g. because the code adds a well-known set of constant key values). </p> 256 257 </div> 258 </div> 259 <a class="anchor" id="a134ffafc6116799a20134dc7646b5a37"></a> 260 <div class="memitem"> 261 <div class="memproto"> 262 <table class="memname"> 263 <tr> 264 <td class="memname">#define JSON_C_OBJECT_KEY_IS_CONSTANT   (1 << 2)</td> 265 </tr> 266 </table> 267 </div><div class="memdoc"> 268 <p>A flag for the json_object_object_add_ex function which flags the key as being constant memory. This means that the key will NOT be copied via strdup(), resulting in a potentially huge performance win (malloc, strdup and free are usually performance hogs). It is acceptable to use this flag for keys in non-constant memory blocks if the caller ensure that the memory holding the key lives longer than the corresponding json object. However, this is somewhat dangerous and should only be done if really justified. The general use-case for this flag is cases where the key is given as a real constant value in the function call, e.g. as in json_object_object_add_ex(obj, "ip", json, JSON_C_OBJECT_KEY_IS_CONSTANT); </p> 269 270 </div> 271 </div> 272 <a class="anchor" id="a45837b8c6564f9e605f8a2bc76243750"></a> 273 <div class="memitem"> 274 <div class="memproto"> 275 <table class="memname"> 276 <tr> 277 <td class="memname">#define JSON_C_OPTION_GLOBAL   (0)</td> 278 </tr> 279 </table> 280 </div><div class="memdoc"> 281 <p>Set the global value of an option, which will apply to all current and future threads that have not set a thread-local value.</p> 282 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#ac099272b46fde595831118720b155656">json_c_set_serialization_double_format</a> </dd></dl> 283 284 </div> 285 </div> 286 <a class="anchor" id="a50d1490598fe476d7a53e204e02cdc9d"></a> 287 <div class="memitem"> 288 <div class="memproto"> 289 <table class="memname"> 290 <tr> 291 <td class="memname">#define JSON_C_OPTION_THREAD   (1)</td> 292 </tr> 293 </table> 294 </div><div class="memdoc"> 295 <p>Set a thread-local value of an option, overriding the global value. This will fail if json-c is not compiled with threading enabled, and with the __thread specifier (or equivalent) available.</p> 296 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#ac099272b46fde595831118720b155656">json_c_set_serialization_double_format</a> </dd></dl> 297 298 </div> 299 </div> 300 <a class="anchor" id="a5c11d72c55f3ab7c088f19e7bf118163"></a> 301 <div class="memitem"> 302 <div class="memproto"> 303 <table class="memname"> 304 <tr> 305 <td class="memname">#define JSON_C_TO_STRING_NOSLASHESCAPE   (1 << 4)</td> 306 </tr> 307 </table> 308 </div><div class="memdoc"> 309 <p>Don't escape forward slashes. </p> 310 311 </div> 312 </div> 313 <a class="anchor" id="a34f027c147babf69fc530d088f2b49b0"></a> 314 <div class="memitem"> 315 <div class="memproto"> 316 <table class="memname"> 317 <tr> 318 <td class="memname">#define JSON_C_TO_STRING_NOZERO   (1 << 2)</td> 319 </tr> 320 </table> 321 </div><div class="memdoc"> 322 <p>A flag to drop trailing zero for float values </p> 323 324 </div> 325 </div> 326 <a class="anchor" id="a3294cb92765cdeb497cfd346644d1059"></a> 327 <div class="memitem"> 328 <div class="memproto"> 329 <table class="memname"> 330 <tr> 331 <td class="memname">#define JSON_C_TO_STRING_PLAIN   0</td> 332 </tr> 333 </table> 334 </div><div class="memdoc"> 335 <p>A flag for the <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext()</a> and <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_object_to_file_ext()</a> functions which causes the output to have no extra whitespace or formatting applied. </p> 336 337 </div> 338 </div> 339 <a class="anchor" id="a2025bc677c35f130e117dfda5bf1ef73"></a> 340 <div class="memitem"> 341 <div class="memproto"> 342 <table class="memname"> 343 <tr> 344 <td class="memname">#define JSON_C_TO_STRING_PRETTY   (1 << 1)</td> 345 </tr> 346 </table> 347 </div><div class="memdoc"> 348 <p>A flag for the <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext()</a> and <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_object_to_file_ext()</a> functions which causes the output to be formatted.</p> 349 <p>See the "Two Space Tab" option at <a href="http://jsonformatter.curiousconcept.com/">http://jsonformatter.curiousconcept.com/</a> for an example of the format. </p> 350 351 </div> 352 </div> 353 <a class="anchor" id="afc1486af21f6b1653c6f523025bdfd3b"></a> 354 <div class="memitem"> 355 <div class="memproto"> 356 <table class="memname"> 357 <tr> 358 <td class="memname">#define JSON_C_TO_STRING_PRETTY_TAB   (1 << 3)</td> 359 </tr> 360 </table> 361 </div><div class="memdoc"> 362 <p>A flag for the <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext()</a> and <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_object_to_file_ext()</a> functions which causes the output to be formatted.</p> 363 <p>Instead of a "Two Space Tab" this gives a single tab character. </p> 364 365 </div> 366 </div> 367 <a class="anchor" id="aa821746c8668e6ad62bed90ec9e00103"></a> 368 <div class="memitem"> 369 <div class="memproto"> 370 <table class="memname"> 371 <tr> 372 <td class="memname">#define JSON_C_TO_STRING_SPACED   (1 << 0)</td> 373 </tr> 374 </table> 375 </div><div class="memdoc"> 376 <p>A flag for the <a class="el" href="json__object_8h.html#a9db613127bd4ef7db42307e43a85fc1b">json_object_to_json_string_ext()</a> and <a class="el" href="json__util_8h.html#a68a7385c555cf21797e361d1d4de3441">json_object_to_file_ext()</a> functions which causes the output to have minimal whitespace inserted to make things slightly more readable. </p> 377 378 </div> 379 </div> 380 <a class="anchor" id="a268a63dd1b2e6d81559e268a4529e9bf"></a> 381 <div class="memitem"> 382 <div class="memproto"> 383 <table class="memname"> 384 <tr> 385 <td class="memname">#define JSON_OBJECT_DEF_HASH_ENTRIES   16</td> 386 </tr> 387 </table> 388 </div><div class="memdoc"> 389 390 </div> 391 </div> 392 <a class="anchor" id="acf5f514a9e0061c10fc08055762639ee"></a> 393 <div class="memitem"> 394 <div class="memproto"> 395 <table class="memname"> 396 <tr> 397 <td class="memname">#define json_object_object_foreach</td> 398 <td>(</td> 399 <td class="paramtype"> </td> 400 <td class="paramname">obj, </td> 401 </tr> 402 <tr> 403 <td class="paramkey"></td> 404 <td></td> 405 <td class="paramtype"> </td> 406 <td class="paramname">key, </td> 407 </tr> 408 <tr> 409 <td class="paramkey"></td> 410 <td></td> 411 <td class="paramtype"> </td> 412 <td class="paramname">val </td> 413 </tr> 414 <tr> 415 <td></td> 416 <td>)</td> 417 <td></td><td></td> 418 </tr> 419 </table> 420 </div><div class="memdoc"> 421 <b>Value:</b><div class="fragment"><div class="line"><span class="keywordtype">char</span> *key = NULL; \</div> 422 <div class="line"> struct <a class="code" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914" title="The core type for all type of JSON objects handled by json-c.">json_object</a> *val = NULL; \</div> 423 <div class="line"> struct <a class="code" href="structlh__entry.html">lh_entry</a> *entry##key; \</div> 424 <div class="line"> struct <a class="code" href="structlh__entry.html">lh_entry</a> *entry_next##key = NULL; \</div> 425 <div class="line"> for (entry##key = <a class="code" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object_get_object</a>(obj)->head; \</div> 426 <div class="line"> (entry##key ? (key = (<span class="keywordtype">char</span> *)<a class="code" href="linkhash_8h.html#a7579ce28b8366fc9b8656f14270aa3aa">lh_entry_k</a>(entry##key), \</div> 427 <div class="line"> val = (<span class="keyword">struct </span><a class="code" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914" title="The core type for all type of JSON objects handled by json-c.">json_object</a> *)<a class="code" href="linkhash_8h.html#a0d4052ccfd8c5d351a9c1d3ba07671b3">lh_entry_v</a>(entry##key), \</div> 428 <div class="line"> entry_next##key = entry##key->next, entry##key) \</div> 429 <div class="line"> : 0); \</div> 430 <div class="line"> entry##key = entry_next##key)</div> 431 </div><!-- fragment --><p>Iterate through all keys and values of an object.</p> 432 <p>Adding keys to the object while iterating is NOT allowed.</p> 433 <p>Deleting an existing key, or replacing an existing key with a new value IS allowed.</p> 434 <dl class="params"><dt>Parameters</dt><dd> 435 <table class="params"> 436 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 437 <tr><td class="paramname">key</td><td>the local name for the char* key variable defined in the body </td></tr> 438 <tr><td class="paramname">val</td><td>the local name for the json_object* object variable defined in the body </td></tr> 439 </table> 440 </dd> 441 </dl> 442 443 </div> 444 </div> 445 <a class="anchor" id="a71f07006c12d78f7bbf4cb716a5af3a6"></a> 446 <div class="memitem"> 447 <div class="memproto"> 448 <table class="memname"> 449 <tr> 450 <td class="memname">#define json_object_object_foreachC</td> 451 <td>(</td> 452 <td class="paramtype"> </td> 453 <td class="paramname">obj, </td> 454 </tr> 455 <tr> 456 <td class="paramkey"></td> 457 <td></td> 458 <td class="paramtype"> </td> 459 <td class="paramname">iter </td> 460 </tr> 461 <tr> 462 <td></td> 463 <td>)</td> 464 <td></td><td></td> 465 </tr> 466 </table> 467 </div><div class="memdoc"> 468 <b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">for</span> (iter.entry = <a class="code" href="json__object_8h.html#a2caa52ae1863bd073444f3737138a4db">json_object_get_object</a>(obj)->head; \</div> 469 <div class="line"> (iter.entry ? (iter.key = (<span class="keywordtype">char</span> *)<a class="code" href="linkhash_8h.html#a7579ce28b8366fc9b8656f14270aa3aa">lh_entry_k</a>(iter.entry), \</div> 470 <div class="line"> iter.val = (<span class="keyword">struct </span><a class="code" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914" title="The core type for all type of JSON objects handled by json-c.">json_object</a> *)<a class="code" href="linkhash_8h.html#a0d4052ccfd8c5d351a9c1d3ba07671b3">lh_entry_v</a>(iter.entry), iter.entry) \</div> 471 <div class="line"> : 0); \</div> 472 <div class="line"> iter.entry = iter.entry->next)</div> 473 </div><!-- fragment --><p>Iterate through all keys and values of an object (ANSI C Safe) </p> 474 <dl class="params"><dt>Parameters</dt><dd> 475 <table class="params"> 476 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 477 <tr><td class="paramname">iter</td><td>the object iterator, use type <a class="el" href="structjson__object__iter.html">json_object_iter</a> </td></tr> 478 </table> 479 </dd> 480 </dl> 481 482 </div> 483 </div> 484 <h2 class="groupheader">Typedef Documentation</h2> 485 <a class="anchor" id="af4562514916f62ea56adf752ada10b52"></a> 486 <div class="memitem"> 487 <div class="memproto"> 488 <table class="memname"> 489 <tr> 490 <td class="memname">typedef int( json_c_shallow_copy_fn)(<a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *src, <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *parent, const char *key, size_t index, <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> **dst)</td> 491 </tr> 492 </table> 493 </div><div class="memdoc"> 494 <p>Perform a shallow copy of src into *dst as part of an overall <a class="el" href="json__object_8h.html#aaac16505f13bc56accfad82604d8bcdc">json_object_deep_copy()</a>.</p> 495 <p>If src is part of a containing object or array, parent will be non-NULL, and key or index will be provided. When shallow_copy is called *dst will be NULL, and must be non-NULL when it returns. src will never be NULL.</p> 496 <p>If shallow_copy sets the serializer on an object, return 2 to indicate to json_object_deep_copy that it should not attempt to use the standard userdata copy function.</p> 497 <dl class="section return"><dt>Returns</dt><dd>On success 1 or 2, -1 on errors </dd></dl> 498 499 </div> 500 </div> 501 <h2 class="groupheader">Function Documentation</h2> 502 <a class="anchor" id="a922b2d76c73da57174beec82d471743b"></a> 503 <div class="memitem"> 504 <div class="memproto"> 505 <table class="memname"> 506 <tr> 507 <td class="memname">JSON_C_CONST_FUNCTION </td> 508 <td>(</td> 509 <td class="paramtype"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> size_t  </td> 510 <td class="paramname"><em>json_c_object_sizeof</em>void</td><td>)</td> 511 <td></td> 512 </tr> 513 </table> 514 </div><div class="memdoc"> 515 <p>Get the sizeof (struct json_object). </p> 516 <dl class="section return"><dt>Returns</dt><dd>a size_t with the sizeof (struct json_object) </dd></dl> 517 518 </div> 519 </div> 520 <a class="anchor" id="ac099272b46fde595831118720b155656"></a> 521 <div class="memitem"> 522 <div class="memproto"> 523 <table class="memname"> 524 <tr> 525 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_c_set_serialization_double_format </td> 526 <td>(</td> 527 <td class="paramtype">const char * </td> 528 <td class="paramname"><em>double_format</em>, </td> 529 </tr> 530 <tr> 531 <td class="paramkey"></td> 532 <td></td> 533 <td class="paramtype">int </td> 534 <td class="paramname"><em>global_or_thread</em> </td> 535 </tr> 536 <tr> 537 <td></td> 538 <td>)</td> 539 <td></td><td></td> 540 </tr> 541 </table> 542 </div><div class="memdoc"> 543 <p>Set a global or thread-local json-c option, depending on whether JSON_C_OPTION_GLOBAL or JSON_C_OPTION_THREAD is passed. Thread-local options default to undefined, and inherit from the global value, even if the global value is changed after the thread is created. Attempting to set thread-local options when threading is not compiled in will result in an error. Be sure to check the return value.</p> 544 <p>double_format is a "%g" printf format, such as "%.20g"</p> 545 <dl class="section return"><dt>Returns</dt><dd>-1 on errors, 0 on success. </dd></dl> 546 547 </div> 548 </div> 549 <a class="anchor" id="a18cdd9a7455e09f36cdf6e5756b7f586"></a> 550 <div class="memitem"> 551 <div class="memproto"> 552 <table class="memname"> 553 <tr> 554 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_array_add </td> 555 <td>(</td> 556 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 557 <td class="paramname"><em>obj</em>, </td> 558 </tr> 559 <tr> 560 <td class="paramkey"></td> 561 <td></td> 562 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 563 <td class="paramname"><em>val</em> </td> 564 </tr> 565 <tr> 566 <td></td> 567 <td>)</td> 568 <td></td><td></td> 569 </tr> 570 </table> 571 </div><div class="memdoc"> 572 <p>Add an element to the end of a json_object of type json_type_array</p> 573 <p>The reference count will <em>not</em> be incremented. This is to make adding fields to objects in code more compact. If you want to retain a reference to an added object you must wrap the passed object with json_object_get</p> 574 <dl class="params"><dt>Parameters</dt><dd> 575 <table class="params"> 576 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 577 <tr><td class="paramname">val</td><td>the json_object to be added </td></tr> 578 </table> 579 </dd> 580 </dl> 581 582 </div> 583 </div> 584 <a class="anchor" id="aed353084ed3ad84e7b7575afbe7e719d"></a> 585 <div class="memitem"> 586 <div class="memproto"> 587 <table class="mlabels"> 588 <tr> 589 <td class="mlabels-left"> 590 <table class="memname"> 591 <tr> 592 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_array_bsearch </td> 593 <td>(</td> 594 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 595 <td class="paramname"><em>key</em>, </td> 596 </tr> 597 <tr> 598 <td class="paramkey"></td> 599 <td></td> 600 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 601 <td class="paramname"><em>jso</em>, </td> 602 </tr> 603 <tr> 604 <td class="paramkey"></td> 605 <td></td> 606 <td class="paramtype">int(*)(const void *, const void *) </td> 607 <td class="paramname"><em>sort_fn</em> </td> 608 </tr> 609 <tr> 610 <td></td> 611 <td>)</td> 612 <td></td><td></td> 613 </tr> 614 </table> 615 </td> 616 <td class="mlabels-right"> 617 <span class="mlabels"><span class="mlabel">read</span></span> </td> 618 </tr> 619 </table> 620 </div><div class="memdoc"> 621 <p>Binary search a sorted array for a specified key object.</p> 622 <p>It depends on your compare function what's sufficient as a key. Usually you create some dummy object with the parameter compared in it, to identify the right item you're actually looking for.</p> 623 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#a5584e2f2051cd1faa7fafd07ba888fd1">json_object_array_sort()</a> for hints on the compare function.</dd></dl> 624 <dl class="params"><dt>Parameters</dt><dd> 625 <table class="params"> 626 <tr><td class="paramname">key</td><td>a dummy json_object with the right key </td></tr> 627 <tr><td class="paramname">jso</td><td>the array object we're searching </td></tr> 628 <tr><td class="paramname">sort_fn</td><td>the sort/compare function</td></tr> 629 </table> 630 </dd> 631 </dl> 632 <dl class="section return"><dt>Returns</dt><dd>the wanted json_object instance </dd></dl> 633 634 </div> 635 </div> 636 <a class="anchor" id="a722eca9f578704d3af38b97549242c1f"></a> 637 <div class="memitem"> 638 <div class="memproto"> 639 <table class="memname"> 640 <tr> 641 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_array_del_idx </td> 642 <td>(</td> 643 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 644 <td class="paramname"><em>obj</em>, </td> 645 </tr> 646 <tr> 647 <td class="paramkey"></td> 648 <td></td> 649 <td class="paramtype">size_t </td> 650 <td class="paramname"><em>idx</em>, </td> 651 </tr> 652 <tr> 653 <td class="paramkey"></td> 654 <td></td> 655 <td class="paramtype">size_t </td> 656 <td class="paramname"><em>count</em> </td> 657 </tr> 658 <tr> 659 <td></td> 660 <td>)</td> 661 <td></td><td></td> 662 </tr> 663 </table> 664 </div><div class="memdoc"> 665 <p>Delete an elements from a specified index in an array (a json_object of type json_type_array)</p> 666 <p>The reference count will be decremented for each of the deleted objects. If there are no more owners of an element that is being deleted, then the value is freed. Otherwise, the reference to the value will remain in memory.</p> 667 <dl class="params"><dt>Parameters</dt><dd> 668 <table class="params"> 669 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 670 <tr><td class="paramname">idx</td><td>the index to start deleting elements at </td></tr> 671 <tr><td class="paramname">count</td><td>the number of elements to delete </td></tr> 672 </table> 673 </dd> 674 </dl> 675 <dl class="section return"><dt>Returns</dt><dd>0 if the elements were successfully deleted </dd></dl> 676 677 </div> 678 </div> 679 <a class="anchor" id="a676711a76545d4ec65cc75f100f5fd19"></a> 680 <div class="memitem"> 681 <div class="memproto"> 682 <table class="mlabels"> 683 <tr> 684 <td class="mlabels-left"> 685 <table class="memname"> 686 <tr> 687 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_array_get_idx </td> 688 <td>(</td> 689 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 690 <td class="paramname"><em>obj</em>, </td> 691 </tr> 692 <tr> 693 <td class="paramkey"></td> 694 <td></td> 695 <td class="paramtype">size_t </td> 696 <td class="paramname"><em>idx</em> </td> 697 </tr> 698 <tr> 699 <td></td> 700 <td>)</td> 701 <td></td><td></td> 702 </tr> 703 </table> 704 </td> 705 <td class="mlabels-right"> 706 <span class="mlabels"><span class="mlabel">read</span></span> </td> 707 </tr> 708 </table> 709 </div><div class="memdoc"> 710 <p>Get the element at specified index of array <code>obj</code> (which must be a json_object of type json_type_array)</p> 711 <p><em>No</em> reference counts will be changed, and ownership of the returned object remains with <code>obj</code>. See <a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a> for additional implications of this behavior.</p> 712 <p>Calling this with anything other than a json_type_array will trigger an assert.</p> 713 <dl class="params"><dt>Parameters</dt><dd> 714 <table class="params"> 715 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 716 <tr><td class="paramname">idx</td><td>the index to get the element at </td></tr> 717 </table> 718 </dd> 719 </dl> 720 <dl class="section return"><dt>Returns</dt><dd>the json_object at the specified index (or NULL) </dd></dl> 721 722 </div> 723 </div> 724 <a class="anchor" id="ab9ea8f9c72d5adf83fdcbfe69f97fa44"></a> 725 <div class="memitem"> 726 <div class="memproto"> 727 <table class="memname"> 728 <tr> 729 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> size_t json_object_array_length </td> 730 <td>(</td> 731 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 732 <td class="paramname"><em>obj</em></td><td>)</td> 733 <td></td> 734 </tr> 735 </table> 736 </div><div class="memdoc"> 737 <p>Get the length of a json_object of type json_type_array </p> 738 <dl class="params"><dt>Parameters</dt><dd> 739 <table class="params"> 740 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 741 </table> 742 </dd> 743 </dl> 744 <dl class="section return"><dt>Returns</dt><dd>an int </dd></dl> 745 746 </div> 747 </div> 748 <a class="anchor" id="a1ac0ccdbc13a25da7d8b2dc9e421dfad"></a> 749 <div class="memitem"> 750 <div class="memproto"> 751 <table class="memname"> 752 <tr> 753 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_array_put_idx </td> 754 <td>(</td> 755 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 756 <td class="paramname"><em>obj</em>, </td> 757 </tr> 758 <tr> 759 <td class="paramkey"></td> 760 <td></td> 761 <td class="paramtype">size_t </td> 762 <td class="paramname"><em>idx</em>, </td> 763 </tr> 764 <tr> 765 <td class="paramkey"></td> 766 <td></td> 767 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 768 <td class="paramname"><em>val</em> </td> 769 </tr> 770 <tr> 771 <td></td> 772 <td>)</td> 773 <td></td><td></td> 774 </tr> 775 </table> 776 </div><div class="memdoc"> 777 <p>Insert or replace an element at a specified index in an array (a json_object of type json_type_array)</p> 778 <p>The reference count will <em>not</em> be incremented. This is to make adding fields to objects in code more compact. If you want to retain a reference to an added object you must wrap the passed object with json_object_get</p> 779 <p>The reference count of a replaced object will be decremented.</p> 780 <p>The array size will be automatically be expanded to the size of the index if the index is larger than the current size.</p> 781 <dl class="params"><dt>Parameters</dt><dd> 782 <table class="params"> 783 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 784 <tr><td class="paramname">idx</td><td>the index to insert the element at </td></tr> 785 <tr><td class="paramname">val</td><td>the json_object to be added </td></tr> 786 </table> 787 </dd> 788 </dl> 789 790 </div> 791 </div> 792 <a class="anchor" id="a95552402a95c9470b230052d92270247"></a> 793 <div class="memitem"> 794 <div class="memproto"> 795 <table class="memname"> 796 <tr> 797 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_array_shrink </td> 798 <td>(</td> 799 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 800 <td class="paramname"><em>jso</em>, </td> 801 </tr> 802 <tr> 803 <td class="paramkey"></td> 804 <td></td> 805 <td class="paramtype">int </td> 806 <td class="paramname"><em>empty_slots</em> </td> 807 </tr> 808 <tr> 809 <td></td> 810 <td>)</td> 811 <td></td><td></td> 812 </tr> 813 </table> 814 </div><div class="memdoc"> 815 <p>Shrink the internal memory allocation of the array to just enough to fit the number of elements in it, plus empty_slots.</p> 816 <dl class="params"><dt>Parameters</dt><dd> 817 <table class="params"> 818 <tr><td class="paramname">jso</td><td>the json_object instance, must be json_type_array </td></tr> 819 <tr><td class="paramname">empty_slots</td><td>the number of empty slots to leave allocated </td></tr> 820 </table> 821 </dd> 822 </dl> 823 824 </div> 825 </div> 826 <a class="anchor" id="a5584e2f2051cd1faa7fafd07ba888fd1"></a> 827 <div class="memitem"> 828 <div class="memproto"> 829 <table class="memname"> 830 <tr> 831 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void json_object_array_sort </td> 832 <td>(</td> 833 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 834 <td class="paramname"><em>jso</em>, </td> 835 </tr> 836 <tr> 837 <td class="paramkey"></td> 838 <td></td> 839 <td class="paramtype">int(*)(const void *, const void *) </td> 840 <td class="paramname"><em>sort_fn</em> </td> 841 </tr> 842 <tr> 843 <td></td> 844 <td>)</td> 845 <td></td><td></td> 846 </tr> 847 </table> 848 </div><div class="memdoc"> 849 <p>Sorts the elements of jso of type json_type_array</p> 850 <p>Pointers to the json_object pointers will be passed as the two arguments to sort_fn</p> 851 <dl class="params"><dt>Parameters</dt><dd> 852 <table class="params"> 853 <tr><td class="paramname">jso</td><td>the json_object instance </td></tr> 854 <tr><td class="paramname">sort_fn</td><td>a sorting function </td></tr> 855 </table> 856 </dd> 857 </dl> 858 859 </div> 860 </div> 861 <a class="anchor" id="aaac16505f13bc56accfad82604d8bcdc"></a> 862 <div class="memitem"> 863 <div class="memproto"> 864 <table class="memname"> 865 <tr> 866 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_deep_copy </td> 867 <td>(</td> 868 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 869 <td class="paramname"><em>src</em>, </td> 870 </tr> 871 <tr> 872 <td class="paramkey"></td> 873 <td></td> 874 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> ** </td> 875 <td class="paramname"><em>dst</em>, </td> 876 </tr> 877 <tr> 878 <td class="paramkey"></td> 879 <td></td> 880 <td class="paramtype"><a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_c_shallow_copy_fn</a> * </td> 881 <td class="paramname"><em>shallow_copy</em> </td> 882 </tr> 883 <tr> 884 <td></td> 885 <td>)</td> 886 <td></td><td></td> 887 </tr> 888 </table> 889 </div><div class="memdoc"> 890 <p>Copy the contents of the JSON object. The destination object must be initialized to NULL, to make sure this function won't overwrite an existing JSON object.</p> 891 <p>This does roughly the same thing as <code>json_tokener_parse(json_object_get_string(src))</code>.</p> 892 <dl class="params"><dt>Parameters</dt><dd> 893 <table class="params"> 894 <tr><td class="paramname">src</td><td>source JSON object whose contents will be copied </td></tr> 895 <tr><td class="paramname">dst</td><td>pointer to the destination object where the contents of <code>src</code>; make sure this pointer is initialized to NULL </td></tr> 896 <tr><td class="paramname">shallow_copy</td><td>an optional function to copy individual objects, needed when custom serializers are in use. See also json_object set_serializer.</td></tr> 897 </table> 898 </dd> 899 </dl> 900 <dl class="section return"><dt>Returns</dt><dd>0 if the copy went well, -1 if an error occured during copy or if the destination pointer is non-NULL </dd></dl> 901 902 </div> 903 </div> 904 <a class="anchor" id="ada262c62364e3819b6a64b1e3a632336"></a> 905 <div class="memitem"> 906 <div class="memproto"> 907 <table class="memname"> 908 <tr> 909 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_double_to_json_string </td> 910 <td>(</td> 911 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 912 <td class="paramname"><em>jso</em>, </td> 913 </tr> 914 <tr> 915 <td class="paramkey"></td> 916 <td></td> 917 <td class="paramtype">struct <a class="el" href="structprintbuf.html">printbuf</a> * </td> 918 <td class="paramname"><em>pb</em>, </td> 919 </tr> 920 <tr> 921 <td class="paramkey"></td> 922 <td></td> 923 <td class="paramtype">int </td> 924 <td class="paramname"><em>level</em>, </td> 925 </tr> 926 <tr> 927 <td class="paramkey"></td> 928 <td></td> 929 <td class="paramtype">int </td> 930 <td class="paramname"><em>flags</em> </td> 931 </tr> 932 <tr> 933 <td></td> 934 <td>)</td> 935 <td></td><td></td> 936 </tr> 937 </table> 938 </div><div class="memdoc"> 939 <p>Serialize a json_object of type json_type_double to a string.</p> 940 <p>This function isn't meant to be called directly. Instead, you can set a custom format string for the serialization of this double using the following call (where "%.17g" actually is the default):</p> 941 <div class="fragment"><div class="line">jso = <a class="code" href="json__object_8h.html#a594a093bafb9091f843da3197e0638aa">json_object_new_double</a>(d);</div> 942 <div class="line"><a class="code" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer</a>(jso, <a class="code" href="json__object_8h.html#ada262c62364e3819b6a64b1e3a632336">json_object_double_to_json_string</a>,</div> 943 <div class="line"> <span class="stringliteral">"%.17g"</span>, NULL);</div> 944 </div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd>printf(3) man page for format strings</dd></dl> 945 <dl class="params"><dt>Parameters</dt><dd> 946 <table class="params"> 947 <tr><td class="paramname">jso</td><td>The json_type_double object that is serialized. </td></tr> 948 <tr><td class="paramname">pb</td><td>The destination buffer. </td></tr> 949 <tr><td class="paramname">level</td><td>Ignored. </td></tr> 950 <tr><td class="paramname">flags</td><td>Ignored. </td></tr> 951 </table> 952 </dd> 953 </dl> 954 955 </div> 956 </div> 957 <a class="anchor" id="a5a1d4640525e0217059868e312f20579"></a> 958 <div class="memitem"> 959 <div class="memproto"> 960 <table class="memname"> 961 <tr> 962 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_equal </td> 963 <td>(</td> 964 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 965 <td class="paramname"><em>obj1</em>, </td> 966 </tr> 967 <tr> 968 <td class="paramkey"></td> 969 <td></td> 970 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 971 <td class="paramname"><em>obj2</em> </td> 972 </tr> 973 <tr> 974 <td></td> 975 <td>)</td> 976 <td></td><td></td> 977 </tr> 978 </table> 979 </div><div class="memdoc"> 980 <p>Check if two json_object's are equal</p> 981 <p>If the passed objects are equal 1 will be returned. Equality is defined as follows:</p> 982 <ul> 983 <li>json_objects of different types are never equal</li> 984 <li>json_objects of the same primitive type are equal if the c-representation of their value is equal</li> 985 <li>json-arrays are considered equal if all values at the same indices are equal (same order)</li> 986 <li>Complex json_objects are considered equal if all contained objects referenced by their key are equal, regardless their order.</li> 987 </ul> 988 <dl class="params"><dt>Parameters</dt><dd> 989 <table class="params"> 990 <tr><td class="paramname">obj1</td><td>the first json_object instance </td></tr> 991 <tr><td class="paramname">obj2</td><td>the second json_object instance </td></tr> 992 </table> 993 </dd> 994 </dl> 995 <dl class="section return"><dt>Returns</dt><dd>whether both objects are equal or not </dd></dl> 996 997 </div> 998 </div> 999 <a class="anchor" id="a675aa3a9cced685dbfd1c1a770a0c3e4"></a> 1000 <div class="memitem"> 1001 <div class="memproto"> 1002 <table class="mlabels"> 1003 <tr> 1004 <td class="mlabels-left"> 1005 <table class="memname"> 1006 <tr> 1007 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_get </td> 1008 <td>(</td> 1009 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1010 <td class="paramname"><em>obj</em></td><td>)</td> 1011 <td></td> 1012 </tr> 1013 </table> 1014 </td> 1015 <td class="mlabels-right"> 1016 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1017 </tr> 1018 </table> 1019 </div><div class="memdoc"> 1020 <p>Increment the reference count of json_object, thereby taking ownership of it.</p> 1021 <p>Cases where you might need to increase the refcount include:</p> 1022 <ul> 1023 <li>Using an object field or array index (retrieved through <code><a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a></code> or <code><a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx()</a></code>) beyond the lifetime of the parent object.</li> 1024 <li>Detaching an object field or array index from its parent object (using <code><a class="el" href="json__object_8h.html#ac6605fdafca20bd5d33c84f4f80a3bda">json_object_object_del()</a></code> or <code><a class="el" href="json__object_8h.html#a722eca9f578704d3af38b97549242c1f">json_object_array_del_idx()</a></code>)</li> 1025 <li>Sharing a json_object with multiple (not necesarily parallel) threads of execution that all expect to free it (with <code><a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a></code>) when they're done.</li> 1026 </ul> 1027 <dl class="params"><dt>Parameters</dt><dd> 1028 <table class="params"> 1029 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1030 </table> 1031 </dd> 1032 </dl> 1033 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a> </dd> 1034 <dd> 1035 <a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a> </dd> 1036 <dd> 1037 <a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx()</a> </dd></dl> 1038 1039 </div> 1040 </div> 1041 <a class="anchor" id="a23d20e3f886c1638a7116be66b7b5ec2"></a> 1042 <div class="memitem"> 1043 <div class="memproto"> 1044 <table class="mlabels"> 1045 <tr> 1046 <td class="mlabels-left"> 1047 <table class="memname"> 1048 <tr> 1049 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structarray__list.html">array_list</a>* json_object_get_array </td> 1050 <td>(</td> 1051 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1052 <td class="paramname"><em>obj</em></td><td>)</td> 1053 <td></td> 1054 </tr> 1055 </table> 1056 </td> 1057 <td class="mlabels-right"> 1058 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1059 </tr> 1060 </table> 1061 </div><div class="memdoc"> 1062 <p>Get the arraylist of a json_object of type json_type_array </p> 1063 <dl class="params"><dt>Parameters</dt><dd> 1064 <table class="params"> 1065 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1066 </table> 1067 </dd> 1068 </dl> 1069 <dl class="section return"><dt>Returns</dt><dd>an arraylist </dd></dl> 1070 1071 </div> 1072 </div> 1073 <a class="anchor" id="ac003fb99db7ecd674bb16d983d2f92ee"></a> 1074 <div class="memitem"> 1075 <div class="memproto"> 1076 <table class="memname"> 1077 <tr> 1078 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> json_object_get_boolean </td> 1079 <td>(</td> 1080 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1081 <td class="paramname"><em>obj</em></td><td>)</td> 1082 <td></td> 1083 </tr> 1084 </table> 1085 </div><div class="memdoc"> 1086 <p>Get the json_bool value of a json_object</p> 1087 <p>The type is coerced to a json_bool if the passed object is not a json_bool. integer and double objects will return 0 if there value is zero or 1 otherwise. If the passed object is a string it will return 1 if it has a non zero length. If any other object type is passed 1 will be returned if the object is not NULL.</p> 1088 <dl class="params"><dt>Parameters</dt><dd> 1089 <table class="params"> 1090 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1091 </table> 1092 </dd> 1093 </dl> 1094 <dl class="section return"><dt>Returns</dt><dd>a json_bool </dd></dl> 1095 1096 </div> 1097 </div> 1098 <a class="anchor" id="a94a70cff6a14398b581b7b10b0792c5b"></a> 1099 <div class="memitem"> 1100 <div class="memproto"> 1101 <table class="memname"> 1102 <tr> 1103 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> double json_object_get_double </td> 1104 <td>(</td> 1105 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1106 <td class="paramname"><em>obj</em></td><td>)</td> 1107 <td></td> 1108 </tr> 1109 </table> 1110 </div><div class="memdoc"> 1111 <p>Get the double floating point value of a json_object</p> 1112 <p>The type is coerced to a double if the passed object is not a double. integer objects will return their double conversion. Strings will be parsed as a double. If no conversion exists then 0.0 is returned and errno is set to EINVAL. null is equivalent to 0 (no error values set)</p> 1113 <p>If the value is too big to fit in a double, then the value is set to the closest infinity with errno set to ERANGE. If strings cannot be converted to their double value, then EINVAL is set & NaN is returned.</p> 1114 <p>Arrays of length 0 are interpreted as 0 (with no error flags set). Arrays of length 1 are effectively cast to the equivalent object and converted using the above rules. All other arrays set the error to EINVAL & return NaN.</p> 1115 <p>NOTE: Set errno to 0 directly before a call to this function to determine whether or not conversion was successful (it does not clear the value for you).</p> 1116 <dl class="params"><dt>Parameters</dt><dd> 1117 <table class="params"> 1118 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1119 </table> 1120 </dd> 1121 </dl> 1122 <dl class="section return"><dt>Returns</dt><dd>a double floating point number </dd></dl> 1123 1124 </div> 1125 </div> 1126 <a class="anchor" id="a8c56dc58a02f92cd6789ba5dcb9fe7b1"></a> 1127 <div class="memitem"> 1128 <div class="memproto"> 1129 <table class="memname"> 1130 <tr> 1131 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int32_t json_object_get_int </td> 1132 <td>(</td> 1133 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1134 <td class="paramname"><em>obj</em></td><td>)</td> 1135 <td></td> 1136 </tr> 1137 </table> 1138 </div><div class="memdoc"> 1139 <p>Get the int value of a json_object</p> 1140 <p>The type is coerced to a int if the passed object is not a int. double objects will return their integer conversion. Strings will be parsed as an integer. If no conversion exists then 0 is returned and errno is set to EINVAL. null is equivalent to 0 (no error values set)</p> 1141 <p>Note that integers are stored internally as 64-bit values. If the value of too big or too small to fit into 32-bit, INT32_MAX or INT32_MIN are returned, respectively.</p> 1142 <dl class="params"><dt>Parameters</dt><dd> 1143 <table class="params"> 1144 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1145 </table> 1146 </dd> 1147 </dl> 1148 <dl class="section return"><dt>Returns</dt><dd>an int </dd></dl> 1149 1150 </div> 1151 </div> 1152 <a class="anchor" id="a1a14750b3af4df18ec8dc93b090a8e8a"></a> 1153 <div class="memitem"> 1154 <div class="memproto"> 1155 <table class="memname"> 1156 <tr> 1157 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int64_t json_object_get_int64 </td> 1158 <td>(</td> 1159 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1160 <td class="paramname"><em>obj</em></td><td>)</td> 1161 <td></td> 1162 </tr> 1163 </table> 1164 </div><div class="memdoc"> 1165 <p>Get the int value of a json_object</p> 1166 <p>The type is coerced to a int64 if the passed object is not a int64. double objects will return their int64 conversion. Strings will be parsed as an int64. If no conversion exists then 0 is returned.</p> 1167 <p>NOTE: Set errno to 0 directly before a call to this function to determine whether or not conversion was successful (it does not clear the value for you).</p> 1168 <dl class="params"><dt>Parameters</dt><dd> 1169 <table class="params"> 1170 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1171 </table> 1172 </dd> 1173 </dl> 1174 <dl class="section return"><dt>Returns</dt><dd>an int64 </dd></dl> 1175 1176 </div> 1177 </div> 1178 <a class="anchor" id="a2caa52ae1863bd073444f3737138a4db"></a> 1179 <div class="memitem"> 1180 <div class="memproto"> 1181 <table class="mlabels"> 1182 <tr> 1183 <td class="mlabels-left"> 1184 <table class="memname"> 1185 <tr> 1186 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="structlh__table.html">lh_table</a>* json_object_get_object </td> 1187 <td>(</td> 1188 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1189 <td class="paramname"><em>obj</em></td><td>)</td> 1190 <td></td> 1191 </tr> 1192 </table> 1193 </td> 1194 <td class="mlabels-right"> 1195 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1196 </tr> 1197 </table> 1198 </div><div class="memdoc"> 1199 <p>Get the hashtable of a json_object of type json_type_object </p> 1200 <dl class="params"><dt>Parameters</dt><dd> 1201 <table class="params"> 1202 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1203 </table> 1204 </dd> 1205 </dl> 1206 <dl class="section return"><dt>Returns</dt><dd>a linkhash </dd></dl> 1207 1208 </div> 1209 </div> 1210 <a class="anchor" id="a9ee29ca8d79896e15007131527f6002e"></a> 1211 <div class="memitem"> 1212 <div class="memproto"> 1213 <table class="memname"> 1214 <tr> 1215 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char* json_object_get_string </td> 1216 <td>(</td> 1217 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1218 <td class="paramname"><em>obj</em></td><td>)</td> 1219 <td></td> 1220 </tr> 1221 </table> 1222 </div><div class="memdoc"> 1223 <p>Get the string value of a json_object</p> 1224 <p>If the passed object is of type json_type_null (i.e. obj == NULL), NULL is returned.</p> 1225 <p>If the passed object of type json_type_string, the string contents are returned.</p> 1226 <p>Otherwise the JSON representation of the object is returned.</p> 1227 <p>The returned string memory is managed by the json_object and will be freed when the reference count of the json_object drops to zero.</p> 1228 <dl class="params"><dt>Parameters</dt><dd> 1229 <table class="params"> 1230 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1231 </table> 1232 </dd> 1233 </dl> 1234 <dl class="section return"><dt>Returns</dt><dd>a string or NULL </dd></dl> 1235 1236 </div> 1237 </div> 1238 <a class="anchor" id="ac1d1f95a27a5e5d93bb66a8adfc1a2f4"></a> 1239 <div class="memitem"> 1240 <div class="memproto"> 1241 <table class="memname"> 1242 <tr> 1243 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_get_string_len </td> 1244 <td>(</td> 1245 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1246 <td class="paramname"><em>obj</em></td><td>)</td> 1247 <td></td> 1248 </tr> 1249 </table> 1250 </div><div class="memdoc"> 1251 <p>Get the string length of a json_object</p> 1252 <p>If the passed object is not of type json_type_string then zero will be returned.</p> 1253 <dl class="params"><dt>Parameters</dt><dd> 1254 <table class="params"> 1255 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1256 </table> 1257 </dd> 1258 </dl> 1259 <dl class="section return"><dt>Returns</dt><dd>int </dd></dl> 1260 1261 </div> 1262 </div> 1263 <a class="anchor" id="af256a3a7910e271a2b9735e5044c3827"></a> 1264 <div class="memitem"> 1265 <div class="memproto"> 1266 <table class="memname"> 1267 <tr> 1268 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> enum <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06c">json_type</a> json_object_get_type </td> 1269 <td>(</td> 1270 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1271 <td class="paramname"><em>obj</em></td><td>)</td> 1272 <td></td> 1273 </tr> 1274 </table> 1275 </div><div class="memdoc"> 1276 <p>Get the type of the json_object. See also <a class="el" href="json__util_8h.html#a762aaf3df0a9c7b6919cdc1035348012">json_type_to_name()</a> to turn this into a string suitable, for instance, for logging.</p> 1277 <dl class="params"><dt>Parameters</dt><dd> 1278 <table class="params"> 1279 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1280 </table> 1281 </dd> 1282 </dl> 1283 <dl class="section return"><dt>Returns</dt><dd>type being one of: json_type_null (i.e. obj == NULL), json_type_boolean, json_type_double, json_type_int, json_type_object, json_type_array, json_type_string </dd></dl> 1284 1285 </div> 1286 </div> 1287 <a class="anchor" id="a82c27579b6d25d9d0eb3b72758d8b71d"></a> 1288 <div class="memitem"> 1289 <div class="memproto"> 1290 <table class="memname"> 1291 <tr> 1292 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> uint64_t json_object_get_uint64 </td> 1293 <td>(</td> 1294 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1295 <td class="paramname"><em>obj</em></td><td>)</td> 1296 <td></td> 1297 </tr> 1298 </table> 1299 </div><div class="memdoc"> 1300 <p>Get the uint value of a json_object</p> 1301 <p>The type is coerced to a uint64 if the passed object is not a uint64. double objects will return their uint64 conversion. Strings will be parsed as an uint64. If no conversion exists then 0 is returned.</p> 1302 <p>NOTE: Set errno to 0 directly before a call to this function to determine whether or not conversion was successful (it does not clear the value for you).</p> 1303 <dl class="params"><dt>Parameters</dt><dd> 1304 <table class="params"> 1305 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1306 </table> 1307 </dd> 1308 </dl> 1309 <dl class="section return"><dt>Returns</dt><dd>an uint64 </dd></dl> 1310 1311 </div> 1312 </div> 1313 <a class="anchor" id="ae925f3ec0f61cba5ea3dd50e0315f194"></a> 1314 <div class="memitem"> 1315 <div class="memproto"> 1316 <table class="memname"> 1317 <tr> 1318 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void* json_object_get_userdata </td> 1319 <td>(</td> 1320 <td class="paramtype"><a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1321 <td class="paramname"><em>jso</em></td><td>)</td> 1322 <td></td> 1323 </tr> 1324 </table> 1325 </div><div class="memdoc"> 1326 <p>Returns the userdata set by <a class="el" href="json__object_8h.html#a4ee4281ccd123c62878e931a0a3bc43b">json_object_set_userdata()</a> or <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer()</a></p> 1327 <dl class="params"><dt>Parameters</dt><dd> 1328 <table class="params"> 1329 <tr><td class="paramname">jso</td><td>the object to return the userdata for </td></tr> 1330 </table> 1331 </dd> 1332 </dl> 1333 1334 </div> 1335 </div> 1336 <a class="anchor" id="a25691322b2d1ab24a3797e5752eb659f"></a> 1337 <div class="memitem"> 1338 <div class="memproto"> 1339 <table class="memname"> 1340 <tr> 1341 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_int_inc </td> 1342 <td>(</td> 1343 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1344 <td class="paramname"><em>obj</em>, </td> 1345 </tr> 1346 <tr> 1347 <td class="paramkey"></td> 1348 <td></td> 1349 <td class="paramtype">int64_t </td> 1350 <td class="paramname"><em>val</em> </td> 1351 </tr> 1352 <tr> 1353 <td></td> 1354 <td>)</td> 1355 <td></td><td></td> 1356 </tr> 1357 </table> 1358 </div><div class="memdoc"> 1359 <p>Increment a json_type_int object by the given amount, which may be negative.</p> 1360 <p>If the type of obj is not json_type_int then 0 is returned with no further action taken. If the addition would result in a overflow, the object value is set to INT64_MAX. If the addition would result in a underflow, the object value is set to INT64_MIN. Neither overflow nor underflow affect the return value.</p> 1361 <dl class="params"><dt>Parameters</dt><dd> 1362 <table class="params"> 1363 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1364 <tr><td class="paramname">val</td><td>the value to add </td></tr> 1365 </table> 1366 </dd> 1367 </dl> 1368 <dl class="section return"><dt>Returns</dt><dd>1 if the increment succeded, 0 otherwise </dd></dl> 1369 1370 </div> 1371 </div> 1372 <a class="anchor" id="a8ab506a3d8f4ba5eb6a12ce0a6bbd37b"></a> 1373 <div class="memitem"> 1374 <div class="memproto"> 1375 <table class="memname"> 1376 <tr> 1377 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_is_type </td> 1378 <td>(</td> 1379 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1380 <td class="paramname"><em>obj</em>, </td> 1381 </tr> 1382 <tr> 1383 <td class="paramkey"></td> 1384 <td></td> 1385 <td class="paramtype">enum <a class="el" href="json__types_8h.html#ac75c61993722a9b8aaa44704072ec06c">json_type</a> </td> 1386 <td class="paramname"><em>type</em> </td> 1387 </tr> 1388 <tr> 1389 <td></td> 1390 <td>)</td> 1391 <td></td><td></td> 1392 </tr> 1393 </table> 1394 </div><div class="memdoc"> 1395 <p>Check if the json_object is of a given type </p> 1396 <dl class="params"><dt>Parameters</dt><dd> 1397 <table class="params"> 1398 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1399 <tr><td class="paramname">type</td><td>one of: json_type_null (i.e. obj == NULL), json_type_boolean, json_type_double, json_type_int, json_type_object, json_type_array, json_type_string </td></tr> 1400 </table> 1401 </dd> 1402 </dl> 1403 1404 </div> 1405 </div> 1406 <a class="anchor" id="a84f7f8c0774c4600d958561d7548d649"></a> 1407 <div class="memitem"> 1408 <div class="memproto"> 1409 <table class="mlabels"> 1410 <tr> 1411 <td class="mlabels-left"> 1412 <table class="memname"> 1413 <tr> 1414 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_array </td> 1415 <td>(</td> 1416 <td class="paramtype">void </td> 1417 <td class="paramname"></td><td>)</td> 1418 <td></td> 1419 </tr> 1420 </table> 1421 </td> 1422 <td class="mlabels-right"> 1423 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1424 </tr> 1425 </table> 1426 </div><div class="memdoc"> 1427 <p>Create a new empty json_object of type json_type_array with 32 slots allocated. If you know the array size you'll need ahead of time, use <a class="el" href="json__object_8h.html#a62af9fb3b02fb153190369d949394b26">json_object_new_array_ext()</a> instead. </p> 1428 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#a62af9fb3b02fb153190369d949394b26">json_object_new_array_ext()</a> </dd> 1429 <dd> 1430 <a class="el" href="json__object_8h.html#a95552402a95c9470b230052d92270247">json_object_array_shrink()</a> </dd></dl> 1431 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_array </dd></dl> 1432 1433 </div> 1434 </div> 1435 <a class="anchor" id="a62af9fb3b02fb153190369d949394b26"></a> 1436 <div class="memitem"> 1437 <div class="memproto"> 1438 <table class="mlabels"> 1439 <tr> 1440 <td class="mlabels-left"> 1441 <table class="memname"> 1442 <tr> 1443 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_array_ext </td> 1444 <td>(</td> 1445 <td class="paramtype">int </td> 1446 <td class="paramname"><em>initial_size</em></td><td>)</td> 1447 <td></td> 1448 </tr> 1449 </table> 1450 </td> 1451 <td class="mlabels-right"> 1452 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1453 </tr> 1454 </table> 1455 </div><div class="memdoc"> 1456 <p>Create a new empty json_object of type json_type_array with the desired number of slots allocated. </p> 1457 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#a95552402a95c9470b230052d92270247">json_object_array_shrink()</a> </dd></dl> 1458 <dl class="params"><dt>Parameters</dt><dd> 1459 <table class="params"> 1460 <tr><td class="paramname">initial_size</td><td>the number of slots to allocate </td></tr> 1461 </table> 1462 </dd> 1463 </dl> 1464 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_array </dd></dl> 1465 1466 </div> 1467 </div> 1468 <a class="anchor" id="a2e290acd80e72cca745f89fb4600fb78"></a> 1469 <div class="memitem"> 1470 <div class="memproto"> 1471 <table class="mlabels"> 1472 <tr> 1473 <td class="mlabels-left"> 1474 <table class="memname"> 1475 <tr> 1476 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_boolean </td> 1477 <td>(</td> 1478 <td class="paramtype"><a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> </td> 1479 <td class="paramname"><em>b</em></td><td>)</td> 1480 <td></td> 1481 </tr> 1482 </table> 1483 </td> 1484 <td class="mlabels-right"> 1485 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1486 </tr> 1487 </table> 1488 </div><div class="memdoc"> 1489 <p>Create a new empty json_object of type json_type_boolean </p> 1490 <dl class="params"><dt>Parameters</dt><dd> 1491 <table class="params"> 1492 <tr><td class="paramname">b</td><td>a json_bool 1 or 0 </td></tr> 1493 </table> 1494 </dd> 1495 </dl> 1496 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_boolean </dd></dl> 1497 1498 </div> 1499 </div> 1500 <a class="anchor" id="a594a093bafb9091f843da3197e0638aa"></a> 1501 <div class="memitem"> 1502 <div class="memproto"> 1503 <table class="mlabels"> 1504 <tr> 1505 <td class="mlabels-left"> 1506 <table class="memname"> 1507 <tr> 1508 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_double </td> 1509 <td>(</td> 1510 <td class="paramtype">double </td> 1511 <td class="paramname"><em>d</em></td><td>)</td> 1512 <td></td> 1513 </tr> 1514 </table> 1515 </td> 1516 <td class="mlabels-right"> 1517 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1518 </tr> 1519 </table> 1520 </div><div class="memdoc"> 1521 <p>Create a new empty json_object of type json_type_double</p> 1522 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#ada262c62364e3819b6a64b1e3a632336">json_object_double_to_json_string()</a> for how to set a custom format string.</dd></dl> 1523 <dl class="params"><dt>Parameters</dt><dd> 1524 <table class="params"> 1525 <tr><td class="paramname">d</td><td>the double </td></tr> 1526 </table> 1527 </dd> 1528 </dl> 1529 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_double </dd></dl> 1530 1531 </div> 1532 </div> 1533 <a class="anchor" id="ae49671c026fe1ada370a75321e4e65f6"></a> 1534 <div class="memitem"> 1535 <div class="memproto"> 1536 <table class="mlabels"> 1537 <tr> 1538 <td class="mlabels-left"> 1539 <table class="memname"> 1540 <tr> 1541 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_double_s </td> 1542 <td>(</td> 1543 <td class="paramtype">double </td> 1544 <td class="paramname"><em>d</em>, </td> 1545 </tr> 1546 <tr> 1547 <td class="paramkey"></td> 1548 <td></td> 1549 <td class="paramtype">const char * </td> 1550 <td class="paramname"><em>ds</em> </td> 1551 </tr> 1552 <tr> 1553 <td></td> 1554 <td>)</td> 1555 <td></td><td></td> 1556 </tr> 1557 </table> 1558 </td> 1559 <td class="mlabels-right"> 1560 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1561 </tr> 1562 </table> 1563 </div><div class="memdoc"> 1564 <p>Create a new json_object of type json_type_double, using the exact serialized representation of the value.</p> 1565 <p>This allows for numbers that would otherwise get displayed inefficiently (e.g. 12.3 => "12.300000000000001") to be serialized with the more convenient form.</p> 1566 <p>Notes:</p> 1567 <p>This is used by <a class="el" href="json__tokener_8h.html#a61679f178111963a9ffa3c8179553f7a">json_tokener_parse_ex()</a> to allow for an exact re-serialization of a parsed object.</p> 1568 <p>The userdata field is used to store the string representation, so it can't be used for other data if this function is used.</p> 1569 <p>A roughly equivalent sequence of calls, with the difference being that the serialization function won't be reset by <a class="el" href="json__object_8h.html#a3a7b7ce585565558cb69dad8d45d7757">json_object_set_double()</a>, is: </p> 1570 <div class="fragment"><div class="line">jso = <a class="code" href="json__object_8h.html#a594a093bafb9091f843da3197e0638aa">json_object_new_double</a>(d);</div> 1571 <div class="line"><a class="code" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer</a>(jso, <a class="code" href="json__object_8h.html#a56091ddbd2ec6d6200558cbeff1b86b8">json_object_userdata_to_json_string</a>,</div> 1572 <div class="line"> strdup(ds), <a class="code" href="json__object_8h.html#aff3190c34884bea3b4e65e286b973d89">json_object_free_userdata</a>);</div> 1573 </div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd> 1574 <table class="params"> 1575 <tr><td class="paramname">d</td><td>the numeric value of the double. </td></tr> 1576 <tr><td class="paramname">ds</td><td>the string representation of the double. This will be copied. </td></tr> 1577 </table> 1578 </dd> 1579 </dl> 1580 1581 </div> 1582 </div> 1583 <a class="anchor" id="ae92f0770fb4b3c884ce35de52d3d7de8"></a> 1584 <div class="memitem"> 1585 <div class="memproto"> 1586 <table class="mlabels"> 1587 <tr> 1588 <td class="mlabels-left"> 1589 <table class="memname"> 1590 <tr> 1591 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_int </td> 1592 <td>(</td> 1593 <td class="paramtype">int32_t </td> 1594 <td class="paramname"><em>i</em></td><td>)</td> 1595 <td></td> 1596 </tr> 1597 </table> 1598 </td> 1599 <td class="mlabels-right"> 1600 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1601 </tr> 1602 </table> 1603 </div><div class="memdoc"> 1604 <p>Create a new empty json_object of type json_type_int Note that values are stored as 64-bit values internally. To ensure the full range is maintained, use json_object_new_int64 instead. </p> 1605 <dl class="params"><dt>Parameters</dt><dd> 1606 <table class="params"> 1607 <tr><td class="paramname">i</td><td>the integer </td></tr> 1608 </table> 1609 </dd> 1610 </dl> 1611 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_int </dd></dl> 1612 1613 </div> 1614 </div> 1615 <a class="anchor" id="a7847f74494645c2b076505c37cc4cb93"></a> 1616 <div class="memitem"> 1617 <div class="memproto"> 1618 <table class="mlabels"> 1619 <tr> 1620 <td class="mlabels-left"> 1621 <table class="memname"> 1622 <tr> 1623 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_int64 </td> 1624 <td>(</td> 1625 <td class="paramtype">int64_t </td> 1626 <td class="paramname"><em>i</em></td><td>)</td> 1627 <td></td> 1628 </tr> 1629 </table> 1630 </td> 1631 <td class="mlabels-right"> 1632 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1633 </tr> 1634 </table> 1635 </div><div class="memdoc"> 1636 <p>Create a new empty json_object of type json_type_int </p> 1637 <dl class="params"><dt>Parameters</dt><dd> 1638 <table class="params"> 1639 <tr><td class="paramname">i</td><td>the integer </td></tr> 1640 </table> 1641 </dd> 1642 </dl> 1643 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_int </dd></dl> 1644 1645 </div> 1646 </div> 1647 <a class="anchor" id="a29e23b5be729c679960242b3b81bcde0"></a> 1648 <div class="memitem"> 1649 <div class="memproto"> 1650 <table class="mlabels"> 1651 <tr> 1652 <td class="mlabels-left"> 1653 <table class="memname"> 1654 <tr> 1655 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_null </td> 1656 <td>(</td> 1657 <td class="paramtype">void </td> 1658 <td class="paramname"></td><td>)</td> 1659 <td></td> 1660 </tr> 1661 </table> 1662 </td> 1663 <td class="mlabels-right"> 1664 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1665 </tr> 1666 </table> 1667 </div><div class="memdoc"> 1668 <p>This method exists only to provide a complementary function along the lines of the other json_object_new_* functions. It always returns NULL, and it is entirely acceptable to simply use NULL directly. </p> 1669 1670 </div> 1671 </div> 1672 <a class="anchor" id="a68c383f54544fca19b5f2425be397600"></a> 1673 <div class="memitem"> 1674 <div class="memproto"> 1675 <table class="mlabels"> 1676 <tr> 1677 <td class="mlabels-left"> 1678 <table class="memname"> 1679 <tr> 1680 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_object </td> 1681 <td>(</td> 1682 <td class="paramtype">void </td> 1683 <td class="paramname"></td><td>)</td> 1684 <td></td> 1685 </tr> 1686 </table> 1687 </td> 1688 <td class="mlabels-right"> 1689 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1690 </tr> 1691 </table> 1692 </div><div class="memdoc"> 1693 <p>Create a new empty object with a reference count of 1. The caller of this object initially has sole ownership. Remember, when using json_object_object_add or json_object_array_put_idx, ownership will transfer to the object/array. Call json_object_get if you want to maintain shared ownership or also add this object as a child of multiple objects or arrays. Any ownerships you acquired but did not transfer must be released through json_object_put.</p> 1694 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_object </dd></dl> 1695 1696 </div> 1697 </div> 1698 <a class="anchor" id="a7b7b5302b3903c9347eeb1f4a64d657b"></a> 1699 <div class="memitem"> 1700 <div class="memproto"> 1701 <table class="mlabels"> 1702 <tr> 1703 <td class="mlabels-left"> 1704 <table class="memname"> 1705 <tr> 1706 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_string </td> 1707 <td>(</td> 1708 <td class="paramtype">const char * </td> 1709 <td class="paramname"><em>s</em></td><td>)</td> 1710 <td></td> 1711 </tr> 1712 </table> 1713 </td> 1714 <td class="mlabels-right"> 1715 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1716 </tr> 1717 </table> 1718 </div><div class="memdoc"> 1719 <p>Create a new empty json_object of type json_type_string</p> 1720 <p>A copy of the string is made and the memory is managed by the json_object</p> 1721 <dl class="params"><dt>Parameters</dt><dd> 1722 <table class="params"> 1723 <tr><td class="paramname">s</td><td>the string </td></tr> 1724 </table> 1725 </dd> 1726 </dl> 1727 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_string </dd></dl> 1728 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#a778a1aa34a508d08daac3bdb83e24b52">json_object_new_string_len()</a> </dd></dl> 1729 1730 </div> 1731 </div> 1732 <a class="anchor" id="a778a1aa34a508d08daac3bdb83e24b52"></a> 1733 <div class="memitem"> 1734 <div class="memproto"> 1735 <table class="mlabels"> 1736 <tr> 1737 <td class="mlabels-left"> 1738 <table class="memname"> 1739 <tr> 1740 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_string_len </td> 1741 <td>(</td> 1742 <td class="paramtype">const char * </td> 1743 <td class="paramname"><em>s</em>, </td> 1744 </tr> 1745 <tr> 1746 <td class="paramkey"></td> 1747 <td></td> 1748 <td class="paramtype">const int </td> 1749 <td class="paramname"><em>len</em> </td> 1750 </tr> 1751 <tr> 1752 <td></td> 1753 <td>)</td> 1754 <td></td><td></td> 1755 </tr> 1756 </table> 1757 </td> 1758 <td class="mlabels-right"> 1759 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1760 </tr> 1761 </table> 1762 </div><div class="memdoc"> 1763 <p>Create a new empty json_object of type json_type_string and allocate len characters for the new string.</p> 1764 <p>A copy of the string is made and the memory is managed by the json_object</p> 1765 <dl class="params"><dt>Parameters</dt><dd> 1766 <table class="params"> 1767 <tr><td class="paramname">s</td><td>the string </td></tr> 1768 <tr><td class="paramname">len</td><td>max length of the new string </td></tr> 1769 </table> 1770 </dd> 1771 </dl> 1772 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_string </dd></dl> 1773 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#a7b7b5302b3903c9347eeb1f4a64d657b">json_object_new_string()</a> </dd></dl> 1774 1775 </div> 1776 </div> 1777 <a class="anchor" id="aa602ee5f6182b35f3f75a927320b4efd"></a> 1778 <div class="memitem"> 1779 <div class="memproto"> 1780 <table class="mlabels"> 1781 <tr> 1782 <td class="mlabels-left"> 1783 <table class="memname"> 1784 <tr> 1785 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_new_uint64 </td> 1786 <td>(</td> 1787 <td class="paramtype">uint64_t </td> 1788 <td class="paramname"><em>i</em></td><td>)</td> 1789 <td></td> 1790 </tr> 1791 </table> 1792 </td> 1793 <td class="mlabels-right"> 1794 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1795 </tr> 1796 </table> 1797 </div><div class="memdoc"> 1798 <p>Create a new empty json_object of type json_type_uint </p> 1799 <dl class="params"><dt>Parameters</dt><dd> 1800 <table class="params"> 1801 <tr><td class="paramname">i</td><td>the integer </td></tr> 1802 </table> 1803 </dd> 1804 </dl> 1805 <dl class="section return"><dt>Returns</dt><dd>a json_object of type json_type_uint </dd></dl> 1806 1807 </div> 1808 </div> 1809 <a class="anchor" id="a27bd808a022251059a43f1f6370441cd"></a> 1810 <div class="memitem"> 1811 <div class="memproto"> 1812 <table class="memname"> 1813 <tr> 1814 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_object_add </td> 1815 <td>(</td> 1816 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1817 <td class="paramname"><em>obj</em>, </td> 1818 </tr> 1819 <tr> 1820 <td class="paramkey"></td> 1821 <td></td> 1822 <td class="paramtype">const char * </td> 1823 <td class="paramname"><em>key</em>, </td> 1824 </tr> 1825 <tr> 1826 <td class="paramkey"></td> 1827 <td></td> 1828 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1829 <td class="paramname"><em>val</em> </td> 1830 </tr> 1831 <tr> 1832 <td></td> 1833 <td>)</td> 1834 <td></td><td></td> 1835 </tr> 1836 </table> 1837 </div><div class="memdoc"> 1838 <p>Add an object field to a json_object of type json_type_object</p> 1839 <p>The reference count of <code>val</code> will <em>not</em> be incremented, in effect transferring ownership that object to <code>obj</code>, and thus <code>val</code> will be freed when <code>obj</code> is. (i.e. through <code>json_object_put(obj)</code>)</p> 1840 <p>If you want to retain a reference to the added object, independent of the lifetime of obj, you must increment the refcount with <code>json_object_get(val)</code> (and later release it with <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>).</p> 1841 <p>Since ownership transfers to <code>obj</code>, you must make sure that you do in fact have ownership over <code>val</code>. For instance, <a class="el" href="json__object_8h.html#a68c383f54544fca19b5f2425be397600">json_object_new_object()</a> will give you ownership until you transfer it, whereas <a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a> does not.</p> 1842 <p>Any previous object stored under <code>key</code> in <code>obj</code> will have its refcount decremented, and be freed normally if that drops to zero.</p> 1843 <dl class="params"><dt>Parameters</dt><dd> 1844 <table class="params"> 1845 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1846 <tr><td class="paramname">key</td><td>the object field name (a private copy will be duplicated) </td></tr> 1847 <tr><td class="paramname">val</td><td>a json_object or NULL member to associate with the given field</td></tr> 1848 </table> 1849 </dd> 1850 </dl> 1851 <dl class="section return"><dt>Returns</dt><dd>On success, <code>0</code> is returned. On error, a negative value is returned. </dd></dl> 1852 1853 </div> 1854 </div> 1855 <a class="anchor" id="a57d3e444dd7db6b4510d21bf3716a002"></a> 1856 <div class="memitem"> 1857 <div class="memproto"> 1858 <table class="memname"> 1859 <tr> 1860 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_object_add_ex </td> 1861 <td>(</td> 1862 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1863 <td class="paramname"><em>obj</em>, </td> 1864 </tr> 1865 <tr> 1866 <td class="paramkey"></td> 1867 <td></td> 1868 <td class="paramtype">const char *const </td> 1869 <td class="paramname"><em>key</em>, </td> 1870 </tr> 1871 <tr> 1872 <td class="paramkey"></td> 1873 <td></td> 1874 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> *const </td> 1875 <td class="paramname"><em>val</em>, </td> 1876 </tr> 1877 <tr> 1878 <td class="paramkey"></td> 1879 <td></td> 1880 <td class="paramtype">const unsigned </td> 1881 <td class="paramname"><em>opts</em> </td> 1882 </tr> 1883 <tr> 1884 <td></td> 1885 <td>)</td> 1886 <td></td><td></td> 1887 </tr> 1888 </table> 1889 </div><div class="memdoc"> 1890 <p>Add an object field to a json_object of type json_type_object</p> 1891 <p>The semantics are identical to json_object_object_add, except that an additional flag fields gives you more control over some detail aspects of processing. See the description of JSON_C_OBJECT_ADD_* flags for more details.</p> 1892 <dl class="params"><dt>Parameters</dt><dd> 1893 <table class="params"> 1894 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1895 <tr><td class="paramname">key</td><td>the object field name (a private copy will be duplicated) </td></tr> 1896 <tr><td class="paramname">val</td><td>a json_object or NULL member to associate with the given field </td></tr> 1897 <tr><td class="paramname">opts</td><td>process-modifying options. To specify multiple options, use (OPT1|OPT2) </td></tr> 1898 </table> 1899 </dd> 1900 </dl> 1901 1902 </div> 1903 </div> 1904 <a class="anchor" id="ac6605fdafca20bd5d33c84f4f80a3bda"></a> 1905 <div class="memitem"> 1906 <div class="memproto"> 1907 <table class="memname"> 1908 <tr> 1909 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void json_object_object_del </td> 1910 <td>(</td> 1911 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1912 <td class="paramname"><em>obj</em>, </td> 1913 </tr> 1914 <tr> 1915 <td class="paramkey"></td> 1916 <td></td> 1917 <td class="paramtype">const char * </td> 1918 <td class="paramname"><em>key</em> </td> 1919 </tr> 1920 <tr> 1921 <td></td> 1922 <td>)</td> 1923 <td></td><td></td> 1924 </tr> 1925 </table> 1926 </div><div class="memdoc"> 1927 <p>Delete the given json_object field</p> 1928 <p>The reference count will be decremented for the deleted object. If there are no more owners of the value represented by this key, then the value is freed. Otherwise, the reference to the value will remain in memory.</p> 1929 <dl class="params"><dt>Parameters</dt><dd> 1930 <table class="params"> 1931 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1932 <tr><td class="paramname">key</td><td>the object field name </td></tr> 1933 </table> 1934 </dd> 1935 </dl> 1936 1937 </div> 1938 </div> 1939 <a class="anchor" id="a1a097805abb53b4c8a60d573730a8939"></a> 1940 <div class="memitem"> 1941 <div class="memproto"> 1942 <table class="mlabels"> 1943 <tr> 1944 <td class="mlabels-left"> 1945 <table class="memname"> 1946 <tr> 1947 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a>* json_object_object_get </td> 1948 <td>(</td> 1949 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1950 <td class="paramname"><em>obj</em>, </td> 1951 </tr> 1952 <tr> 1953 <td class="paramkey"></td> 1954 <td></td> 1955 <td class="paramtype">const char * </td> 1956 <td class="paramname"><em>key</em> </td> 1957 </tr> 1958 <tr> 1959 <td></td> 1960 <td>)</td> 1961 <td></td><td></td> 1962 </tr> 1963 </table> 1964 </td> 1965 <td class="mlabels-right"> 1966 <span class="mlabels"><span class="mlabel">read</span></span> </td> 1967 </tr> 1968 </table> 1969 </div><div class="memdoc"> 1970 <p>Get the json_object associate with a given object field. Deprecated/discouraged: used json_object_object_get_ex instead.</p> 1971 <p>This returns NULL if the field is found but its value is null, or if the field is not found, or if obj is not a json_type_object. If you need to distinguish between these cases, use <a class="el" href="json__object_8h.html#a90d5f16d58636f01d2ed1a6030c7366a">json_object_object_get_ex()</a>.</p> 1972 <p><em>No</em> reference counts will be changed. There is no need to manually adjust reference counts through the json_object_put/json_object_get methods unless you need to have the child (value) reference maintain a different lifetime than the owning parent (obj). Ownership of the returned value is retained by obj (do not do json_object_put unless you have done a json_object_get). If you delete the value from obj (json_object_object_del) and wish to access the returned reference afterwards, make sure you have first gotten shared ownership through json_object_get (& don't forget to do a json_object_put or transfer ownership to prevent a memory leak).</p> 1973 <dl class="params"><dt>Parameters</dt><dd> 1974 <table class="params"> 1975 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 1976 <tr><td class="paramname">key</td><td>the object field name </td></tr> 1977 </table> 1978 </dd> 1979 </dl> 1980 <dl class="section return"><dt>Returns</dt><dd>the json_object associated with the given field name </dd></dl> 1981 1982 </div> 1983 </div> 1984 <a class="anchor" id="a90d5f16d58636f01d2ed1a6030c7366a"></a> 1985 <div class="memitem"> 1986 <div class="memproto"> 1987 <table class="memname"> 1988 <tr> 1989 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> json_object_object_get_ex </td> 1990 <td>(</td> 1991 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 1992 <td class="paramname"><em>obj</em>, </td> 1993 </tr> 1994 <tr> 1995 <td class="paramkey"></td> 1996 <td></td> 1997 <td class="paramtype">const char * </td> 1998 <td class="paramname"><em>key</em>, </td> 1999 </tr> 2000 <tr> 2001 <td class="paramkey"></td> 2002 <td></td> 2003 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> ** </td> 2004 <td class="paramname"><em>value</em> </td> 2005 </tr> 2006 <tr> 2007 <td></td> 2008 <td>)</td> 2009 <td></td><td></td> 2010 </tr> 2011 </table> 2012 </div><div class="memdoc"> 2013 <p>Get the json_object associated with a given object field.</p> 2014 <p>This returns true if the key is found, false in all other cases (including if obj isn't a json_type_object).</p> 2015 <p><em>No</em> reference counts will be changed. There is no need to manually adjust reference counts through the json_object_put/json_object_get methods unless you need to have the child (value) reference maintain a different lifetime than the owning parent (obj). Ownership of value is retained by obj.</p> 2016 <dl class="params"><dt>Parameters</dt><dd> 2017 <table class="params"> 2018 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2019 <tr><td class="paramname">key</td><td>the object field name </td></tr> 2020 <tr><td class="paramname">value</td><td>a pointer where to store a reference to the json_object associated with the given field name.</td></tr> 2021 </table> 2022 </dd> 2023 </dl> 2024 <p>It is safe to pass a NULL value. </p> 2025 <dl class="section return"><dt>Returns</dt><dd>whether or not the key exists </dd></dl> 2026 2027 </div> 2028 </div> 2029 <a class="anchor" id="ad59a0ad2ec914a5eef90af53acae06d9"></a> 2030 <div class="memitem"> 2031 <div class="memproto"> 2032 <table class="memname"> 2033 <tr> 2034 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_object_length </td> 2035 <td>(</td> 2036 <td class="paramtype">const struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2037 <td class="paramname"><em>obj</em></td><td>)</td> 2038 <td></td> 2039 </tr> 2040 </table> 2041 </div><div class="memdoc"> 2042 <p>Get the size of an object in terms of the number of fields it has. </p> 2043 <dl class="params"><dt>Parameters</dt><dd> 2044 <table class="params"> 2045 <tr><td class="paramname">obj</td><td>the json_object whose length to return </td></tr> 2046 </table> 2047 </dd> 2048 </dl> 2049 2050 </div> 2051 </div> 2052 <a class="anchor" id="afabf61f932cd64a4122ca8092452eed5"></a> 2053 <div class="memitem"> 2054 <div class="memproto"> 2055 <table class="memname"> 2056 <tr> 2057 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_put </td> 2058 <td>(</td> 2059 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2060 <td class="paramname"><em>obj</em></td><td>)</td> 2061 <td></td> 2062 </tr> 2063 </table> 2064 </div><div class="memdoc"> 2065 <p>Decrement the reference count of json_object and free if it reaches zero.</p> 2066 <p>You must have ownership of obj prior to doing this or you will cause an imbalance in the reference count, leading to a classic use-after-free bug. In particular, you normally do not need to call <code><a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a></code> on the json_object returned by <code><a class="el" href="json__object_8h.html#a1a097805abb53b4c8a60d573730a8939">json_object_object_get()</a></code> or <code><a class="el" href="json__object_8h.html#a676711a76545d4ec65cc75f100f5fd19">json_object_array_get_idx()</a></code>.</p> 2067 <p>Just like after calling <code>free()</code> on a block of memory, you must not use <code>obj</code> after calling <code><a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a></code> on it or any object that it is a member of (unless you know you've called <code>json_object_get(obj)</code> to explicitly increment the refcount).</p> 2068 <p>NULL may be passed, which which case this is a no-op.</p> 2069 <dl class="params"><dt>Parameters</dt><dd> 2070 <table class="params"> 2071 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2072 </table> 2073 </dd> 2074 </dl> 2075 <dl class="section return"><dt>Returns</dt><dd>1 if the object was freed. </dd></dl> 2076 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#a675aa3a9cced685dbfd1c1a770a0c3e4">json_object_get()</a> </dd></dl> 2077 2078 </div> 2079 </div> 2080 <a class="anchor" id="a23863c1503f3a8dd8a460a6405da0a65"></a> 2081 <div class="memitem"> 2082 <div class="memproto"> 2083 <table class="memname"> 2084 <tr> 2085 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_boolean </td> 2086 <td>(</td> 2087 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2088 <td class="paramname"><em>obj</em>, </td> 2089 </tr> 2090 <tr> 2091 <td class="paramkey"></td> 2092 <td></td> 2093 <td class="paramtype"><a class="el" href="json__types_8h.html#a81f02022906fafc71eb9197049f07f73">json_bool</a> </td> 2094 <td class="paramname"><em>new_value</em> </td> 2095 </tr> 2096 <tr> 2097 <td></td> 2098 <td>)</td> 2099 <td></td><td></td> 2100 </tr> 2101 </table> 2102 </div><div class="memdoc"> 2103 <p>Set the json_bool value of a json_object</p> 2104 <p>The type of obj is checked to be a json_type_boolean and 0 is returned if it is not without any further actions. If type of obj is json_type_boolean the object value is changed to new_value</p> 2105 <dl class="params"><dt>Parameters</dt><dd> 2106 <table class="params"> 2107 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2108 <tr><td class="paramname">new_value</td><td>the value to be set </td></tr> 2109 </table> 2110 </dd> 2111 </dl> 2112 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2113 2114 </div> 2115 </div> 2116 <a class="anchor" id="a3a7b7ce585565558cb69dad8d45d7757"></a> 2117 <div class="memitem"> 2118 <div class="memproto"> 2119 <table class="memname"> 2120 <tr> 2121 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_double </td> 2122 <td>(</td> 2123 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2124 <td class="paramname"><em>obj</em>, </td> 2125 </tr> 2126 <tr> 2127 <td class="paramkey"></td> 2128 <td></td> 2129 <td class="paramtype">double </td> 2130 <td class="paramname"><em>new_value</em> </td> 2131 </tr> 2132 <tr> 2133 <td></td> 2134 <td>)</td> 2135 <td></td><td></td> 2136 </tr> 2137 </table> 2138 </div><div class="memdoc"> 2139 <p>Set the double value of a json_object</p> 2140 <p>The type of obj is checked to be a json_type_double and 0 is returned if it is not without any further actions. If type of obj is json_type_double the object value is changed to new_value</p> 2141 <p>If the object was created with <a class="el" href="json__object_8h.html#ae49671c026fe1ada370a75321e4e65f6">json_object_new_double_s()</a>, the serialization function is reset to the default and the cached serialized value is cleared.</p> 2142 <dl class="params"><dt>Parameters</dt><dd> 2143 <table class="params"> 2144 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2145 <tr><td class="paramname">new_value</td><td>the value to be set </td></tr> 2146 </table> 2147 </dd> 2148 </dl> 2149 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2150 2151 </div> 2152 </div> 2153 <a class="anchor" id="a4ab3568f12e01fd2967e765a72456caa"></a> 2154 <div class="memitem"> 2155 <div class="memproto"> 2156 <table class="memname"> 2157 <tr> 2158 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_int </td> 2159 <td>(</td> 2160 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2161 <td class="paramname"><em>obj</em>, </td> 2162 </tr> 2163 <tr> 2164 <td class="paramkey"></td> 2165 <td></td> 2166 <td class="paramtype">int </td> 2167 <td class="paramname"><em>new_value</em> </td> 2168 </tr> 2169 <tr> 2170 <td></td> 2171 <td>)</td> 2172 <td></td><td></td> 2173 </tr> 2174 </table> 2175 </div><div class="memdoc"> 2176 <p>Set the int value of a json_object</p> 2177 <p>The type of obj is checked to be a json_type_int and 0 is returned if it is not without any further actions. If type of obj is json_type_int the object value is changed to new_value</p> 2178 <dl class="params"><dt>Parameters</dt><dd> 2179 <table class="params"> 2180 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2181 <tr><td class="paramname">new_value</td><td>the value to be set </td></tr> 2182 </table> 2183 </dd> 2184 </dl> 2185 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2186 2187 </div> 2188 </div> 2189 <a class="anchor" id="a7d3948600dde732abed0e261264ef53a"></a> 2190 <div class="memitem"> 2191 <div class="memproto"> 2192 <table class="memname"> 2193 <tr> 2194 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_int64 </td> 2195 <td>(</td> 2196 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2197 <td class="paramname"><em>obj</em>, </td> 2198 </tr> 2199 <tr> 2200 <td class="paramkey"></td> 2201 <td></td> 2202 <td class="paramtype">int64_t </td> 2203 <td class="paramname"><em>new_value</em> </td> 2204 </tr> 2205 <tr> 2206 <td></td> 2207 <td>)</td> 2208 <td></td><td></td> 2209 </tr> 2210 </table> 2211 </div><div class="memdoc"> 2212 <p>Set the int64_t value of a json_object</p> 2213 <p>The type of obj is checked to be a json_type_int and 0 is returned if it is not without any further actions. If type of obj is json_type_int the object value is changed to new_value</p> 2214 <dl class="params"><dt>Parameters</dt><dd> 2215 <table class="params"> 2216 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2217 <tr><td class="paramname">new_value</td><td>the value to be set </td></tr> 2218 </table> 2219 </dd> 2220 </dl> 2221 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2222 2223 </div> 2224 </div> 2225 <a class="anchor" id="a889345512a214b8f78f6a73561523c7c"></a> 2226 <div class="memitem"> 2227 <div class="memproto"> 2228 <table class="memname"> 2229 <tr> 2230 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void json_object_set_serializer </td> 2231 <td>(</td> 2232 <td class="paramtype"><a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2233 <td class="paramname"><em>jso</em>, </td> 2234 </tr> 2235 <tr> 2236 <td class="paramkey"></td> 2237 <td></td> 2238 <td class="paramtype"><a class="el" href="json__types_8h.html#af84078100a9025df418f31626ea866fa">json_object_to_json_string_fn</a> * </td> 2239 <td class="paramname"><em>to_string_func</em>, </td> 2240 </tr> 2241 <tr> 2242 <td class="paramkey"></td> 2243 <td></td> 2244 <td class="paramtype">void * </td> 2245 <td class="paramname"><em>userdata</em>, </td> 2246 </tr> 2247 <tr> 2248 <td class="paramkey"></td> 2249 <td></td> 2250 <td class="paramtype"><a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_object_delete_fn</a> * </td> 2251 <td class="paramname"><em>user_delete</em> </td> 2252 </tr> 2253 <tr> 2254 <td></td> 2255 <td>)</td> 2256 <td></td><td></td> 2257 </tr> 2258 </table> 2259 </div><div class="memdoc"> 2260 <p>Set a custom serialization function to be used when this particular object is converted to a string by json_object_to_json_string.</p> 2261 <p>If custom userdata is already set on this object, any existing user_delete function is called before the new one is set.</p> 2262 <p>If to_string_func is NULL the default behaviour is reset (but the userdata and user_delete fields are still set).</p> 2263 <p>The userdata parameter is optional and may be passed as NULL. It can be used to provide additional data for to_string_func to use. This parameter may be NULL even if user_delete is non-NULL.</p> 2264 <p>The user_delete parameter is optional and may be passed as NULL, even if the userdata parameter is non-NULL. It will be called just before the json_object is deleted, after it's reference count goes to zero (see <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>). If this is not provided, it is up to the caller to free the userdata at an appropriate time. (i.e. after the json_object is deleted)</p> 2265 <p>Note that the userdata is the same as set by <a class="el" href="json__object_8h.html#a4ee4281ccd123c62878e931a0a3bc43b">json_object_set_userdata()</a>, so care must be taken not to overwrite the value when both a custom serializer and <a class="el" href="json__object_8h.html#a4ee4281ccd123c62878e931a0a3bc43b">json_object_set_userdata()</a> are used.</p> 2266 <dl class="params"><dt>Parameters</dt><dd> 2267 <table class="params"> 2268 <tr><td class="paramname">jso</td><td>the object to customize </td></tr> 2269 <tr><td class="paramname">to_string_func</td><td>the custom serialization function </td></tr> 2270 <tr><td class="paramname">userdata</td><td>an optional opaque cookie </td></tr> 2271 <tr><td class="paramname">user_delete</td><td>an optional function from freeing userdata </td></tr> 2272 </table> 2273 </dd> 2274 </dl> 2275 2276 </div> 2277 </div> 2278 <a class="anchor" id="ac35013e51cdc0651512801c947df431c"></a> 2279 <div class="memitem"> 2280 <div class="memproto"> 2281 <table class="memname"> 2282 <tr> 2283 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_string </td> 2284 <td>(</td> 2285 <td class="paramtype"><a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2286 <td class="paramname"><em>obj</em>, </td> 2287 </tr> 2288 <tr> 2289 <td class="paramkey"></td> 2290 <td></td> 2291 <td class="paramtype">const char * </td> 2292 <td class="paramname"><em>new_value</em> </td> 2293 </tr> 2294 <tr> 2295 <td></td> 2296 <td>)</td> 2297 <td></td><td></td> 2298 </tr> 2299 </table> 2300 </div><div class="memdoc"> 2301 <p>Set the string value of a json_object with zero terminated strings equivalent to json_object_set_string_len (obj, new_value, strlen(new_value)) </p> 2302 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2303 2304 </div> 2305 </div> 2306 <a class="anchor" id="ae48707a0c8689e14aaa3a9b831db27fc"></a> 2307 <div class="memitem"> 2308 <div class="memproto"> 2309 <table class="memname"> 2310 <tr> 2311 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_string_len </td> 2312 <td>(</td> 2313 <td class="paramtype"><a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2314 <td class="paramname"><em>obj</em>, </td> 2315 </tr> 2316 <tr> 2317 <td class="paramkey"></td> 2318 <td></td> 2319 <td class="paramtype">const char * </td> 2320 <td class="paramname"><em>new_value</em>, </td> 2321 </tr> 2322 <tr> 2323 <td class="paramkey"></td> 2324 <td></td> 2325 <td class="paramtype">int </td> 2326 <td class="paramname"><em>len</em> </td> 2327 </tr> 2328 <tr> 2329 <td></td> 2330 <td>)</td> 2331 <td></td><td></td> 2332 </tr> 2333 </table> 2334 </div><div class="memdoc"> 2335 <p>Set the string value of a json_object str</p> 2336 <p>The type of obj is checked to be a json_type_string and 0 is returned if it is not without any further actions. If type of obj is json_type_string the object value is changed to new_value</p> 2337 <dl class="params"><dt>Parameters</dt><dd> 2338 <table class="params"> 2339 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2340 <tr><td class="paramname">new_value</td><td>the value to be set; Since string length is given in len this need not be zero terminated </td></tr> 2341 <tr><td class="paramname">len</td><td>the length of new_value </td></tr> 2342 </table> 2343 </dd> 2344 </dl> 2345 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2346 2347 </div> 2348 </div> 2349 <a class="anchor" id="a9900aa9a425e6f14e295b298460b65d4"></a> 2350 <div class="memitem"> 2351 <div class="memproto"> 2352 <table class="memname"> 2353 <tr> 2354 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> int json_object_set_uint64 </td> 2355 <td>(</td> 2356 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2357 <td class="paramname"><em>obj</em>, </td> 2358 </tr> 2359 <tr> 2360 <td class="paramkey"></td> 2361 <td></td> 2362 <td class="paramtype">uint64_t </td> 2363 <td class="paramname"><em>new_value</em> </td> 2364 </tr> 2365 <tr> 2366 <td></td> 2367 <td>)</td> 2368 <td></td><td></td> 2369 </tr> 2370 </table> 2371 </div><div class="memdoc"> 2372 <p>Set the uint64_t value of a json_object</p> 2373 <p>The type of obj is checked to be a json_type_uint and 0 is returned if it is not without any further actions. If type of obj is json_type_uint the object value is changed to new_value</p> 2374 <dl class="params"><dt>Parameters</dt><dd> 2375 <table class="params"> 2376 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2377 <tr><td class="paramname">new_value</td><td>the value to be set </td></tr> 2378 </table> 2379 </dd> 2380 </dl> 2381 <dl class="section return"><dt>Returns</dt><dd>1 if value is set correctly, 0 otherwise </dd></dl> 2382 2383 </div> 2384 </div> 2385 <a class="anchor" id="a4ee4281ccd123c62878e931a0a3bc43b"></a> 2386 <div class="memitem"> 2387 <div class="memproto"> 2388 <table class="memname"> 2389 <tr> 2390 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> void json_object_set_userdata </td> 2391 <td>(</td> 2392 <td class="paramtype"><a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2393 <td class="paramname"><em>jso</em>, </td> 2394 </tr> 2395 <tr> 2396 <td class="paramkey"></td> 2397 <td></td> 2398 <td class="paramtype">void * </td> 2399 <td class="paramname"><em>userdata</em>, </td> 2400 </tr> 2401 <tr> 2402 <td class="paramkey"></td> 2403 <td></td> 2404 <td class="paramtype"><a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_object_delete_fn</a> * </td> 2405 <td class="paramname"><em>user_delete</em> </td> 2406 </tr> 2407 <tr> 2408 <td></td> 2409 <td>)</td> 2410 <td></td><td></td> 2411 </tr> 2412 </table> 2413 </div><div class="memdoc"> 2414 <p>Set an opaque userdata value for an object</p> 2415 <p>The userdata can be retrieved using <a class="el" href="json__object_8h.html#ae925f3ec0f61cba5ea3dd50e0315f194">json_object_get_userdata()</a>.</p> 2416 <p>If custom userdata is already set on this object, any existing user_delete function is called before the new one is set.</p> 2417 <p>The user_delete parameter is optional and may be passed as NULL, even if the userdata parameter is non-NULL. It will be called just before the json_object is deleted, after it's reference count goes to zero (see <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a>). If this is not provided, it is up to the caller to free the userdata at an appropriate time. (i.e. after the json_object is deleted)</p> 2418 <p>Note: Objects created by parsing strings may have custom serializers set which expect the userdata to contain specific data (due to use of <a class="el" href="json__object_8h.html#ae49671c026fe1ada370a75321e4e65f6">json_object_new_double_s()</a>). In this case, json_object_set_serialiser() with NULL as to_string_func should be used instead to set the userdata and reset the serializer to its default value.</p> 2419 <dl class="params"><dt>Parameters</dt><dd> 2420 <table class="params"> 2421 <tr><td class="paramname">jso</td><td>the object to set the userdata for </td></tr> 2422 <tr><td class="paramname">userdata</td><td>an optional opaque cookie </td></tr> 2423 <tr><td class="paramname">user_delete</td><td>an optional function from freeing userdata </td></tr> 2424 </table> 2425 </dd> 2426 </dl> 2427 2428 </div> 2429 </div> 2430 <a class="anchor" id="ab7390c22baa1700d977c2af6b22d43a4"></a> 2431 <div class="memitem"> 2432 <div class="memproto"> 2433 <table class="memname"> 2434 <tr> 2435 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char* json_object_to_json_string </td> 2436 <td>(</td> 2437 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2438 <td class="paramname"><em>obj</em></td><td>)</td> 2439 <td></td> 2440 </tr> 2441 </table> 2442 </div><div class="memdoc"> 2443 <p>Stringify object to json format. Equivalent to json_object_to_json_string_ext(obj, JSON_C_TO_STRING_SPACED) The pointer you get is an internal of your json object. You don't have to free it, later use of <a class="el" href="json__object_8h.html#afabf61f932cd64a4122ca8092452eed5">json_object_put()</a> should be sufficient. If you can not ensure there's no concurrent access to *obj use strdup(). </p> 2444 <dl class="params"><dt>Parameters</dt><dd> 2445 <table class="params"> 2446 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2447 </table> 2448 </dd> 2449 </dl> 2450 <dl class="section return"><dt>Returns</dt><dd>a string in JSON format </dd></dl> 2451 2452 </div> 2453 </div> 2454 <a class="anchor" id="a9db613127bd4ef7db42307e43a85fc1b"></a> 2455 <div class="memitem"> 2456 <div class="memproto"> 2457 <table class="memname"> 2458 <tr> 2459 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char* json_object_to_json_string_ext </td> 2460 <td>(</td> 2461 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2462 <td class="paramname"><em>obj</em>, </td> 2463 </tr> 2464 <tr> 2465 <td class="paramkey"></td> 2466 <td></td> 2467 <td class="paramtype">int </td> 2468 <td class="paramname"><em>flags</em> </td> 2469 </tr> 2470 <tr> 2471 <td></td> 2472 <td>)</td> 2473 <td></td><td></td> 2474 </tr> 2475 </table> 2476 </div><div class="memdoc"> 2477 <p>Stringify object to json format </p> 2478 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#ab7390c22baa1700d977c2af6b22d43a4">json_object_to_json_string()</a> for details on how to free string. </dd></dl> 2479 <dl class="params"><dt>Parameters</dt><dd> 2480 <table class="params"> 2481 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2482 <tr><td class="paramname">flags</td><td>formatting options, see JSON_C_TO_STRING_PRETTY and other constants </td></tr> 2483 </table> 2484 </dd> 2485 </dl> 2486 <dl class="section return"><dt>Returns</dt><dd>a string in JSON format </dd></dl> 2487 2488 </div> 2489 </div> 2490 <a class="anchor" id="add3770a3ba3d01a8f9adedfcd6bd8dbb"></a> 2491 <div class="memitem"> 2492 <div class="memproto"> 2493 <table class="memname"> 2494 <tr> 2495 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> const char* json_object_to_json_string_length </td> 2496 <td>(</td> 2497 <td class="paramtype">struct <a class="el" href="json__types_8h.html#af27907ced0f5a43409ad96430fe0f914">json_object</a> * </td> 2498 <td class="paramname"><em>obj</em>, </td> 2499 </tr> 2500 <tr> 2501 <td class="paramkey"></td> 2502 <td></td> 2503 <td class="paramtype">int </td> 2504 <td class="paramname"><em>flags</em>, </td> 2505 </tr> 2506 <tr> 2507 <td class="paramkey"></td> 2508 <td></td> 2509 <td class="paramtype">size_t * </td> 2510 <td class="paramname"><em>length</em> </td> 2511 </tr> 2512 <tr> 2513 <td></td> 2514 <td>)</td> 2515 <td></td><td></td> 2516 </tr> 2517 </table> 2518 </div><div class="memdoc"> 2519 <p>Stringify object to json format </p> 2520 <dl class="section see"><dt>See Also</dt><dd><a class="el" href="json__object_8h.html#ab7390c22baa1700d977c2af6b22d43a4">json_object_to_json_string()</a> for details on how to free string. </dd></dl> 2521 <dl class="params"><dt>Parameters</dt><dd> 2522 <table class="params"> 2523 <tr><td class="paramname">obj</td><td>the json_object instance </td></tr> 2524 <tr><td class="paramname">flags</td><td>formatting options, see JSON_C_TO_STRING_PRETTY and other constants </td></tr> 2525 <tr><td class="paramname">length</td><td>a pointer where, if not NULL, the length (without null) is stored </td></tr> 2526 </table> 2527 </dd> 2528 </dl> 2529 <dl class="section return"><dt>Returns</dt><dd>a string in JSON format and the length if not NULL </dd></dl> 2530 2531 </div> 2532 </div> 2533 <h2 class="groupheader">Variable Documentation</h2> 2534 <a class="anchor" id="a86ea08e75ddf054742bf806a3bc3f983"></a> 2535 <div class="memitem"> 2536 <div class="memproto"> 2537 <table class="memname"> 2538 <tr> 2539 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__object_8h.html#af4562514916f62ea56adf752ada10b52">json_c_shallow_copy_fn</a> json_c_shallow_copy_default</td> 2540 </tr> 2541 </table> 2542 </div><div class="memdoc"> 2543 <p>The default shallow copy implementation for use with <a class="el" href="json__object_8h.html#aaac16505f13bc56accfad82604d8bcdc">json_object_deep_copy()</a>. This simply calls the appropriate json_object_new_<type>() function and copies over the serializer function (_to_json_string internal field of the json_object structure) but not any _userdata or _user_delete values.</p> 2544 <p>If you're writing a custom shallow_copy function, perhaps because you're using your own custom serializer, you can call this first to create the new object before customizing it with <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer()</a>.</p> 2545 <dl class="section return"><dt>Returns</dt><dd>1 on success, -1 on errors, but never 2. </dd></dl> 2546 2547 </div> 2548 </div> 2549 <a class="anchor" id="aff3190c34884bea3b4e65e286b973d89"></a> 2550 <div class="memitem"> 2551 <div class="memproto"> 2552 <table class="memname"> 2553 <tr> 2554 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#aa647d7c567a06abe1a1a511f6d6860e4">json_object_delete_fn</a> json_object_free_userdata</td> 2555 </tr> 2556 </table> 2557 </div><div class="memdoc"> 2558 <p>Simply call free on the userdata pointer. Can be used with <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer()</a>.</p> 2559 <dl class="params"><dt>Parameters</dt><dd> 2560 <table class="params"> 2561 <tr><td class="paramname">jso</td><td>unused </td></tr> 2562 <tr><td class="paramname">userdata</td><td>the pointer that is passed to free(). </td></tr> 2563 </table> 2564 </dd> 2565 </dl> 2566 2567 </div> 2568 </div> 2569 <a class="anchor" id="a56091ddbd2ec6d6200558cbeff1b86b8"></a> 2570 <div class="memitem"> 2571 <div class="memproto"> 2572 <table class="memname"> 2573 <tr> 2574 <td class="memname"><a class="el" href="printbuf_8h.html#a2a31d5c00f3a4712f2d5d62aee66344e">JSON_EXPORT</a> <a class="el" href="json__types_8h.html#af84078100a9025df418f31626ea866fa">json_object_to_json_string_fn</a> json_object_userdata_to_json_string</td> 2575 </tr> 2576 </table> 2577 </div><div class="memdoc"> 2578 <p>Copy the jso->_userdata string over to pb as-is. Can be used with <a class="el" href="json__object_8h.html#a889345512a214b8f78f6a73561523c7c">json_object_set_serializer()</a>.</p> 2579 <dl class="params"><dt>Parameters</dt><dd> 2580 <table class="params"> 2581 <tr><td class="paramname">jso</td><td>The object whose _userdata is used. </td></tr> 2582 <tr><td class="paramname">pb</td><td>The destination buffer. </td></tr> 2583 <tr><td class="paramname">level</td><td>Ignored. </td></tr> 2584 <tr><td class="paramname">flags</td><td>Ignored. </td></tr> 2585 </table> 2586 </dd> 2587 </dl> 2588 2589 </div> 2590 </div> 2591 </div><!-- contents --> 2592 <!-- start footer part --> 2593 <hr class="footer"/><address class="footer"><small> 2594 Generated on Sun Jul 26 2020 15:11:19 for json-c by  <a href="http://www.doxygen.org/index.html"> 2595 <img class="footer" src="doxygen.png" alt="doxygen"/> 2596 </a> 1.8.2 2597 </small></address> 2598 </body> 2599 </html>
This page was automatically generated by LXR 0.3.1. • OpenWrt