* 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
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 @@
 /* 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 @@
   json_type_object,
   json_type_array,
   json_type_string
-};
+} json_type;
 
 /* reference counting functions */
 
@@ -307,4 +312,8 @@
  */
 extern const char* json_object_get_string(struct json_object *obj);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif