![]() |
STASIS
A pipeline delivery generator
|
#include "core.h"
Go to the source code of this file.
Data Structures | |
| struct | tplfunc_frame |
Typedefs | |
| typedef int | tplfunc(struct tplfunc_frame *frame, void *data_out) |
Functions | |
| void | tpl_register (char *key, char **ptr) |
| void | tpl_free () |
| char * | tpl_getval (char *key) |
| char * | tpl_render (char *str) |
| int | tpl_render_to_file (char *str, const char *filename) |
| void | tpl_register_func (char *key, tplfunc *tplfunc_ptr, int argc, void *data_in) |
| struct tplfunc_frame * | tpl_getfunc (char *key) |
| void tpl_free | ( | ) |
Free the template engine
| struct tplfunc_frame * tpl_getfunc | ( | char * | key | ) |
Get the function frame associated with a template function
| key | function name |
| char * tpl_getval | ( | char * | key | ) |
Retrieve the value of a key mapped by the template engine
| key | string registered by tpl_register |
| void tpl_register | ( | char * | key, |
| char ** | ptr ) |
Map a text value to a pointer in memory
| key | in-text variable name |
| ptr | pointer to string |
| void tpl_register_func | ( | char * | key, |
| tplfunc * | tplfunc_ptr, | ||
| int | argc, | ||
| void * | data_in ) |
Register a template function
| key | function name to expose to "func:" interface |
| tplfunc_ptr | pointer to function of type tplfunc |
| argc | number of function arguments to accept |
| data_in | pointer to function input data |
| char * tpl_render | ( | char * | str | ) |
Replaces occurrences of all registered key value pairs in str
| str | the text data to render |

| int tpl_render_to_file | ( | char * | str, |
| const char * | filename ) |
Write tpl_render() output to a file
| str | the text to render |
| filename | the output file name |
