Merge src/tui/txbox.c into src/tui/winops.c and delete src/tui/txbox.c.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
Makefile | 1 -
src/tui/txbox.c | 39 ---------------------------------------
src/tui/winops.c | 33 +++++++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 40 deletions(-)
delete mode 100644 src/tui/txbox.c
diff --git a/Makefile b/Makefile
index dbf1990..1fe073f 100644
--- a/Makefile
+++ b/Makefile
@@ -114,7 +114,6 @@ iptraf-o += src/tui/labels.o
iptraf-o += src/tui/listbox.o
iptraf-o += src/tui/menurt.o
iptraf-o += src/tui/msgboxes.o
-iptraf-o += src/tui/txbox.o
iptraf-o += src/tui/winops.o
iptraf-o += src/error.o
iptraf-o += src/log.o
diff --git a/src/tui/txbox.c b/src/tui/txbox.c
deleted file mode 100644
index c71e081..0000000
--- a/src/tui/txbox.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* For terms of usage/redistribution/modification see the LICENSE file */
-
-/*
- * txbox.c - custom window bordering routine for ncurses windows.
- *
- * This function is written to address a strange symptom in ncurses 5.2, at
- * least on RedHat 7.3. The border drawn by the box() macro (actually an alias
- * for a call to wborder()) no longer uses the color attributes set by
- * wattrset(). However, the addch() and wvline() functions still do.
- *
- * The tx_box function is a drop-in replacement for box().
- */
-
-#include "iptraf-ng-compat.h"
-
-void tx_box(WINDOW * win, int vline, int hline)
-{
- int winwidth;
- int winheight;
- int i;
-
- scrollok(win, 0);
- getmaxyx(win, winheight, winwidth);
- winheight--;
- winwidth--;
-
- mvwaddch(win, 0, 0, ACS_ULCORNER);
- mvwhline(win, 0, 1, hline, winwidth - 1);
- mvwaddch(win, 0, winwidth, ACS_URCORNER);
-
- for (i = 1; i < winheight; i++) {
- mvwaddch(win, i, 0, vline);
- mvwaddch(win, i, winwidth, vline);
- }
-
- mvwaddch(win, winheight, 0, ACS_LLCORNER);
- mvwhline(win, winheight, 1, hline, winwidth - 1);
- mvwaddch(win, winheight, winwidth, ACS_LRCORNER);
-}
diff --git a/src/tui/winops.c b/src/tui/winops.c
index f130ab1..363611a 100644
--- a/src/tui/winops.c
+++ b/src/tui/winops.c
@@ -57,3 +57,36 @@ void tx_wcoloreol(WINDOW * win)
scrollok(win, 0);
wprintw(win, sp_buf, ' ');
}
+
+/*
+ * This function is written to address a strange symptom in ncurses 5.2, at
+ * least on RedHat 7.3. The border drawn by the box() macro (actually an alias
+ * for a call to wborder()) no longer uses the color attributes set by
+ * wattrset(). However, the addch() and wvline() functions still do.
+ *
+ * The tx_box function is a drop-in replacement for box().
+ */
+void tx_box(WINDOW *win, int vline, int hline)
+{
+ int winwidth;
+ int winheight;
+ int i;
+
+ scrollok(win, 0);
+ getmaxyx(win, winheight, winwidth);
+ winheight--;
+ winwidth--;
+
+ mvwaddch(win, 0, 0, ACS_ULCORNER);
+ mvwhline(win, 0, 1, hline, winwidth - 1);
+ mvwaddch(win, 0, winwidth, ACS_URCORNER);
+
+ for (i = 1; i < winheight; i++) {
+ mvwaddch(win, i, 0, vline);
+ mvwaddch(win, i, winwidth, vline);
+ }
+
+ mvwaddch(win, winheight, 0, ACS_LLCORNER);
+ mvwhline(win, winheight, 1, hline, winwidth - 1);
+ mvwaddch(win, winheight, winwidth, ACS_LRCORNER);
+}
--
1.7.8.4