aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-11-07 18:48:44 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2018-11-07 19:03:22 -0500
commit751d5bdf11223dbf00e419ae52402cedce388add (patch)
tree5d5652c502b8f4c2d51526a3f2e8694d04611a03 /include
parenta1e4097ce8a417c8b6b6011b0c2deb113c0417f2 (diff)
downloadlibctemplates-751d5bdf11223dbf00e419ae52402cedce388add.tar.gz
libctemplates-751d5bdf11223dbf00e419ae52402cedce388add.tar.bz2
libctemplates-751d5bdf11223dbf00e419ae52402cedce388add.zip
Changed structs in header to forward declarations
Diffstat (limited to 'include')
-rw-r--r--include/ctemplates.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/include/ctemplates.h b/include/ctemplates.h
index a8855a8..27127f6 100644
--- a/include/ctemplates.h
+++ b/include/ctemplates.h
@@ -16,42 +16,29 @@
//Length of error messages
#define ERR_MSG_LEN 500
-struct TMPL_varlist{
- map_t map;
-}TMPL_varlist;
+struct TMPL_varlist;
-struct TMPL_loop{
- struct TMPL_varlist* varlist;
- size_t loop_len;
- struct TMPL_loop* next;
- struct TMPL_loop* tail;
-};
+struct TMPL_loop;
/* Holdes all the data needed for a template*/
-struct TMPL_templates{
- struct TMPL_buf* out;
- struct TMPL_buf* errout;
- struct TMPL_tagnode* roottag;
- int linenum;
- int error;
-} TMPL_templates;
+struct TMPL_templates;
-
-void TMPL_add_var_to_varlist(struct TMPL_varlist* vl, char* name, char* value);
-void TMPL_add_loop_to_varlist(struct TMPL_varlist* vl, char* name, struct TMPL_loop* loop);
+void TMPL_add_var_to_varlist(struct TMPL_varlist* vl, const char* name, const char* value);
+void TMPL_add_loop_to_varlist(struct TMPL_varlist* vl, const char* name, struct TMPL_loop* loop);
void TMPL_add_varlist_to_loop(struct TMPL_loop* l, struct TMPL_varlist* vl);
struct TMPL_varlist* TMPL_alloc_varlist(void);
void TMPL_free_varlist(struct TMPL_varlist* t);
-struct TMPL_templates* TMPL_alloc_template(char* t);
+struct TMPL_templates* TMPL_alloc_template(const char* t);
void TMPL_free_template(struct TMPL_templates* t);
struct TMPL_loop* TMPL_alloc_loop(void);
void TMPL_free_loop(struct TMPL_loop* tl);
char* TMPL_render(struct TMPL_templates* t, struct TMPL_varlist* varlist, size_t* size_p);
+const char* TMPL_err(struct TMPL_templates* t);
/*A debug function*/
void print_varlist(struct TMPL_varlist* vl);