aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-03-14 15:42:02 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-03-14 15:42:02 -0400
commitcbc975b048a91735466becef4e7804f35be9ca52 (patch)
tree223559dfa410a830f421f8f9c9c0425a9f092bff /include
parent5f50ddc00a48bb14122164a6c3b514ba8b09a321 (diff)
downloadstasis-cbc975b048a91735466becef4e7804f35be9ca52.tar.gz
Add template functions to store/load function pointers.
* Incomplete and unused for now
Diffstat (limited to 'include')
-rw-r--r--include/template.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/template.h b/include/template.h
index 116960f..a242a08 100644
--- a/include/template.h
+++ b/include/template.h
@@ -40,4 +40,28 @@ char *tpl_render(char *str);
*/
int tpl_render_to_file(char *str, const char *filename);
+struct tplfunc_frame *tpl_getfunc(char *key);
+struct tplfunc_frame;
+typedef int tplfunc(struct tplfunc_frame *frame);
+struct tplfunc_frame {
+ char *key;
+ tplfunc *func;
+ int argc;
+ union {
+ char **t_char_refptr;
+ char *t_char_ptr;
+ void *t_void_ptr;
+ int *t_int_ptr;
+ unsigned *t_uint_ptr;
+ float *t_float_ptr;
+ double *t_double_ptr;
+ char t_char;
+ int t_int;
+ unsigned t_uint;
+ float t_float;
+ double t_double;
+ } argv[10]; // accept up to 10 arguments
+};
+void tpl_register_func(char *key, struct tplfunc_frame *frame);
+
#endif //OMC_TEMPLATE_H