summaryrefslogtreecommitdiff
path: root/src/include/taler_templating_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-12-16 16:00:13 +0100
committerChristian Grothoff <christian@grothoff.org>2022-12-16 16:00:13 +0100
commit28dfae3e7c5d7291a4036358050c9c886ee43316 (patch)
treefa1d2ee9a1b6c926198d74fe417e44bcd395a0f8 /src/include/taler_templating_lib.h
parent58983d7455dd0529be0b7e6ba599845956c75ea4 (diff)
downloadexchange-28dfae3e7c5d7291a4036358050c9c886ee43316.tar.gz
exchange-28dfae3e7c5d7291a4036358050c9c886ee43316.tar.bz2
exchange-28dfae3e7c5d7291a4036358050c9c886ee43316.zip
expose templating API for in-memory data
Diffstat (limited to 'src/include/taler_templating_lib.h')
-rw-r--r--src/include/taler_templating_lib.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/taler_templating_lib.h b/src/include/taler_templating_lib.h
index e4f3f1f1c..53946b9c0 100644
--- a/src/include/taler_templating_lib.h
+++ b/src/include/taler_templating_lib.h
@@ -25,6 +25,23 @@
/**
+ * Fill in Mustach template @a tmpl using the data from @a root
+ * and return the result in @a result.
+ *
+ * @param tmpl 0-terminated string with Mustach template
+ * @param root JSON data to fill into the template
+ * @param[out] result where to write the result
+ * @param[out] result_size where to write the length of the result
+ * @return 0 on success, otherwise Mustach-specific error code
+ */
+int
+TALER_TEMPLATING_fill (const char *tmpl,
+ const json_t *root,
+ void **result,
+ size_t *result_size);
+
+
+/**
* Load a @a template and substitute using @a root, returning the result in a
* @a reply encoded suitable for the @a connection with the given @a
* http_status code. On errors, the @a http_status code