mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00

Those are not in that file in the git repo, lets move it from there so that we get that sane ctype code fully isolated to allow getting it in sync either with the git sources or better with the kernel sources (include/linux/ctype.h + lib/ctype.h), that way we can use check_headers.h to get notified when changes are made in the original code so that we can cherry-pick. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-ioh5sghn3943j0rxg6lb2dgs@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
48 lines
1.2 KiB
C
48 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef PERF_STRING_H
|
|
#define PERF_STRING_H
|
|
|
|
#include <linux/types.h>
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
|
|
extern const char *graph_dotted_line;
|
|
extern const char *dots;
|
|
|
|
s64 perf_atoll(const char *str);
|
|
char **argv_split(const char *str, int *argcp);
|
|
void argv_free(char **argv);
|
|
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 *strxfrchar(char *s, char from, char to);
|
|
|
|
char *ltrim(char *s);
|
|
char *rtrim(char *s);
|
|
|
|
static inline char *trim(char *s)
|
|
{
|
|
return ltrim(rtrim(s));
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
char *strpbrk_esc(char *str, const char *stopset);
|
|
char *strdup_esc(const char *str);
|
|
|
|
#endif /* PERF_STRING_H */
|