feat(ltm): start library
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Jef Roosens 2023-12-14 09:44:07 +01:00
parent d53a949946
commit 4f4b780b28
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 2032 additions and 0 deletions

8
ltm/include/ltm/common.h Normal file
View file

@ -0,0 +1,8 @@
#ifndef LTM_COMMON
#define LTM_COMMON
typedef enum ltm_err {
ltm_err_ok = 0,
} ltm_err;
#endif

View file

@ -0,0 +1,30 @@
#ifndef LTM_TEMPLATE
#define LTM_TEMPLATE
#include <stdlib.h>
#include "ltm/common.h"
/**
* Represents a compiled template
*/
typedef struct lnm_template lnm_template;
/**
* Compile the given template.
*
* @param out where to store pointer to newly allocated `lnm_template`
* @param template nul-terminated string containing the template
*/
ltm_err lnm_template_compile(lnm_template **out, const char *template);
/**
* Compile the given template with a given length.
*
* @param out where to store pointer to newly allocated `lnm_template`
* @param template char buffer containing the template
* @param len length of the char buffer
*/
ltm_err lnm_template_compile_n(lnm_template **out, const char *template, size_t len);
#endif