Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 1 | /* |
Michael Clark | 837240f | 2007-03-13 08:26:25 +0000 | [diff] [blame] | 2 | * $Id: json_object.h,v 1.12 2006/01/30 23:07:57 mclark Exp $ |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 3 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 4 | * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 5 | * Michael Clark <michael@metaparadigm.com> |
| 6 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 7 | * This library is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the MIT license. See COPYING for details. |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 9 | * |
| 10 | */ |
| 11 | |
| 12 | #ifndef _json_object_h_ |
| 13 | #define _json_object_h_ |
| 14 | |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
Michael Clark | e6548a3 | 2009-01-10 13:58:06 +0000 | [diff] [blame] | 19 | #define JSON_OBJECT_DEF_HASH_ENTRIES 16 |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 20 | |
| 21 | #undef FALSE |
| 22 | #define FALSE ((boolean)0) |
| 23 | |
| 24 | #undef TRUE |
| 25 | #define TRUE ((boolean)1) |
| 26 | |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 27 | extern const char *json_number_chars; |
| 28 | extern const char *json_hex_chars; |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 29 | |
| 30 | /* forward structure definitions */ |
| 31 | |
| 32 | typedef int boolean; |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 33 | typedef struct printbuf printbuf; |
| 34 | typedef struct lh_table lh_table; |
| 35 | typedef struct array_list array_list; |
| 36 | typedef struct json_object json_object; |
| 37 | typedef struct json_object_iter json_object_iter; |
| 38 | typedef struct json_tokener json_tokener; |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 39 | |
| 40 | /* supported object types */ |
| 41 | |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 42 | typedef enum json_type { |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 43 | json_type_null, |
| 44 | json_type_boolean, |
| 45 | json_type_double, |
| 46 | json_type_int, |
| 47 | json_type_object, |
| 48 | json_type_array, |
Michael Clark | c4dceae | 2010-10-06 16:39:20 +0000 | [diff] [blame] | 49 | json_type_string, |
| 50 | json_type_int64 |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 51 | } json_type; |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 52 | |
| 53 | /* reference counting functions */ |
| 54 | |
| 55 | /** |
| 56 | * Increment the reference count of json_object |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 57 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 58 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 59 | extern struct json_object* json_object_get(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 60 | |
| 61 | /** |
| 62 | * Decrement the reference count of json_object and free if it reaches zero |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 63 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 64 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 65 | extern void json_object_put(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 66 | |
| 67 | |
| 68 | /** |
| 69 | * Check if the json_object is of a given type |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 70 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 71 | * @param type one of: |
| 72 | json_type_boolean, |
| 73 | json_type_double, |
| 74 | json_type_int, |
| 75 | json_type_object, |
| 76 | json_type_array, |
| 77 | json_type_string, |
Michael Clark | c4dceae | 2010-10-06 16:39:20 +0000 | [diff] [blame] | 78 | json_type_int64, |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 79 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 80 | extern int json_object_is_type(struct json_object *obj, enum json_type type); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 81 | |
| 82 | /** |
| 83 | * Get the type of the json_object |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 84 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 85 | * @returns type being one of: |
| 86 | json_type_boolean, |
| 87 | json_type_double, |
| 88 | json_type_int, |
| 89 | json_type_object, |
| 90 | json_type_array, |
| 91 | json_type_string, |
Michael Clark | c4dceae | 2010-10-06 16:39:20 +0000 | [diff] [blame] | 92 | json_type_int64, |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 93 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 94 | extern enum json_type json_object_get_type(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 95 | |
| 96 | |
| 97 | /** Stringify object to json format |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 98 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 99 | * @returns a string in JSON format |
| 100 | */ |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 101 | extern const char* json_object_to_json_string(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 102 | |
| 103 | |
| 104 | /* object type methods */ |
| 105 | |
| 106 | /** Create a new empty object |
| 107 | * @returns a json_object of type json_type_object |
| 108 | */ |
Michael Clark | 14862b1 | 2007-12-07 02:50:42 +0000 | [diff] [blame] | 109 | extern struct json_object* json_object_new_object(void); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 110 | |
| 111 | /** Get the hashtable of a json_object of type json_type_object |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 112 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 113 | * @returns a linkhash |
| 114 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 115 | extern struct lh_table* json_object_get_object(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 116 | |
| 117 | /** Add an object field to a json_object of type json_type_object |
| 118 | * |
| 119 | * The reference count will *not* be incremented. This is to make adding |
| 120 | * fields to objects in code more compact. If you want to retain a reference |
| 121 | * to an added object you must wrap the passed object with json_object_get |
| 122 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 123 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 124 | * @param key the object field name (a private copy will be duplicated) |
| 125 | * @param val a json_object or NULL member to associate with the given field |
| 126 | */ |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 127 | extern void json_object_object_add(struct json_object* obj, const char *key, |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 128 | struct json_object *val); |
| 129 | |
| 130 | /** Get the json_object associate with a given object field |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 131 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 132 | * @param key the object field name |
| 133 | * @returns the json_object associated with the given field name |
| 134 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 135 | extern struct json_object* json_object_object_get(struct json_object* obj, |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 136 | const char *key); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 137 | |
| 138 | /** Delete the given json_object field |
| 139 | * |
| 140 | * The reference count will be decremented for the deleted object |
| 141 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 142 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 143 | * @param key the object field name |
| 144 | */ |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 145 | extern void json_object_object_del(struct json_object* obj, const char *key); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 146 | |
| 147 | /** Iterate through all keys and values of an object |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 148 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 149 | * @param key the local name for the char* key variable defined in the body |
| 150 | * @param val the local name for the json_object* object variable defined in the body |
| 151 | */ |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 152 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 153 | |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 154 | # define json_object_object_foreach(obj,key,val) \ |
| 155 | char *key; struct json_object *val; \ |
| 156 | for(struct lh_entry *entry = json_object_get_object(obj)->head; ({ if(entry) { key = (char*)entry->k; val = (struct json_object*)entry->v; } ; entry; }); entry = entry->next ) |
| 157 | |
| 158 | #else /* ANSI C or MSC */ |
| 159 | |
| 160 | # define json_object_object_foreach(obj,key,val) \ |
| 161 | char *key; struct json_object *val; struct lh_entry *entry; \ |
| 162 | for(entry = json_object_get_object(obj)->head; (entry ? (key = (char*)entry->k, val = (struct json_object*)entry->v, entry) : 0); entry = entry->next) |
| 163 | |
| 164 | #endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) */ |
| 165 | |
| 166 | /** Iterate through all keys and values of an object (ANSI C Safe) |
| 167 | * @param obj the json_object instance |
| 168 | * @param iter the object iterator |
| 169 | */ |
| 170 | #define json_object_object_foreachC(obj,iter) \ |
| 171 | for(iter.entry = json_object_get_object(obj)->head; (iter.entry ? (iter.key = (char*)iter.entry->k, iter.val = (struct json_object*)iter.entry->v, iter.entry) : 0); iter.entry = iter.entry->next) |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 172 | |
| 173 | /* Array type methods */ |
| 174 | |
| 175 | /** Create a new empty json_object of type json_type_array |
| 176 | * @returns a json_object of type json_type_array |
| 177 | */ |
Michael Clark | 14862b1 | 2007-12-07 02:50:42 +0000 | [diff] [blame] | 178 | extern struct json_object* json_object_new_array(void); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 179 | |
| 180 | /** Get the arraylist of a json_object of type json_type_array |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 181 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 182 | * @returns an arraylist |
| 183 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 184 | extern struct array_list* json_object_get_array(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 185 | |
| 186 | /** Get the length of a json_object of type json_type_array |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 187 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 188 | * @returns an int |
| 189 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 190 | extern int json_object_array_length(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 191 | |
| 192 | /** Add an element to the end of a json_object of type json_type_array |
| 193 | * |
| 194 | * The reference count will *not* be incremented. This is to make adding |
| 195 | * fields to objects in code more compact. If you want to retain a reference |
| 196 | * to an added object you must wrap the passed object with json_object_get |
| 197 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 198 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 199 | * @param val the json_object to be added |
| 200 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 201 | extern int json_object_array_add(struct json_object *obj, |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 202 | struct json_object *val); |
| 203 | |
| 204 | /** Insert or replace an element at a specified index in an array (a json_object of type json_type_array) |
| 205 | * |
| 206 | * The reference count will *not* be incremented. This is to make adding |
| 207 | * fields to objects in code more compact. If you want to retain a reference |
| 208 | * to an added object you must wrap the passed object with json_object_get |
| 209 | * |
| 210 | * The reference count of a replaced object will be decremented. |
| 211 | * |
| 212 | * The array size will be automatically be expanded to the size of the |
| 213 | * index if the index is larger than the current size. |
| 214 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 215 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 216 | * @param idx the index to insert the element at |
| 217 | * @param val the json_object to be added |
| 218 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 219 | extern int json_object_array_put_idx(struct json_object *obj, int idx, |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 220 | struct json_object *val); |
| 221 | |
| 222 | /** Get the element at specificed index of the array (a json_object of type json_type_array) |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 223 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 224 | * @param idx the index to get the element at |
| 225 | * @returns the json_object at the specified index (or NULL) |
| 226 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 227 | extern struct json_object* json_object_array_get_idx(struct json_object *obj, |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 228 | int idx); |
| 229 | |
| 230 | /* boolean type methods */ |
| 231 | |
| 232 | /** Create a new empty json_object of type json_type_boolean |
| 233 | * @param b a boolean TRUE or FALSE (0 or 1) |
| 234 | * @returns a json_object of type json_type_boolean |
| 235 | */ |
| 236 | extern struct json_object* json_object_new_boolean(boolean b); |
| 237 | |
| 238 | /** Get the boolean value of a json_object |
| 239 | * |
| 240 | * The type is coerced to a boolean if the passed object is not a boolean. |
| 241 | * integer and double objects will return FALSE if there value is zero |
| 242 | * or TRUE otherwise. If the passed object is a string it will return |
| 243 | * TRUE if it has a non zero length. If any other object type is passed |
| 244 | * TRUE will be returned if the object is not NULL. |
| 245 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 246 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 247 | * @returns a boolean |
| 248 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 249 | extern boolean json_object_get_boolean(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 250 | |
| 251 | |
| 252 | /* int type methods */ |
| 253 | |
| 254 | /** Create a new empty json_object of type json_type_int |
| 255 | * @param i the integer |
| 256 | * @returns a json_object of type json_type_int |
| 257 | */ |
Michael Clark | c4dceae | 2010-10-06 16:39:20 +0000 | [diff] [blame] | 258 | extern struct json_object* json_object_new_int(int32_t i); |
| 259 | |
| 260 | |
| 261 | /** Create a new empty json_object of type json_type_int64 |
| 262 | * @param i the integer |
| 263 | * @returns a json_object of type json_type_int64 |
| 264 | */ |
| 265 | extern struct json_object* json_object_new_int64(int64_t i); |
| 266 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 267 | |
| 268 | /** Get the int value of a json_object |
| 269 | * |
| 270 | * The type is coerced to a int if the passed object is not a int. |
| 271 | * double objects will return their integer conversion. Strings will be |
| 272 | * parsed as an integer. If no conversion exists then 0 is returned. |
| 273 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 274 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 275 | * @returns an int |
| 276 | */ |
Michael Clark | c4dceae | 2010-10-06 16:39:20 +0000 | [diff] [blame] | 277 | extern int32_t json_object_get_int(struct json_object *obj); |
| 278 | |
| 279 | /** Get the int value of a json_object |
| 280 | * |
| 281 | * The type is coerced to a int64 if the passed object is not a int64. |
| 282 | * double objects will return their int64 conversion. Strings will be |
| 283 | * parsed as an int64. If no conversion exists then 0 is returned. |
| 284 | * |
| 285 | * @param obj the json_object instance |
| 286 | * @returns an int64 |
| 287 | */ |
| 288 | extern int64_t json_object_get_int64(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 289 | |
| 290 | |
| 291 | /* double type methods */ |
| 292 | |
| 293 | /** Create a new empty json_object of type json_type_double |
| 294 | * @param d the double |
| 295 | * @returns a json_object of type json_type_double |
| 296 | */ |
| 297 | extern struct json_object* json_object_new_double(double d); |
| 298 | |
| 299 | /** Get the double value of a json_object |
| 300 | * |
| 301 | * The type is coerced to a double if the passed object is not a double. |
| 302 | * integer objects will return their dboule conversion. Strings will be |
| 303 | * parsed as a double. If no conversion exists then 0.0 is returned. |
| 304 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 305 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 306 | * @returns an double |
| 307 | */ |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 308 | extern double json_object_get_double(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 309 | |
| 310 | |
| 311 | /* string type methods */ |
| 312 | |
| 313 | /** Create a new empty json_object of type json_type_string |
| 314 | * |
| 315 | * A copy of the string is made and the memory is managed by the json_object |
| 316 | * |
| 317 | * @param s the string |
| 318 | * @returns a json_object of type json_type_string |
| 319 | */ |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 320 | extern struct json_object* json_object_new_string(const char *s); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 321 | |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 322 | extern struct json_object* json_object_new_string_len(const char *s, int len); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 323 | |
| 324 | /** Get the string value of a json_object |
| 325 | * |
| 326 | * If the passed object is not of type json_type_string then the JSON |
| 327 | * representation of the object is returned. |
| 328 | * |
| 329 | * The returned string memory is managed by the json_object and will |
| 330 | * be freed when the reference count of the json_object drops to zero. |
| 331 | * |
Michael Clark | f6a6e48 | 2007-03-13 08:26:23 +0000 | [diff] [blame] | 332 | * @param obj the json_object instance |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 333 | * @returns a string |
| 334 | */ |
Michael Clark | 68cafad | 2009-01-06 22:56:57 +0000 | [diff] [blame] | 335 | extern const char* json_object_get_string(struct json_object *obj); |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 336 | |
Michael Clark | aaec1ef | 2009-02-25 02:31:32 +0000 | [diff] [blame] | 337 | #ifdef __cplusplus |
| 338 | } |
| 339 | #endif |
| 340 | |
Michael Clark | f0d0888 | 2007-03-13 08:26:18 +0000 | [diff] [blame] | 341 | #endif |