1cs_register_strfunc(3) cs/cs.h cs_register_strfunc(3)
2
3
4
6 cs_register_strfunc - register a string handling function
7
9 #include <cs/cs.h>
10
11
12 NEOERR *cs_register_strfunc(CSPARSE *parse, char *funcname, CSSTRFUNC str_func);
13
14
15
16
18 parse - a pointer to a CSPARSE structure initialized with cs_init()
19 funcname - the name for the CS function call
20 Note that registering a duplicate funcname will
21 raise a NERR_DUPLICATE error
22 str_func - a CSSTRFUNC not-callback
23
24
26 cs_register_strfunc will register a string function that can be called
27 during CS render. This not-callback is designed to allow for string
28 formating/escaping functions that are not built-in to CS (since CS is
29 not HTML specific, for instance, but it is very useful to have CS have
30 functions for javascript/html/url escaping). Note that we explicitly
31 don't provide any associated data or anything to attempt to keep you
32 from using this as a generic callback... The format of a CSSTRFUNC is:
33 NEOERR * str_func(char *in, char **out); This function should not mod‐
34 ify the input string, and should allocate the output string with a libc
35 function. (as we will call free on it)
36
37
39 cs_dump(3), cs_destroy(3), cs_render(3), cs_register_esc_strfunc(3),
40 cs_arg_parsev(3), cs_register_fileload(3), cs_init(3), cs_register_str‐
41 func(3), cs_arg_parse(3), cs_parse_string(3), cs_parse_file(3), =[22m(3),
42 cs_register_function
43
44
45
46ClearSilver 12 July 2007 cs_register_strfunc(3)