aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_json_lib.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-02-17 17:23:13 +0100
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-02-17 17:29:43 +0100
commitbea425de6cbbfb054a19e0f2312c5ef00c2e1bbe (patch)
treef0c5b1b1d1a1df235555dd5ed3a1a624bd3c8886 /src/include/taler_json_lib.h
parent2f51cd3e3ec8a439e54be154a0c5b639483fb919 (diff)
Fix #3624: Check JSON format for wire deposits (SEPA specification)
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_ */