|
int | find_type_or_exit (const char *x, TYPELIB *typelib, const char *option) |
|
int | find_type (const char *x, const TYPELIB *typelib, uint flags) |
| Search after a string in a list of strings. More...
|
|
const char * | get_type (TYPELIB *typelib, uint nr) |
| Get type. More...
|
|
uint64_t | find_typeset (const char *x, TYPELIB *lib, int *err) |
| Create an integer value to represent the supplied comma-separated string where each string in the TYPELIB denotes a bit position. More...
|
|
TYPELIB * | copy_typelib (MEM_ROOT *root, TYPELIB *from) |
| Create a copy of a specified TYPELIB structure. More...
|
|
static int | parse_name (const TYPELIB *lib, const char **strpos, const char *end) |
| Parse a TYPELIB name from the buffer. More...
|
|
uint64_t | find_set_from_flags (const TYPELIB *lib, int default_name, uint64_t cur_set, uint64_t default_set, const char *str, uint length, const char **err_pos, uint *err_len) |
| Parse and apply a set of flag assingments. More...
|
|
Functions to handle typelib.
uint64_t find_set_from_flags |
( |
const TYPELIB * |
lib, |
|
|
int |
default_name, |
|
|
uint64_t |
cur_set, |
|
|
uint64_t |
default_set, |
|
|
const char * |
str, |
|
|
uint |
length, |
|
|
const char ** |
err_pos, |
|
|
uint * |
err_len |
|
) |
| |
Parse and apply a set of flag assingments.
- Parameters
-
lib | Flag names |
default_name | Number of "default" in the typelib |
cur_set | Current set of flags (start from this state) |
default_set | Default set of flags (use this for assign-default keyword and flag=default assignments) |
str | String to be parsed |
length | Length of the string |
err_pos | OUT If error, set to point to start of wrong set string NULL on success |
err_len | OUT If error, set to the length of wrong set string |
Parse a set of flag assignments, that is, parse a string in form:
param_name1=value1,param_name2=value2,...
where the names are specified in the TYPELIB, and each value can be either 'on','off', or 'default'. Setting the same name twice is not allowed.
Besides param=val assignments, we support the "default" keyword (keyword default_name in the typelib). It can be used one time, if specified it causes us to build the new set over the default_set rather than cur_set value.
- Note
- it's not charset aware
- Return values
-
Parsed | set value if (*errpos == NULL), otherwise undefined |