STASIS
A pipeline delivery generator
Toggle main menu visibility
Loading...
Searching...
No Matches
src
lib
core
include
template.h
Go to the documentation of this file.
1
2
#ifndef STASIS_TEMPLATE_H
3
#define STASIS_TEMPLATE_H
4
5
#include "
core.h
"
6
13
void
tpl_register
(
char
*key,
char
**ptr);
14
18
void
tpl_free
();
19
25
char
*
tpl_getval
(
char
*key);
26
33
char
*
tpl_render
(
char
*str);
34
41
int
tpl_render_to_file
(
char
*str,
const
char
*filename);
42
43
struct
tplfunc_frame
;
44
45
typedef
int
tplfunc(
struct
tplfunc_frame
*frame,
void
*data_out);
46
47
struct
tplfunc_frame
{
48
char
*
key
;
49
tplfunc *
func
;
50
void
*
data_in
;
51
int
argc
;
52
union
{
53
char
**
t_char_refptr
;
54
char
*
t_char_ptr
;
55
void
*
t_void_ptr
;
56
int
*
t_int_ptr
;
57
unsigned
*
t_uint_ptr
;
58
float
*
t_float_ptr
;
59
double
*
t_double_ptr
;
60
char
t_char
;
61
int
t_int
;
62
unsigned
t_uint
;
63
float
t_float
;
64
double
t_double
;
65
} argv[10];
// accept up to 10 arguments
66
};
67
75
void
tpl_register_func
(
char
*key, tplfunc *tplfunc_ptr,
int
argc,
void
*data_in);
76
82
struct
tplfunc_frame
*
tpl_getfunc
(
char
*key);
83
84
#endif
//STASIS_TEMPLATE_H
core.h
tplfunc_frame
Definition
template.h:47
tplfunc_frame::t_double
double t_double
type of double
Definition
template.h:64
tplfunc_frame::t_char_ptr
char * t_char_ptr
pointer
Definition
template.h:54
tplfunc_frame::t_char_refptr
char ** t_char_refptr
&pointer
Definition
template.h:53
tplfunc_frame::argc
int argc
Maximum number of arguments to accept.
Definition
template.h:51
tplfunc_frame::t_int
int t_int
type of int
Definition
template.h:61
tplfunc_frame::t_float
float t_float
type of float
Definition
template.h:63
tplfunc_frame::t_uint
unsigned t_uint
type of unsigned int
Definition
template.h:62
tplfunc_frame::func
tplfunc * func
Pointer to the function.
Definition
template.h:49
tplfunc_frame::data_in
void * data_in
Pointer to internal data (can be NULL).
Definition
template.h:50
tplfunc_frame::t_char
char t_char
type of char
Definition
template.h:60
tplfunc_frame::t_int_ptr
int * t_int_ptr
pointer to int
Definition
template.h:56
tplfunc_frame::key
char * key
Name of the function.
Definition
template.h:48
tplfunc_frame::t_float_ptr
float * t_float_ptr
pointer to float
Definition
template.h:58
tplfunc_frame::t_double_ptr
double * t_double_ptr
pointer to double
Definition
template.h:59
tplfunc_frame::t_uint_ptr
unsigned * t_uint_ptr
pointer to unsigned int
Definition
template.h:57
tplfunc_frame::t_void_ptr
void * t_void_ptr
pointer to void
Definition
template.h:55
tpl_getval
char * tpl_getval(char *key)
Definition
template.c:129
tpl_register
void tpl_register(char *key, char **ptr)
Definition
template.c:64
tpl_register_func
void tpl_register_func(char *key, tplfunc *tplfunc_ptr, int argc, void *data_in)
Definition
template.c:29
tpl_getfunc
struct tplfunc_frame * tpl_getfunc(char *key)
Definition
template.c:143
tpl_free
void tpl_free()
Definition
template.c:107
tpl_render
char * tpl_render(char *str)
Definition
template.c:157
tpl_render_to_file
int tpl_render_to_file(char *str, const char *filename)
Definition
template.c:311
Generated by
1.17.0