Move curses related drawing to separate function. Similary there will be stdout drawing function.
Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/flowtop.c b/flowtop.c index cbd5a33..65a8ad4 100644 --- a/flowtop.c +++ b/flowtop.c @@ -1278,15 +1278,12 @@ static void flows_table_init(struct ui_table *tbl) ui_table_header_color_set(&flows_tbl, COLOR(BLACK, GREEN)); } -static void presenter(void) +static void presenter_curses(void) { bool show_help = false; int skip_lines = 0; WINDOW *screen; - lookup_init(LT_PORTS_TCP); - lookup_init(LT_PORTS_UDP); - screen = screen_init(false); wclear(screen); @@ -1367,10 +1364,17 @@ static void presenter(void) usleep(80000); } rcu_unregister_thread(); - ui_table_uninit(&flows_tbl); - screen_end(); +} + +static void presenter(void) +{ + lookup_init(LT_PORTS_TCP); + lookup_init(LT_PORTS_UDP); + + presenter_curses(); + lookup_cleanup(LT_PORTS_UDP); lookup_cleanup(LT_PORTS_TCP); } -- 2.6.3 -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to netsniff-ng+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.