diff options
author | Michael Clark <michael@metaparadigm.com> | 2009-02-25 02:31:32 +0000 |
---|---|---|
committer | Michael Clark <michael@metaparadigm.com> | 2009-02-25 02:31:32 +0000 |
commit | aaec1ef3c542accb118af48c09edc7e07675671a (patch) | |
tree | aa8044c50301f18a7046f4efadc1b9134eeb61d1 /json_object.h | |
parent | 266a3fd30141b31632eead6739ace524bc172de5 (diff) |
* Don't use this as a variable, so we can compile with a C++ compiler
* Add casts from void* to type of assignment when using malloc
* Add #ifdef __cplusplus guards to all of the headers
* Add typedefs for json_object, json_tokener, array_list, printbuf, lh_table
Michael Clark, <michael@metaparadigm.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@33 327403b1-1117-474d-bef2-5cb71233fd97
Diffstat (limited to 'json_object.h')
-rw-r--r-- | json_object.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/json_object.h b/json_object.h index 4c8f6db..80d2313 100644 --- a/json_object.h +++ b/json_object.h @@ -12,6 +12,10 @@ #ifndef _json_object_h_ #define _json_object_h_ +#ifdef __cplusplus +extern "C" { +#endif + #define JSON_OBJECT_DEF_HASH_ENTRIES 16 #undef FALSE @@ -26,15 +30,16 @@ extern const char *json_hex_chars; /* forward structure definitions */ typedef int boolean; -struct printbuf; -struct lh_table; -struct array_list; -struct json_object; -struct json_object_iter; +typedef struct printbuf printbuf; +typedef struct lh_table lh_table; +typedef struct array_list array_list; +typedef struct json_object json_object; +typedef struct json_object_iter json_object_iter; +typedef struct json_tokener json_tokener; /* supported object types */ -enum json_type { +typedef enum json_type { json_type_null, json_type_boolean, json_type_double, @@ -42,7 +47,7 @@ enum json_type { json_type_object, json_type_array, json_type_string -}; +} json_type; /* reference counting functions */ @@ -307,4 +312,8 @@ extern struct json_object* json_object_new_string_len(const char *s, int len); */ extern const char* json_object_get_string(struct json_object *obj); +#ifdef __cplusplus +} +#endif + #endif |