diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-25 15:57:58 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-25 15:57:58 +0530 |
commit | 1de65cb71f8b135c14b00804f6166622f402171d (patch) | |
tree | 55f912add7e2d6bb2f5f7c69215aa3d0d3518ea8 /include/lexer.h | |
parent | 66994192d467c41ae82d15131e6814af3cc50bad (diff) |
lexer: move away from a monolithic function to determine directive
Diffstat (limited to 'include/lexer.h')
-rw-r--r-- | include/lexer.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/lexer.h b/include/lexer.h index d93877e..0831e90 100644 --- a/include/lexer.h +++ b/include/lexer.h @@ -3,6 +3,8 @@ #include <list.h> +#define DIRECTIVE_IS(key) strncmp(buffer + n, key, strlen(key)) == 0 + typedef enum { _RAW, INCLUDE, @@ -33,4 +35,18 @@ directive_t *find_directive(char *content, key_match_t *match); key_match_t *find_next_key(char *buffer, size_t skip); char *find_contentfor_value(list_t *content_headers, char *key); +void lexer_handle_include(directive_t *directive, + key_match_t *match, + char *buffer, + size_t n); +void lexer_handle_contentfor(directive_t *directive, + key_match_t *match, + char *buffer, + char *content, + size_t n); +void lexer_handle_content(directive_t *directive, + key_match_t *match, + char *buffer, + size_t n); + #endif |