aboutsummaryrefslogtreecommitdiff
path: root/src/template.h
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-11-05 19:45:02 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2021-11-05 19:45:02 +0300
commit975465c3f5302117eef779672ada76627371c3bf (patch)
tree25e47f898ff4a2c3177e1979febc269ed4e719fd /src/template.h
parenta986818ad798d50f41d9e1fd569c926a67341b6e (diff)
downloadunja-975465c3f5302117eef779672ada76627371c3bf.tar.gz
unja-975465c3f5302117eef779672ada76627371c3bf.zip
Hashmap improvements and include guards
Hashmap capacity can be set programmatically and it grows/shrinks in size when the load increases/decreases to avoid collisions/save memory.
Diffstat (limited to 'src/template.h')
-rw-r--r--src/template.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/template.h b/src/template.h
index 45a58fc..6defb02 100644
--- a/src/template.h
+++ b/src/template.h
@@ -1,10 +1,19 @@
+#ifndef UNJA_TEMPLATE_H
+#define UNJA_TEMPLATE_H
+
#include "hashmap.h"
#include "vector.h"
-
struct env;
+
struct env *env_new();
+
void env_free(struct env *env);
+
char *template(struct env *env, char *template_name, struct hashmap *ctx);
+
char *template_string(char *tmpl, struct hashmap *ctx);
-char *read_file(char *filename); \ No newline at end of file
+
+char *read_file(char *filename);
+
+#endif