diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 20:41:40 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 20:41:40 +0530 |
commit | fabba1b2fbcb0d8dcbf77f5336ec880f561d627c (patch) | |
tree | 7c7fa4045731aac09e4c4cd10f98471cc75701ba /src/msg.c | |
parent | 0cd55a7b37edf098c6b6ffdb551cfb80629e3c79 (diff) |
engine,template: engine_ingest() must return engine_t and template_write() must get the template from config
Diffstat (limited to 'src/msg.c')
-rw-r--r-- | src/msg.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -37,7 +37,6 @@ #include <util.h> extern msg_t *msg; -template_t *base_template; void handle_file(const char *path) @@ -95,11 +94,11 @@ handle_file(const char *path) if (dot && strcmp(dot, ".md") == 0) { MMIOT *doc = mkd_string(buffer, size, 0); - template_write(base_template, NULL, out, doc, true); + template_write(NULL, out, doc, true); } else if (strlen(buffer) != 0) { - list_t *content_headers = engine_ingest(&buffer); - template_write(base_template, content_headers, out, buffer, false); - list_delete(content_headers); + engine_t *engine = engine_ingest(&buffer); + template_write(engine, out, buffer, false); + engine_delete(engine); } free(buffer); @@ -129,7 +128,6 @@ run(void) return EXIT_FAILURE; template_initialize(); - base_template = template_create(BASE_TEMPLATE); int err = mkdir(msg->output_directory, 0700); if (err != 0 && errno != EEXIST) { @@ -178,7 +176,6 @@ run(void) handle_file(path); } - template_delete(base_template); template_clean(); config_delete(config); |