Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef PERF_STRING_H |
| 3 | #define PERF_STRING_H |
| 4 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 5 | #include <linux/string.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | #include <linux/types.h> |
| 7 | #include <stddef.h> |
| 8 | #include <string.h> |
| 9 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 10 | extern const char *graph_dotted_line; |
| 11 | extern const char *dots; |
| 12 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 13 | s64 perf_atoll(const char *str); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 14 | bool strglobmatch(const char *str, const char *pat); |
| 15 | bool strglobmatch_nocase(const char *str, const char *pat); |
| 16 | bool strlazymatch(const char *str, const char *pat); |
| 17 | static inline bool strisglob(const char *str) |
| 18 | { |
| 19 | return strpbrk(str, "*?[") != NULL; |
| 20 | } |
| 21 | int strtailcmp(const char *s1, const char *s2); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | |
| 23 | char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints); |
| 24 | |
| 25 | static inline char *asprintf_expr_in_ints(const char *var, size_t nints, int *ints) |
| 26 | { |
| 27 | return asprintf_expr_inout_ints(var, true, nints, ints); |
| 28 | } |
| 29 | |
| 30 | static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int *ints) |
| 31 | { |
| 32 | return asprintf_expr_inout_ints(var, false, nints, ints); |
| 33 | } |
| 34 | |
| 35 | char *strpbrk_esc(char *str, const char *stopset); |
| 36 | char *strdup_esc(const char *str); |
| 37 | |
| 38 | #endif /* PERF_STRING_H */ |