From a73c7d84a1975b44c0ebd03c2dec288af1426349 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Thu, 18 Jun 2009 09:44:20 +0200 Subject: perf_counter tools: Add and use isprint() Introduce isprint() to print out raw event dumps to ASCII, etc. (This is an extension to upstream Git's ctype.c.) Signed-off-by: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo LKML-Reference: [ removed openssl.h inclusion from util.h - it leaked ctype.h ] Signed-off-by: Ingo Molnar --- tools/perf/util/util.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'tools/perf/util/util.h') diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index ce9b514f60a..b8cfed776d8 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -100,11 +100,6 @@ #include #endif -#ifndef NO_OPENSSL -#include -#include -#endif - /* On most systems would have given us this, but * not on some systems (e.g. GNU/Hurd). */ @@ -332,18 +327,20 @@ static inline int has_extension(const char *filename, const char *ext) #undef tolower #undef toupper extern unsigned char sane_ctype[256]; -#define GIT_SPACE 0x01 -#define GIT_DIGIT 0x02 -#define GIT_ALPHA 0x04 -#define GIT_GLOB_SPECIAL 0x08 -#define GIT_REGEX_SPECIAL 0x10 +#define GIT_SPACE 0x01 +#define GIT_DIGIT 0x02 +#define GIT_ALPHA 0x04 +#define GIT_GLOB_SPECIAL 0x08 +#define GIT_REGEX_SPECIAL 0x10 +#define GIT_PRINT_EXTRA 0x20 +#define GIT_PRINT 0x3E #define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0) #define isascii(x) (((x) & ~0x7f) == 0) #define isspace(x) sane_istest(x,GIT_SPACE) #define isdigit(x) sane_istest(x,GIT_DIGIT) #define isalpha(x) sane_istest(x,GIT_ALPHA) #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) -#define issane(x) sane_istest(x,GIT_SPACE | GIT_DIGIT | GIT_ALPHA | GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL) +#define isprint(x) sane_istest(x,GIT_PRINT) #define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL) #define is_regex_special(x) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL) #define tolower(x) sane_case((unsigned char)(x), 0x20) -- cgit v1.2.2