Really ui_table_row_print(x) no more prints anything, it just sets column value in a row.
Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- flowtop.c | 44 ++++++++++++++++++++++---------------------- ui.c | 2 +- ui.h | 4 ++-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/flowtop.c b/flowtop.c index 1052e08..0a15b6a 100644 --- a/flowtop.c +++ b/flowtop.c @@ -970,26 +970,26 @@ static void print_flow_peer_info(const struct flow_entry *n, enum flow_direction ui_table_col_color_set(&flows_tbl, TBL_FLOW_RATE, counters_color); /* Reverse DNS/IP */ - ui_table_row_print(&flows_tbl, TBL_FLOW_ADDRESS, - SELFLD(dir, rev_dns_src, rev_dns_dst)); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_ADDRESS, + SELFLD(dir, rev_dns_src, rev_dns_dst)); /* Application port */ - ui_table_row_print(&flows_tbl, TBL_FLOW_PORT, - flow_port2str(n, tmp, sizeof(tmp), dir)); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PORT, + flow_port2str(n, tmp, sizeof(tmp), dir)); /* GEO */ - ui_table_row_print(&flows_tbl, TBL_FLOW_GEO, - SELFLD(dir, country_code_src, country_code_dst)); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_GEO, + SELFLD(dir, country_code_src, country_code_dst)); /* Bytes */ - ui_table_row_print(&flows_tbl, TBL_FLOW_BYTES, - bandw2str(SELFLD(dir, bytes_src, bytes_dst), - tmp, sizeof(tmp) - 1)); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_BYTES, + bandw2str(SELFLD(dir, bytes_src, bytes_dst), + tmp, sizeof(tmp) - 1)); /* Rate bytes */ - ui_table_row_print(&flows_tbl, TBL_FLOW_RATE, - rate2str(SELFLD(dir, rate_bytes_src, rate_bytes_dst), - tmp, sizeof(tmp) - 1)); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_RATE, + rate2str(SELFLD(dir, rate_bytes_src, rate_bytes_dst), + tmp, sizeof(tmp) - 1)); } static void draw_flow_entry(const struct flow_entry *n) @@ -999,21 +999,21 @@ static void draw_flow_entry(const struct flow_entry *n) ui_table_row_add(&flows_tbl); /* Application */ - ui_table_row_print(&flows_tbl, TBL_FLOW_PROCESS, n->procname); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PROCESS, n->procname); /* PID */ slprintf(tmp, sizeof(tmp), "%.d", n->procnum); - ui_table_row_print(&flows_tbl, TBL_FLOW_PID, tmp); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PID, tmp); /* L4 protocol */ - ui_table_row_print(&flows_tbl, TBL_FLOW_PROTO, l4proto2str[n->l4_proto]); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PROTO, l4proto2str[n->l4_proto]); /* L4 protocol state */ - ui_table_row_print(&flows_tbl, TBL_FLOW_STATE, flow_state2str(n)); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_STATE, flow_state2str(n)); /* Time */ time2str(n->timestamp_start, tmp, sizeof(tmp)); - ui_table_row_print(&flows_tbl, TBL_FLOW_TIME, tmp); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_TIME, tmp); print_flow_peer_info(n, show_src ? FLOW_DIR_SRC : FLOW_DIR_DST); @@ -1022,11 +1022,11 @@ static void draw_flow_entry(const struct flow_entry *n) 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, ""); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PROCESS, ""); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PID, ""); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_PROTO, ""); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_STATE, ""); + ui_table_row_col_set(&flows_tbl, TBL_FLOW_TIME, ""); print_flow_peer_info(n, FLOW_DIR_DST); ui_table_row_show(&flows_tbl); diff --git a/ui.c b/ui.c index 2a684d8..b7a93e5 100644 --- a/ui.c +++ b/ui.c @@ -171,7 +171,7 @@ static void __ui_table_row_print(struct ui_table *tbl, struct ui_col *col, ui_text_attr_insert(tbl->row, col->pos + col->len, color, tmp); } -void ui_table_row_print(struct ui_table *tbl, uint32_t col_id, const char *str) +void ui_table_row_col_set(struct ui_table *tbl, uint32_t col_id, const char *str) { struct ui_col *col = ui_table_col_get(tbl, col_id); diff --git a/ui.h b/ui.h index 65338d1..07248ac 100644 --- a/ui.h +++ b/ui.h @@ -58,8 +58,8 @@ extern void ui_table_col_align_set(struct ui_table *tbl, int col_id, enum ui_ali extern void ui_table_row_add(struct ui_table *tbl); extern void ui_table_row_show(struct ui_table *tbl); -extern void ui_table_row_print(struct ui_table *tbl, uint32_t col_id, - const char *str); +extern void ui_table_row_col_set(struct ui_table *tbl, uint32_t col_id, + const char *str); extern void ui_table_header_color_set(struct ui_table *tbl, int color); extern void ui_table_header_print(struct ui_table *tbl); -- 2.9.2 -- 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.