|
Tou
Tou header library
|
Functions | |
| tou_llist_t * | tou_paramparse (char *str, const char *param_sep, const char *keyval_sep) |
| Parses "parameter string" and returns a llist of key-value pairs, looking at the whole string (strlen will be used) | |
| tou_llist_t * | tou_paramparse_n (char *str, const char *param_sep, const char *keyval_sep, size_t maxlen) |
| Parses "parameter string" and returns a llist of key-value pairs. | |
| void | tou_paramprint (tou_llist_t *params) |
| Attempts to print "params" parsed by tou_paramparse or tou_paramparse_n. | |
| tou_llist_t * tou_paramparse | ( | char * | str, |
| const char * | param_sep, | ||
| const char * | keyval_sep ) |
Parses "parameter string" and returns a llist of key-value pairs, looking at the whole string (strlen will be used)
Extra whitespaces are ignored and pairs may be key-only (values may be empty).
Example: 5 adjust abc= def 123=456 Is returned as llist where elements are: {{"5", NULL}, {"adjust", NULL}, {"abc", "def"}, {"123", "456"}}
| [in] | str | Pointer to parse |
| [in] | param_sep | String used to split pairs |
| [in] | keyval_sep | String used to split key-value pairs |
| tou_llist_t * tou_paramparse_n | ( | char * | str, |
| const char * | param_sep, | ||
| const char * | keyval_sep, | ||
| size_t | maxlen ) |
Parses "parameter string" and returns a llist of key-value pairs.
Extra whitespaces are ignored and pairs may be key-only (values may be empty).
Example: 5 adjust abc= def 123=456 Is returned as llist where elements are: {{"5", NULL}, {"adjust", NULL}, {"abc", "def"}, {"123", "456"}}
| [in] | str | Pointer to parse |
| [in] | param_sep | String used to split pairs |
| [in] | keyval_sep | String used to split key-value pairs |
| [in] | maxlen | Looks only at the first maxlen characters in str |
| void tou_paramprint | ( | tou_llist_t * | params | ) |
Attempts to print "params" parsed by tou_paramparse or tou_paramparse_n.
| [in] | params | List containing params |