diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-02 15:24:34 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-02 15:24:34 +0530 |
commit | b5829262c78c7801b0babfcb007ed4ee5d332414 (patch) | |
tree | 83b5798c9a379b7e41f6eae023a7026faff1bae7 | |
parent | 665cd823efa91f2c1d614531f199e8e990709575 (diff) |
(engine): make handle_* publicly available
-rw-r--r-- | include/engine.h | 8 | ||||
-rw-r--r-- | src/engine.c | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/include/engine.h b/include/engine.h index a34841a..885a2b2 100644 --- a/include/engine.h +++ b/include/engine.h @@ -1,6 +1,14 @@ #ifndef __ENGINE_H #define __ENGINE_H +#include <lexer.h> +#include <list.h> + void ingest(char **buffer); +void handle_include(char **buffer, key_match_t *match, directive_t *directive); +void handle_contentfor(char **buffer, + key_match_t *match, + directive_t *directive, + list_t *content_headers); #endif diff --git a/src/engine.c b/src/engine.c index 201aab1..da61df8 100644 --- a/src/engine.c +++ b/src/engine.c @@ -10,7 +10,7 @@ #include "../config.h" -static void +void handle_include(char **buffer, key_match_t *match, directive_t *directive) { char *operand = directive->operands; @@ -40,7 +40,7 @@ handle_include(char **buffer, key_match_t *match, directive_t *directive) free(temp_buffer); } -static void +void handle_contentfor(char **buffer, key_match_t *match, directive_t *directive, @@ -100,16 +100,14 @@ ingest(char **buffer) } switch (directive->type) { - case INCLUDE: { + case INCLUDE: handle_include(buffer, match, directive); break; - } - case CONTENTFOR: { + case CONTENTFOR: handle_contentfor(buffer, match, directive, content_headers); break; - } - /* NOTE: This will never occur */ + /* TODO: Handle this gracefully */ case BODY: case ENDCONTENT: break; |