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.
15 * match_one - Determines if a string matches a simple pattern
34 int len = -1; in match_one()
39 if (strncmp(p, s, meta-p)) in match_one()
42 s += meta - p; in match_one()
64 if (len == -1 || len > str_len) in match_one()
71 goto num; in match_one()
74 goto num; in match_one()
77 goto num; in match_one()
80 num: in match_one()
93 * match_token - Find a token (and optional args) in a string
101 * Description: Detects which if any of a set of token strings has been passed
102 * to it. Tokens can include up to %MAX_OPT_ARGS instances of basic c-style
110 for (p = table; !match_one(s, p->pattern, args) ; p++) in match_token()
113 return p->token; in match_token()
118 * match_number - scan a number in the given base from a substring_t
127 * string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
138 return -ENOMEM; in match_number()
143 ret = -EINVAL; in match_number()
145 ret = -ERANGE; in match_number()
153 * match_u64int - scan a number in the given base from a substring_t
162 * string and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
172 return -ENOMEM; in match_u64int()
182 * match_int - scan a decimal representation of an integer from a substring_t
189 * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
198 * match_uint - scan a decimal representation of an integer from a substring_t
205 * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
209 int err = -ENOMEM; in match_uint()
221 * match_u64 - scan a decimal representation of a u64 from
230 * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
239 * match_octal - scan an octal representation of an integer from a substring_t
246 * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
255 * match_hex - scan a hex representation of an integer from a substring_t
262 * and returns 0. Returns -ENOMEM, -EINVAL, or -ERANGE on failure.
271 * match_wildcard - parse if a string matches given wildcard pattern
277 * '*' - matches zero or more characters
278 * '?' - matches one character
323 * match_strlcpy - Copy the characters from a substring_t to a sized buffer
329 * c-style string @dest. Copy no more than @size - 1 characters, plus
336 size_t ret = src->to - src->from; in match_strlcpy()
339 size_t len = ret >= size ? size - 1 : ret; in match_strlcpy()
340 memcpy(dest, src->from, len); in match_strlcpy()
348 * match_strdup - allocate a new string with the contents of a substring_t
355 * Return: the address of the newly allocated NUL-terminated string or
360 return kmemdup_nul(s->from, s->to - s->from, GFP_KERNEL); in match_strdup()