diff options
Diffstat (limited to 'tools/perf/util/util.h')
-rw-r--r-- | tools/perf/util/util.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 45b9655f3a5c..4e8b6b0c551c 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
@@ -81,7 +81,7 @@ | |||
81 | #include <inttypes.h> | 81 | #include <inttypes.h> |
82 | #include "../../../include/linux/magic.h" | 82 | #include "../../../include/linux/magic.h" |
83 | #include "types.h" | 83 | #include "types.h" |
84 | 84 | #include <sys/ttydefaults.h> | |
85 | 85 | ||
86 | #ifndef NO_ICONV | 86 | #ifndef NO_ICONV |
87 | #include <iconv.h> | 87 | #include <iconv.h> |
@@ -263,6 +263,19 @@ bool strglobmatch(const char *str, const char *pat); | |||
263 | bool strlazymatch(const char *str, const char *pat); | 263 | bool strlazymatch(const char *str, const char *pat); |
264 | unsigned long convert_unit(unsigned long value, char *unit); | 264 | unsigned long convert_unit(unsigned long value, char *unit); |
265 | 265 | ||
266 | #ifndef ESC | ||
267 | #define ESC 27 | ||
268 | #endif | ||
269 | |||
270 | static inline bool is_exit_key(int key) | ||
271 | { | ||
272 | char up; | ||
273 | if (key == CTRL('c') || key == ESC) | ||
274 | return true; | ||
275 | up = toupper(key); | ||
276 | return up == 'Q'; | ||
277 | } | ||
278 | |||
266 | #define _STR(x) #x | 279 | #define _STR(x) #x |
267 | #define STR(x) _STR(x) | 280 | #define STR(x) _STR(x) |
268 | 281 | ||