summaryrefslogtreecommitdiff
path: root/flowtop.c
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-08-23 00:06:01 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-09-15 18:28:28 +0200
commitca4cd5bec239b88b72fccb2f4849e634a504b260 (patch)
tree576c3f58b06807eb24fed7caf441b2801c5452a0 /flowtop.c
parent5ca82e492cd88813f22d40dc2fecaaa2b3dcd51d (diff)
flowtop: Render table row via raw ncurses buffer
Render each column to the ncurses raw buffer first, this buffer contains ncurses {char:attr} elements which will be printed to the screen after ui_table_row_show() will be called (at the end of columns rendering by flowtop). The reason of this change is to have easy way to make horizontal scrolling over this buffer. Approach is used from the 'htop' tool. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'flowtop.c')
-rw-r--r--flowtop.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/flowtop.c b/flowtop.c
index 405bfd8..d98a7b6 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -1017,10 +1017,19 @@ static void draw_flow_entry(const struct flow_entry *n)
print_flow_peer_info(n, show_src ? FLOW_DIR_SRC : FLOW_DIR_DST);
+ ui_table_row_show(&flows_tbl);
+
if (show_src) {
ui_table_row_add(&flows_tbl);
+ ui_table_row_print(&flows_tbl, TBL_FLOW_PROCESS, "");
+ ui_table_row_print(&flows_tbl, TBL_FLOW_PID, "");
+ ui_table_row_print(&flows_tbl, TBL_FLOW_PROTO, "");
+ ui_table_row_print(&flows_tbl, TBL_FLOW_STATE, "");
+ ui_table_row_print(&flows_tbl, TBL_FLOW_TIME, "");
+
print_flow_peer_info(n, FLOW_DIR_DST);
+ ui_table_row_show(&flows_tbl);
}
}