string2.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef PERF_STRING_H
  3. #define PERF_STRING_H
  4. #include <linux/string.h>
  5. #include <linux/types.h>
  6. #include <stddef.h>
  7. #include <string.h>
  8. extern const char *graph_dotted_line;
  9. extern const char *dots;
  10. s64 perf_atoll(const char *str);
  11. bool strglobmatch(const char *str, const char *pat);
  12. bool strglobmatch_nocase(const char *str, const char *pat);
  13. bool strlazymatch(const char *str, const char *pat);
  14. static inline bool strisglob(const char *str)
  15. {
  16. return strpbrk(str, "*?[") != NULL;
  17. }
  18. int strtailcmp(const char *s1, const char *s2);
  19. char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints);
  20. static inline char *asprintf_expr_in_ints(const char *var, size_t nints, int *ints)
  21. {
  22. return asprintf_expr_inout_ints(var, true, nints, ints);
  23. }
  24. static inline char *asprintf_expr_not_in_ints(const char *var, size_t nints, int *ints)
  25. {
  26. return asprintf_expr_inout_ints(var, false, nints, ints);
  27. }
  28. char *strpbrk_esc(char *str, const char *stopset);
  29. char *strdup_esc(const char *str);
  30. #endif /* PERF_STRING_H */