#include "pstring.h"
#include "pabidecl.h"
Typedefs | |
typedef void | ABSTRACT_WRITER |
optional pointer to be passed to a callback of writer_functype. | |
typedef void | ABSTRACT_FINDFILE |
optional pointer to be passed to a callback of find_file_functype. | |
typedef void | ABSTRACT_FILTER |
optional pointer to be passed to a callback of load_file_functype / unload_file_functype. | |
typedef void | ABSTRACT_CALLER |
optional pointer to be passed to a callback of call_expr_userfnc_functype. | |
typedef void | ABSTRACT_DATASTATE |
optional pointer to be passed to data manipulation callbacks of get_ABSTRACT_VALUE_functype, ABSTRACT_VALUE2ABSTRACT_ARRAY_functype, get_ABSTRACT_ARRAY_length_functype, is_ABSTRACT_VALUE_true_functype, get_ABSTRACT_MAP_functype, exit_loop_scope_functype. | |
typedef void | ABSTRACT_ARRAY |
optional pointer representing a loop. | |
typedef void | ABSTRACT_MAP |
optional pointer representing a root scope or a loop scope. | |
typedef void | ABSTRACT_VALUE |
optional pointer representing an abstract value that can be converted to a sting or loop. | |
typedef void | ABSTRACT_FUNCMAP |
optional pointer to be passed to a callback of is_expr_userfnc_functype. | |
typedef void | ABSTRACT_ARGLIST |
optional pointer representing a list accumulating arguments to user function call. | |
typedef void | ABSTRACT_USERFUNC |
optional pointer representing user function. | |
typedef struct exprval | ABSTRACT_EXPRVAL |
optional pointer representing user function argument or return value. | |
typedef void BACKCALL(* | writer_functype )(ABSTRACT_WRITER *, const char *begin, const char *endnext) |
optional callback for writing or accumulating a piece of generated text. | |
typedef ABSTRACT_VALUE *BACKCALL(* | get_ABSTRACT_VALUE_functype )(ABSTRACT_DATASTATE *, ABSTRACT_MAP *, PSTRING name) |
required callback to get a variable value. | |
typedef PSTRING BACKCALL(* | ABSTRACT_VALUE2PSTRING_functype )(ABSTRACT_DATASTATE *, ABSTRACT_VALUE *) |
required callback to transform into PSTRING a variable name passed to callback of get_ABSTRACT_VALUE_functype. | |
typedef int BACKCALL(* | is_ABSTRACT_VALUE_true_functype )(ABSTRACT_DATASTATE *, ABSTRACT_VALUE *) |
optional callback to fine-tune is ABSTRACT_VALUE* is true or false. | |
typedef ABSTRACT_ARRAY *BACKCALL(* | ABSTRACT_VALUE2ABSTRACT_ARRAY_functype )(ABSTRACT_DATASTATE *, ABSTRACT_VALUE *) |
required callback to transform into ABSTRACT_ARRAY a variable name passed to callback of get_ABSTRACT_VALUE_functype. | |
typedef int BACKCALL(* | get_ABSTRACT_ARRAY_length_functype )(ABSTRACT_DATASTATE *, ABSTRACT_ARRAY *) |
optional callback to specify a length of the loop. | |
typedef ABSTRACT_MAP *BACKCALL(* | get_ABSTRACT_MAP_functype )(ABSTRACT_DATASTATE *, ABSTRACT_ARRAY *, int) |
required callback to transform into ABSTRACT_ARRAY a variable name passed to callback of get_ABSTRACT_VALUE_functype. | |
typedef const char *BACKCALL(* | find_file_functype )(ABSTRACT_FINDFILE *, const char *filename, const char *prevfilename) |
optional callback to fine-tune the algorythm of finding template file by name. | |
typedef PSTRING BACKCALL(* | load_file_functype )(ABSTRACT_FILTER *, const char *filename) |
optional callback to load and preprocess (filter) files. | |
typedef int BACKCALL(* | unload_file_functype )(ABSTRACT_FILTER *, PSTRING memarea) |
optional callback to free memory accuired by a callback of load_file_functype. | |
typedef ABSTRACT_USERFUNC *BACKCALL(* | is_expr_userfnc_functype )(ABSTRACT_FUNCMAP *, PSTRING name) |
optional callback for support of user-provided functions. | |
typedef ABSTRACT_ARGLIST *BACKCALL(* | init_expr_arglist_functype )(ABSTRACT_CALLER *) |
optional callback to initialize the list of arguments for a user-provided function. | |
typedef void BACKCALL(* | push_expr_arglist_functype )(ABSTRACT_ARGLIST *, ABSTRACT_EXPRVAL *) |
optional callback to add new value to the list of arguments for a user-provided function. | |
typedef void BACKCALL(* | free_expr_arglist_functype )(ABSTRACT_ARGLIST *) |
optional callback to release the list of arguments for a user-provided function. | |
typedef void BACKCALL(* | call_expr_userfnc_functype )(ABSTRACT_CALLER *, ABSTRACT_ARGLIST *, ABSTRACT_USERFUNC *, ABSTRACT_EXPRVAL *return_value) |
optional callback to call a user-provided function with a current list of arguments. |
In order to interact with core library a wrapper should provide some callback functions. This file specifies which callbacks can be provided.
typedef void ABSTRACT_ARGLIST |
optional pointer representing a list accumulating arguments to user function call.
It is returned from a callback of init_expr_arglist_functype and is passed to callbacks of push_expr_arglist_functype, call_expr_userfnc_functype and free_expr_arglist_functype.
typedef void ABSTRACT_ARRAY |
optional pointer representing a loop.
It is returned from a callback of ABSTRACT_VALUE2ABSTRACT_ARRAY_functype and is passed to callbacks of get_ABSTRACT_ARRAY_length_functype and get_ABSTRACT_MAP_functype.
typedef void ABSTRACT_CALLER |
optional pointer to be passed to a callback of call_expr_userfnc_functype.
Optional pointer to store internal state for a callback of call_expr_userfnc_functype. If used, it should be stored beforehand with tmplpro_set_option_ext_calluserfunc_state().
typedef void ABSTRACT_DATASTATE |
optional pointer to be passed to data manipulation callbacks of get_ABSTRACT_VALUE_functype, ABSTRACT_VALUE2ABSTRACT_ARRAY_functype, get_ABSTRACT_ARRAY_length_functype, is_ABSTRACT_VALUE_true_functype, get_ABSTRACT_MAP_functype, exit_loop_scope_functype.
Optional pointer to store internal state for a callback of get_ABSTRACT_VALUE_functype, ABSTRACT_VALUE2ABSTRACT_ARRAY_functype, get_ABSTRACT_ARRAY_length_functype, is_ABSTRACT_VALUE_true_functype, get_ABSTRACT_MAP_functype, exit_loop_scope_functype. If used, it should be stored beforehand with tmplpro_set_option_ext_data_state().
typedef void ABSTRACT_EXPRVAL |
optional pointer representing user function argument or return value.
It is passed to callbacks of push_expr_arglist_functype and call_expr_userfnc_functype.
typedef void ABSTRACT_FILTER |
optional pointer to be passed to a callback of load_file_functype / unload_file_functype.
Optional pointer to store internal state for a callback of load_file_functype / unload_file_functype. If used, it should be stored beforehand with tmplpro_set_option_ext_filter_state().
typedef void ABSTRACT_FINDFILE |
optional pointer to be passed to a callback of find_file_functype.
Optional pointer to store internal state for a callback of find_file_functype. If used, it should be stored beforehand with tmplpro_set_option_ext_findfile_state().
typedef void ABSTRACT_FUNCMAP |
optional pointer to be passed to a callback of is_expr_userfnc_functype.
If used, it should be stored beforehand with tmplpro_set_option_expr_func_map().
typedef void ABSTRACT_MAP |
optional pointer representing a root scope or a loop scope.
Pointer for the loop scope is returned from a callback of get_ABSTRACT_MAP_functype. Pointer of the root scope should be stored beforehead using tmplpro_set_option_root_param_map(). Both types of pointers are passed to callback of get_ABSTRACT_VALUE_functype. Also, root scope pointer is passed to callbacks of end_loop_functype and select_loop_scope_functype.
typedef void ABSTRACT_USERFUNC |
optional pointer representing user function.
It is returned from a callback of is_expr_userfnc_functype and is passed to callback of call_expr_userfnc_functype.
typedef void ABSTRACT_VALUE |
optional pointer representing an abstract value that can be converted to a sting or loop.
It is returned from callback of get_ABSTRACT_VALUE_functype and passed to callbacks of ABSTRACT_VALUE2ABSTRACT_ARRAY_functype and ABSTRACT_VALUE2PSTRING_functype.
typedef ABSTRACT_ARRAY *(* ABSTRACT_VALUE2ABSTRACT_ARRAY_functype)(ABSTRACT_VALUE *) |
required callback to transform into ABSTRACT_ARRAY a variable name passed to callback of get_ABSTRACT_VALUE_functype.
ABSTRACT_VALUE* | optional pointer returned by callback of get_ABSTRACT_VALUE_functype. |
typedef PSTRING(* ABSTRACT_VALUE2PSTRING_functype)(ABSTRACT_VALUE *) |
required callback to transform into PSTRING a variable name passed to callback of get_ABSTRACT_VALUE_functype.
ABSTRACT_VALUE* | optional pointer returned by callback of get_ABSTRACT_VALUE_functype. |
typedef void ABSTRACT_WRITER |
optional pointer to be passed to a callback of writer_functype.
Optional pointer to store internal state for a callback of writer_functype. If used, it should be stored beforehand with tmplpro_set_option_ext_writer_state().
typedef void(* call_expr_userfnc_functype)(ABSTRACT_CALLER *, ABSTRACT_ARGLIST *, ABSTRACT_USERFUNC *, ABSTRACT_EXPRVAL *) |
optional callback to call a user-provided function with a current list of arguments.
ABSTRACT_CALLER* | optional pointer stored by tmplpro_set_option_ext_calluserfunc_state(). | |
ABSTRACT_ARGLIST* | optional pointer returned by callback of init_expr_arglist_functype. | |
ABSTRACT_USERFUNC* | optional pointer returned by callback of is_expr_userfnc_functype. | |
ABSTRACT_EXPRVAL* | pointer required by tmplpro_set_expr_as_* functions (a place the return value will be stored). |
typedef const char *(* find_file_functype)(ABSTRACT_FINDFILE *, const char *filename, const char *prevfilename) |
optional callback to fine-tune the algorythm of finding template file by name.
ABSTRACT_FINDFILE* | optional pointer stored by tmplpro_set_option_ext_writer_state(). | |
filename | file to be found. | |
prevfilename | fully qualified path to containing file, if any. |
typedef void(* free_expr_arglist_functype)(ABSTRACT_ARGLIST *) |
optional callback to release the list of arguments for a user-provided function.
Note that if function calls are nested, then the calls to a callbacks of init_expr_arglist_functype, push_expr_arglist_functype, free_expr_arglist_functype will also be nested.
ABSTRACT_ARGLIST* | optional pointer returned by callback of init_expr_arglist_functype. |
typedef int(* get_ABSTRACT_ARRAY_length_functype)(ABSTRACT_ARRAY *) |
optional callback to specify a length of the loop.
ABSTRACT_ARRAY* | optional pointer returned by callback of ABSTRACT_VALUE2ABSTRACT_ARRAY_functype. |
typedef ABSTRACT_MAP *(* get_ABSTRACT_MAP_functype)(ABSTRACT_ARRAY *, int n) |
required callback to transform into ABSTRACT_ARRAY a variable name passed to callback of get_ABSTRACT_VALUE_functype.
ABSTRACT_ARRAY* | optional pointer returned by callback of ABSTRACT_VALUE2ABSTRACT_ARRAY_functype. | |
n | - number of current loop iteration. |
typedef ABSTRACT_VALUE *(* get_ABSTRACT_VALUE_functype)(ABSTRACT_MAP *, PSTRING name) |
required callback to get a variable value.
PSTRING | name - a name as in <TMPL_VAR NAME="var1"> | |
ABSTRACT_MAP* | pointer returned by callback of get_ABSTRACT_MAP_functype. |
typedef ABSTRACT_ARGLIST *(* init_expr_arglist_functype)(ABSTRACT_CALLER *) |
optional callback to initialize the list of arguments for a user-provided function.
Note that if function calls are nested, then the calls to a callbacks of init_expr_arglist_functype, push_expr_arglist_functype, free_expr_arglist_functype will also be nested.
ABSTRACT_CALLER* | optional pointer stored by tmplpro_set_option_ext_calluserfunc_state(). |
typedef int(* is_ABSTRACT_VALUE_true_functype)(ABSTRACT_VALUE *) |
optional callback to fine-tune is ABSTRACT_VALUE* is true or false.
ABSTRACT_VALUE* | optional pointer returned by callback of get_ABSTRACT_VALUE_functype. |
typedef ABSTRACT_USERFUNC *(* is_expr_userfnc_functype)(ABSTRACT_FUNCMAP *, PSTRING name) |
optional callback for support of user-provided functions.
ABSTRACT_FUNCMAP* | optional pointer stored by tmplpro_set_option_expr_func_map(). | |
name | name of function |
typedef PSTRING(* load_file_functype)(ABSTRACT_FILTER *, const char *filename) |
optional callback to load and preprocess (filter) files.
Only called if filters option is true (set by tmplpro_set_option_filters() ).
ABSTRACT_FILTER* | optional pointer stored by tmplpro_set_option_ext_filter_state(). | |
filename | fully qualified path to a file to be loaded (as returned by callback of find_file_functype). |
typedef void(* push_expr_arglist_functype)(ABSTRACT_ARGLIST *, ABSTRACT_EXPRVAL *) |
optional callback to add new value to the list of arguments for a user-provided function.
Note that if function calls are nested, then the calls to a callbacks of init_expr_arglist_functype, push_expr_arglist_functype, free_expr_arglist_functype will also be nested.
ABSTRACT_ARGLIST* | optional pointer returned by callback of init_expr_arglist_functype. | |
ABSTRACT_EXPRVAL* | pointer required by tmplpro_get_expr_* functions to retrieve the value (a place the pushed value is stored). |
typedef int(* unload_file_functype)(ABSTRACT_FILTER *, PSTRING memarea) |
optional callback to free memory accuired by a callback of load_file_functype.
Only called if filters option is true (set by tmplpro_set_option_filters() ).
ABSTRACT_FILTER* | optional pointer stored by tmplpro_set_option_ext_filter_state(). | |
memarea | pointers to loaded area (as returned by callback of load_file_functype). |
typedef void(* writer_functype)(ABSTRACT_WRITER *, const char *begin, const char *endnext) |
optional callback for writing or accumulating a piece of generated text.
begin,endnext | - pointers to memory area containing the output string. | |
ABSTRACT_WRITER* | - pointer stored by tmplpro_set_option_ext_writer_state() or NULL if nothing was stored. |