lander/ltm/include/ltm/template.h

31 lines
747 B
C

#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