Make json_error_t opaque
[jansson.git] / src / jansson.h
index 78a2222..e463f81 100644 (file)
@@ -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