Lines Matching defs:str
10 s64 perf_atoll(const char *str)
15 if (!isdigit(str[0]))
18 for (i = 1; i < strlen(str); i++) {
19 switch (str[i]) {
24 if (str[i + 1] != 'B')
29 if (str[i + 1] != 'b')
35 if (str[i + 1] != 'B')
40 if (str[i + 1] != 'b')
46 if (str[i + 1] != 'B')
51 if (str[i + 1] != 'b')
57 if (str[i + 1] != 'B')
62 if (str[i + 1] != 'b')
71 if (!isdigit(str[i]))
77 length = atoll(str) * unit;
106 static int count_argc(const char *str)
110 while (*str) {
111 str = skip_sep(str);
112 if (*str) {
114 str = skip_arg(str);
138 * @str: the string to be split
142 * @str. This is performed by strictly splitting on white-space; no
148 char **argv_split(const char *str, int *argcp)
150 int argc = count_argc(str);
162 while (*str) {
163 str = skip_sep(str);
165 if (*str) {
166 const char *p = str;
169 str = skip_arg(str);
171 t = strndup(p, str-p);
226 static bool __match_glob(const char *str, const char *pat, bool ignore_space)
228 while (*str && *pat && *pat != '*') {
231 if (isspace(*str)) {
232 str++;
241 str++;
245 if (__match_charclass(pat + 1, *str, &pat)) {
246 str++;
252 if (*str++ != *pat++)
261 while (*str)
262 if (strglobmatch(str++, pat))
265 return !*str && !*pat;
270 * @str: the target string to match
273 * This returns true if the @str matches @pat. @pat can includes wildcards
280 bool strglobmatch(const char *str, const char *pat)
282 return __match_glob(str, pat, false);
287 * @str: the target string to match
293 bool strlazymatch(const char *str, const char *pat)
295 return __match_glob(str, pat, true);