45 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef PERF_STRING_H3#define PERF_STRING_H4 5#include <linux/string.h>6#include <linux/types.h>7#include <sys/types.h> // pid_t8#include <stddef.h>9#include <string.h>10 11extern const char *graph_dotted_line;12extern const char *dots;13 14s64 perf_atoll(const char *str);15bool 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);23 24char *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 36char *asprintf__tp_filter_pids(size_t npids, pid_t *pids);37 38char *strpbrk_esc(char *str, const char *stopset);39char *strdup_esc(const char *str);40 41unsigned int hex(char c);42char *strreplace_chars(char needle, const char *haystack, const char *replace);43 44#endif /* PERF_STRING_H */45