Lines Matching +full:num +full:- +full:strings
1 // SPDX-License-Identifier: GPL-2.0-only
3 * lib/parser.c - simple parser for mount, etc. options.
14 * match_one: - Determines if a string matches a simple pattern
33 int len = -1; in match_one()
38 if (strncmp(p, s, meta-p)) in match_one()
41 s += meta - p; in match_one()
63 if (len == -1 || len > str_len) in match_one()
70 goto num; in match_one()
73 goto num; in match_one()
76 goto num; in match_one()
79 num: in match_one()
92 * match_token: - Find a token (and optional args) in a string
100 * Description: Detects which if any of a set of token strings has been passed
101 * to it. Tokens can include up to MAX_OPT_ARGS instances of basic c-style
109 for (p = table; !match_one(s, p->pattern, args) ; p++) in match_token()
112 return p->token; in match_token()
124 * by the string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
135 return -ENOMEM; in match_number()
140 ret = -EINVAL; in match_number()
142 ret = -ERANGE; in match_number()
157 * by the string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
167 return -ENOMEM; in match_u64int()
177 * match_int: - scan a decimal representation of an integer from a substring_t
183 * Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
192 * match_u64: - scan a decimal representation of a u64 from
200 * Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
209 * match_octal: - scan an octal representation of an integer from a substring_t
215 * 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
224 * match_hex: - scan a hex representation of an integer from a substring_t
230 * returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
239 * match_wildcard: - parse if a string matches given wildcard pattern
245 * '*' - matches zero or more characters
246 * '?' - matches one character
290 * match_strlcpy: - Copy the characters from a substring_t to a sized buffer
296 * c-style string @dest. Copy no more than @size - 1 characters, plus
301 size_t ret = src->to - src->from; in match_strlcpy()
304 size_t len = ret >= size ? size - 1 : ret; in match_strlcpy()
305 memcpy(dest, src->from, len); in match_strlcpy()
313 * match_strdup: - allocate a new string with the contents of a substring_t
322 return kmemdup_nul(s->from, s->to - s->from, GFP_KERNEL); in match_strdup()