blob: 73df616ced4302cdd279d5d96b84aa90646b5d02 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -03002#ifndef PERF_STRING_H
3#define PERF_STRING_H
4
Arnaldo Carvalho de Melo32858482019-06-26 11:42:03 -03005#include <linux/string.h>
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -03006#include <linux/types.h>
Arnaldo Carvalho de Meloda949f52019-10-14 20:10:50 -03007#include <sys/types.h> // pid_t
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -03008#include <stddef.h>
9#include <string.h>
10
Arnaldo Carvalho de Melo6a9fa4e2019-06-25 17:31:26 -030011extern const char *graph_dotted_line;
12extern const char *dots;
13
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -030014s64 perf_atoll(const char *str);
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -030015bool strglobmatch(const char *str, const char *pat);
16bool strglobmatch_nocase(const char *str, const char *pat);
17bool strlazymatch(const char *str, const char *pat);
18static inline bool strisglob(const char *str)
19{
20 return strpbrk(str, "*?[") != NULL;
21}
22int strtailcmp(const char *s1, const char *s2);
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -030023
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -030024char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints);
25
26static inline char *asprintf_expr_in_ints(const char *var, size_t nints, int *ints)
27{
28 return asprintf_expr_inout_ints(var, true, nints, ints);
29}
30
31static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int *ints)
32{
33 return asprintf_expr_inout_ints(var, false, nints, ints);
34}
35
Arnaldo Carvalho de Meloda949f52019-10-14 20:10:50 -030036char *asprintf__tp_filter_pids(size_t npids, pid_t *pids);
37
Masami Hiramatsu1e9f9e82017-12-09 01:28:41 +090038char *strpbrk_esc(char *str, const char *stopset);
39char *strdup_esc(const char *str);
Arnaldo Carvalho de Meloa0675582017-04-17 16:51:59 -030040
41#endif /* PERF_STRING_H */