Enhance error reporting
[jansson.git] / src / jansson_private.h
index e9e0097..951780c 100644 (file)
 #define container_of(ptr_, type_, member_)  \
     ((type_ *)((char *)ptr_ - offsetof(type_, member_)))
 
+/* On some platforms, max() may already be defined */
+#ifndef max
+#define max(a, b)  ((a) > (b) ? (a) : (b))
+#endif
+
 typedef struct {
     json_t json;
     hashtable_t hashtable;
@@ -58,4 +63,8 @@ typedef struct {
 
 const object_key_t *jsonp_object_iter_fullkey(void *iter);
 
+void jsonp_error_init(json_error_t *error, const char *source);
+void jsonp_error_set(json_error_t *error, int line, int column,
+                     const char *msg, ...);
+
 #endif