Linux 5.1.15
[linux/fpc-iii.git] / tools / perf / util / string2.h
blob4c68a09b97e8f2ea41e4fcbc7e22b8fe0c79631a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef PERF_STRING_H
3 #define PERF_STRING_H
5 #include <linux/types.h>
6 #include <stddef.h>
7 #include <string.h>
9 s64 perf_atoll(const char *str);
10 char **argv_split(const char *str, int *argcp);
11 void argv_free(char **argv);
12 bool strglobmatch(const char *str, const char *pat);
13 bool strglobmatch_nocase(const char *str, const char *pat);
14 bool strlazymatch(const char *str, const char *pat);
15 static inline bool strisglob(const char *str)
17 return strpbrk(str, "*?[") != NULL;
19 int strtailcmp(const char *s1, const char *s2);
20 char *strxfrchar(char *s, char from, char to);
22 char *ltrim(char *s);
23 char *rtrim(char *s);
25 static inline char *trim(char *s)
27 return ltrim(rtrim(s));
30 char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints);
32 static inline char *asprintf_expr_in_ints(const char *var, size_t nints, int *ints)
34 return asprintf_expr_inout_ints(var, true, nints, ints);
37 static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int *ints)
39 return asprintf_expr_inout_ints(var, false, nints, ints);
42 char *strpbrk_esc(char *str, const char *stopset);
43 char *strdup_esc(const char *str);
45 #endif /* PERF_STRING_H */