2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-04-17 16:51:59 -03:00
|
|
|
#ifndef PERF_STRING_H
|
|
|
|
|
#define PERF_STRING_H
|
|
|
|
|
|
2019-06-26 11:42:03 -03:00
|
|
|
#include <linux/string.h>
|
2017-04-17 16:51:59 -03:00
|
|
|
#include <linux/types.h>
|
2019-10-14 20:10:50 -03:00
|
|
|
#include <sys/types.h> // pid_t
|
2017-04-17 16:51:59 -03:00
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2019-06-25 17:31:26 -03:00
|
|
|
extern const char *graph_dotted_line;
|
|
|
|
|
extern const char *dots;
|
|
|
|
|
|
2017-04-17 16:51:59 -03:00
|
|
|
s64 perf_atoll(const char *str);
|
|
|
|
|
bool strglobmatch(const char *str, const char *pat);
|
|
|
|
|
bool strglobmatch_nocase(const char *str, const char *pat);
|
|
|
|
|
bool strlazymatch(const char *str, const char *pat);
|
|
|
|
|
static inline bool strisglob(const char *str)
|
|
|
|
|
{
|
|
|
|
|
return strpbrk(str, "*?[") != NULL;
|
|
|
|
|
}
|
|
|
|
|
int strtailcmp(const char *s1, const char *s2);
|
|
|
|
|
|
|
|
|
|
char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints);
|
|
|
|
|
|
|
|
|
|
static inline char *asprintf_expr_in_ints(const char *var, size_t nints, int *ints)
|
|
|
|
|
{
|
|
|
|
|
return asprintf_expr_inout_ints(var, true, nints, ints);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int *ints)
|
|
|
|
|
{
|
|
|
|
|
return asprintf_expr_inout_ints(var, false, nints, ints);
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-14 20:10:50 -03:00
|
|
|
char *asprintf__tp_filter_pids(size_t npids, pid_t *pids);
|
|
|
|
|
|
2017-12-09 01:28:41 +09:00
|
|
|
char *strpbrk_esc(char *str, const char *stopset);
|
|
|
|
|
char *strdup_esc(const char *str);
|
2017-04-17 16:51:59 -03:00
|
|
|
|
2021-02-03 16:15:37 -05:00
|
|
|
unsigned int hex(char c);
|
|
|
|
|
|
2017-04-17 16:51:59 -03:00
|
|
|
#endif /* PERF_STRING_H */
|