perf annotate: Add TUI interface
[pandora-kernel.git] / tools / perf / util / util.h
index 45b9655..4e8b6b0 100644 (file)
@@ -81,7 +81,7 @@
 #include <inttypes.h>
 #include "../../../include/linux/magic.h"
 #include "types.h"
-
+#include <sys/ttydefaults.h>
 
 #ifndef NO_ICONV
 #include <iconv.h>
@@ -263,6 +263,19 @@ bool strglobmatch(const char *str, const char *pat);
 bool strlazymatch(const char *str, const char *pat);
 unsigned long convert_unit(unsigned long value, char *unit);
 
+#ifndef ESC
+#define ESC 27
+#endif
+
+static inline bool is_exit_key(int key)
+{
+       char up;
+       if (key == CTRL('c') || key == ESC)
+               return true;
+       up = toupper(key);
+       return up == 'Q';
+}
+
 #define _STR(x) #x
 #define STR(x) _STR(x)