[PATCH 2/5] perf ui/tui: Add tui.h header

From: Namhyung Kim
Date: Wed Aug 15 2012 - 10:58:42 EST


Consolidate TUI-relate header files and declarations into tui.h.

Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/Makefile | 1 +
tools/perf/ui/helpline.h | 2 --
tools/perf/ui/tui/helpline.c | 5 +----
tools/perf/ui/tui/setup.c | 12 +-----------
tools/perf/ui/tui/tui.h | 21 +++++++++++++++++++++
tools/perf/ui/tui/util.c | 10 +---------
6 files changed, 25 insertions(+), 26 deletions(-)
create mode 100644 tools/perf/ui/tui/tui.h

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 483fb69fa4ae..14c0b744d98e 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -581,6 +581,7 @@ else
LIB_H += ui/progress.h
LIB_H += ui/util.h
LIB_H += ui/ui.h
+ LIB_H += ui/tui/tui.h
endif
endif

diff --git a/tools/perf/ui/helpline.h b/tools/perf/ui/helpline.h
index eee8e2ff51d8..7e2d4fb10ebd 100644
--- a/tools/perf/ui/helpline.h
+++ b/tools/perf/ui/helpline.h
@@ -11,8 +11,6 @@ struct perf_helpline {

extern struct perf_helpline *helpline_fns;

-void ui_helpline__init(void);
-
void ui_helpline__pop(void);
void ui_helpline__push(const char *msg);
void ui_helpline__vpush(const char *fmt, va_list ap);
diff --git a/tools/perf/ui/tui/helpline.c b/tools/perf/ui/tui/helpline.c
index b63a9326d06b..a8e67e4a84ea 100644
--- a/tools/perf/ui/tui/helpline.c
+++ b/tools/perf/ui/tui/helpline.c
@@ -3,10 +3,7 @@
#include <string.h>
#include <pthread.h>

-#include "../../util/debug.h"
-#include "../helpline.h"
-#include "../ui.h"
-#include "../libslang.h"
+#include "tui.h"


static void tui_helpline__pop(void)
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c
index e813c1d17346..e247bf51d247 100644
--- a/tools/perf/ui/tui/setup.c
+++ b/tools/perf/ui/tui/setup.c
@@ -1,22 +1,12 @@
-#include <newt.h>
#include <signal.h>
#include <stdbool.h>

-#include "../../util/cache.h"
-#include "../../util/debug.h"
-#include "../browser.h"
-#include "../helpline.h"
-#include "../ui.h"
-#include "../util.h"
-#include "../libslang.h"
-#include "../keysyms.h"
+#include "tui.h"

pthread_mutex_t ui__lock = PTHREAD_MUTEX_INITIALIZER;

static volatile int ui__need_resize;

-extern struct perf_error_ops perf_tui_eops;
-
void ui__refresh_dimensions(bool force)
{
if (force || ui__need_resize) {
diff --git a/tools/perf/ui/tui/tui.h b/tools/perf/ui/tui/tui.h
new file mode 100644
index 000000000000..17da45ed8ca4
--- /dev/null
+++ b/tools/perf/ui/tui/tui.h
@@ -0,0 +1,21 @@
+#ifndef _PERF_TUI_H_
+#define _PERF_TUI_H_
+
+#include <newt.h>
+
+#include "../../util/debug.h"
+#include "../../util/cache.h"
+#include "../ui.h"
+#include "../util.h"
+#include "../browser.h"
+#include "../helpline.h"
+#include "../libslang.h"
+#include "../keysyms.h"
+
+extern struct perf_error_ops perf_tui_eops;
+
+extern struct perf_helpline tui_helpline_fns;
+
+void ui_helpline__init(void);
+
+#endif /* _PERF_TUI_H */
diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c
index 092902e30cee..b555ae839b2a 100644
--- a/tools/perf/ui/tui/util.c
+++ b/tools/perf/ui/tui/util.c
@@ -1,17 +1,9 @@
-#include "../../util/util.h"
#include <signal.h>
#include <stdbool.h>
#include <string.h>
#include <sys/ttydefaults.h>

-#include "../../util/cache.h"
-#include "../../util/debug.h"
-#include "../browser.h"
-#include "../keysyms.h"
-#include "../helpline.h"
-#include "../ui.h"
-#include "../util.h"
-#include "../libslang.h"
+#include "tui.h"

static void ui_browser__argv_write(struct ui_browser *browser,
void *entry, int row)
--
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/