aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-07-30 20:41:40 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-07-30 20:41:40 +0530
commitfabba1b2fbcb0d8dcbf77f5336ec880f561d627c (patch)
tree7c7fa4045731aac09e4c4cd10f98471cc75701ba /include
parent0cd55a7b37edf098c6b6ffdb551cfb80629e3c79 (diff)
engine,template: engine_ingest() must return engine_t and template_write() must get the template from config
Diffstat (limited to 'include')
-rw-r--r--include/engine.h9
-rw-r--r--include/template.h7
2 files changed, 10 insertions, 6 deletions
diff --git a/include/engine.h b/include/engine.h
index 86aa167..137f201 100644
--- a/include/engine.h
+++ b/include/engine.h
@@ -19,10 +19,17 @@
#ifndef __ENGINE_H
#define __ENGINE_H
+#include <config.h>
#include <lexer.h>
#include <list.h>
-list_t *engine_ingest(char **buffer);
+typedef struct {
+ list_t *content_headers;
+ config_t *config;
+} engine_t;
+
+engine_t *engine_ingest(char **buffer);
+void engine_delete(engine_t *engine);
void handle_include(char **buffer, key_match_t *match, directive_t *directive);
void handle_contentfor(char **buffer,
key_match_t *match,
diff --git a/include/template.h b/include/template.h
index 4676feb..122825c 100644
--- a/include/template.h
+++ b/include/template.h
@@ -19,6 +19,7 @@
#ifndef __TEMPLATE_H
#define __TEMPLATE_H
+#include <engine.h>
#include <list.h>
#include <stdbool.h>
#include <stdio.h>
@@ -31,10 +32,6 @@ void template_initialize(void);
void template_clean(void);
template_t *template_create(char *template_name);
void template_delete(template_t *template);
-void template_write(template_t *template,
- list_t *content_headers,
- FILE *f,
- void *doc,
- bool is_markdown);
+void template_write(engine_t *engine, FILE *f, void *doc, bool is_markdown);
#endif