Make json_error_t opaque
[jansson.git] / src / jansson.h
index 41f9c9d..e463f81 100644 (file)
@@ -113,7 +113,7 @@ int json_object_set_nocheck(json_t *object, const char *key, json_t *value)
     return json_object_set_new_nocheck(object, key, json_incref(value));
 }
 
-static inline
+static JSON_INLINE
 int json_object_iter_set(json_t *object, void *iter, json_t *value)
 {
     return json_object_iter_set_new(object, iter, json_incref(value));
@@ -168,18 +168,19 @@ json_t *json_copy(json_t *value);
 json_t *json_deep_copy(json_t *value);
 
 
-/* loading, printing */
+/* error reporting */
 
-#define JSON_ERROR_TEXT_LENGTH  160
+typedef struct json_error_t json_error_t;
 
-typedef struct {
-    char text[JSON_ERROR_TEXT_LENGTH];
-    int line;
-} json_error_t;
+const char *json_error_msg(const json_error_t *error);
+int json_error_line(const json_error_t *error);
+
+
+/* loading, printing */
 
-json_t *json_loads(const char *input, size_t flags, json_error_t *error);
-json_t *json_loadf(FILE *input, size_t flags, json_error_t *error);
-json_t *json_load_file(const char *path, size_t flags, json_error_t *error);
+json_t *json_loads(const char *input, size_t flags, json_error_t **error);
+json_t *json_loadf(FILE *input, size_t flags, json_error_t **error);
+json_t *json_load_file(const char *path, size_t flags, json_error_t **error);
 
 #define JSON_INDENT(n)      (n & 0x1F)
 #define JSON_COMPACT        0x20