feat(ltm): start library
This commit is contained in:
parent
675c9b78ff
commit
5df1ea8309
6 changed files with 2032 additions and 0 deletions
8
ltm/include/ltm/common.h
Normal file
8
ltm/include/ltm/common.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef LTM_COMMON
|
||||
#define LTM_COMMON
|
||||
|
||||
typedef enum ltm_err {
|
||||
ltm_err_ok = 0,
|
||||
} ltm_err;
|
||||
|
||||
#endif
|
||||
30
ltm/include/ltm/template.h
Normal file
30
ltm/include/ltm/template.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue