summaryrefslogtreecommitdiff
path: root/src/include/taler_json_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_json_lib.h')
-rw-r--r--src/include/taler_json_lib.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index 262e612cc..f0ae923f4 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -23,6 +23,14 @@
#include <jansson.h>
+/**
+ * Print JSON parsing related error information
+ */
+#define TALER_JSON_warn(error) \
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \
+ "JSON parsing failed at %s:%u: %s (%s)\n", \
+ __FILE__, __LINE__, error.text, error.source)
+
/**
* Convert a TALER amount to a JSON object.
@@ -103,6 +111,16 @@ TALER_JSON_to_data (json_t *json,
void *out,
size_t out_size);
+/**
+ * Check if the given wire format JSON object is correctly formatted
+ *
+ * @param type the type of the wire format
+ * @param wire the JSON wire format object
+ * @return 1 if correctly formatted; 0 if not
+ */
+int
+TALER_JSON_validate_wireformat (const char *type, json_t *wire);
+
#endif /* TALER_JSON_LIB_H_ */