aboutsummaryrefslogtreecommitdiff
path: root/ctemplates.h
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-12-22 23:03:44 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-12-22 23:03:44 -0500
commit3e4c76bf41011d8f40136a4010e9ff331b00b4ea (patch)
tree82349a7c9f95b6c95c68daa8176cb42f75f182a9 /ctemplates.h
parent5926e6122a8eaf70aac25fa7b2c3bf12c7025978 (diff)
downloadlibctemplates-3e4c76bf41011d8f40136a4010e9ff331b00b4ea.tar.gz
libctemplates-3e4c76bf41011d8f40136a4010e9ff331b00b4ea.tar.bz2
libctemplates-3e4c76bf41011d8f40136a4010e9ff331b00b4ea.zip
Renamed files
Renamed everything that needed to be rename from libctemplate to libctemplates
Diffstat (limited to 'ctemplates.h')
-rw-r--r--ctemplates.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/ctemplates.h b/ctemplates.h
new file mode 100644
index 0000000..4479141
--- /dev/null
+++ b/ctemplates.h
@@ -0,0 +1,56 @@
+/*
+ * C TemplateS Library 0.1 -
+ * Forked from C Template Library 1.0 by Stephen C. Losen.
+ *
+ * Copyright 2017 Alexander M. Pickering Distributed under the terms
+ * of the GNU General Public License (GPL)
+ */
+
+#ifndef _CTEMPLATE_H
+#define _CTEMPLATE_H
+
+/*
+ * TMPL_varlist is a variable list of simple variables and/or
+ * loop variables
+ */
+
+/* Holdes all the data needed for a template*/
+struct TMPL_templates;
+struct TMPL_varlist;
+struct TMPL_loop;
+
+
+
+/*Things to do with varlists*/
+extern struct TMPL_varlist* TMPL_alloc_varlist();
+extern struct TMPL_loop* TMPL_alloc_loop();
+extern void TMPL_add_var_to_varlist(
+ struct TMPL_varlist* t,
+ char* varname,
+ char* value
+ );
+extern void TMPL_add_loop_to_varlist(
+ struct TMPL_varlist* t,
+ char* name,
+ struct TMPL_loop* l
+ );
+extern void TMPL_add_varlist_to_loop(
+ struct TMPL_loop* l,
+ struct TMPL_varlist* t
+ );
+
+extern void TMPL_free_varlist(struct TMPL_varlist* t);
+extern void TMPL_free_loop(struct TMPL_loop* l);
+
+
+
+
+extern struct TMPL_templates* TMPL_alloc_template(char* t);
+extern void TMPL_free_template(struct TMPL_templates* t);
+
+extern char* TMPL_render(struct TMPL_templates* t,struct TMPL_varlist* varlist);
+
+extern char* TMPL_get_error(struct TMPL_templates* t);
+
+
+#endif