/* * linux/include/linux/parser.h * * Header for lib/parser.c * Intended use of these functions is parsing filesystem argument lists, * but could potentially be used anywhere else that simple option=arg * parsing is required. *//* associates an integer enumerator with a pattern string. */structmatch_token{inttoken;constchar*pattern;};typedefstructmatch_tokenmatch_table_t[];/* Maximum number of arguments that match_token will find in a pattern */enum{MAX_OPT_ARGS=3};/* Describe the location within a string of a substring */typedefstruct{char*from;char*to;}substring_t;intmatch_token(char*,constmatch_table_ttable,substring_targs[]);intmatch_int(substring_t*,int*result);intmatch_octal(substring_t*,int*result);intmatch_hex(substring_t*,int*result);boolmatch_wildcard(constchar*pattern,constchar*str);size_tmatch_strlcpy(char*,constsubstring_t*,size_t);char*match_strdup(constsubstring_t*);