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.
16 * HEX: "0xFFFFFFFFFFFFFFFF" --> 18
17 * DEC: "18446744073709551615" --> 20
18 * OCT: "01777777777777777777777" --> 23
24 * match_one - Determines if a string matches a simple pattern
43 int len = -1;
48 if (strncmp(p, s, meta-p))
51 s += meta - p;
73 if (len == -1 || len > str_len)
80 goto num;
83 goto num;
86 goto num;
89 num:
102 * match_token - Find a token (and optional args) in a string
110 * Description: Detects which if any of a set of token strings has been passed
111 * to it. Tokens can include up to %MAX_OPT_ARGS instances of basic c-style
119 for (p = table; !match_one(s, p->pattern, args) ; p++)
122 return p->token;
127 * match_number - scan a number in the given base from a substring_t
136 * string and returns 0. Returns -EINVAL or -ERANGE on failure.
146 return -ERANGE;
150 ret = -EINVAL;
152 ret = -ERANGE;
159 * match_u64int - scan a number in the given base from a substring_t
168 * string and returns 0. Returns -EINVAL or -ERANGE on failure.
177 return -ERANGE;
185 * match_int - scan a decimal representation of an integer from a substring_t
192 * and returns 0. Returns -EINVAL or -ERANGE on failure.
201 * match_uint - scan a decimal representation of an integer from a substring_t
208 * and returns 0. Returns -EINVAL or -ERANGE on failure.
215 return -ERANGE;
222 * match_u64 - scan a decimal representation of a u64 from
231 * and returns 0. Returns -EINVAL or -ERANGE on failure.
240 * match_octal - scan an octal representation of an integer from a substring_t
247 * and returns 0. Returns -EINVAL or -ERANGE on failure.
256 * match_hex - scan a hex representation of an integer from a substring_t
263 * and returns 0. Returns -EINVAL or -ERANGE on failure.
272 * match_wildcard - parse if a string matches given wildcard pattern
279 * * '*' - matches zero or more characters
280 * * '?' - matches one character
325 * match_strlcpy - Copy the characters from a substring_t to a sized buffer
331 * c-style string @dest. Copy no more than @size - 1 characters, plus
338 size_t ret = src->to - src->from;
341 size_t len = ret >= size ? size - 1 : ret;
342 memcpy(dest, src->from, len);
350 * match_strdup - allocate a new string with the contents of a substring_t
357 * Return: the address of the newly allocated NUL-terminated string or
362 return kmemdup_nul(s->from, s->to - s->from, GFP_KERNEL);