diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-16 16:00:13 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-16 16:00:13 +0100 |
commit | 28dfae3e7c5d7291a4036358050c9c886ee43316 (patch) | |
tree | fa1d2ee9a1b6c926198d74fe417e44bcd395a0f8 /src/templating | |
parent | 58983d7455dd0529be0b7e6ba599845956c75ea4 (diff) | |
download | exchange-28dfae3e7c5d7291a4036358050c9c886ee43316.tar.xz |
expose templating API for in-memory data
Diffstat (limited to 'src/templating')
-rw-r--r-- | src/templating/templating_api.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/templating/templating_api.c b/src/templating/templating_api.c index 47ada208e..324e199eb 100644 --- a/src/templating/templating_api.c +++ b/src/templating/templating_api.c @@ -171,6 +171,31 @@ make_static_url (struct MHD_Connection *con, } +int +TALER_TEMPLATING_fill (const char *tmpl, + const json_t *root, + void **result, + size_t *result_size) +{ + int eno; + + if (0 != + (eno = mustach_jansson (tmpl, + (json_t *) root, + (char **) result, + result_size))) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "mustach failed on template with error %d\n", + eno); + *result = NULL; + *result_size = 0; + return eno; + } + return eno; +} + + enum GNUNET_GenericReturnValue TALER_TEMPLATING_build (struct MHD_Connection *connection, unsigned int *http_status, |