summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-08-23 00:06:03 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-09-15 18:28:28 +0200
commit9ec74c8eb4d44510827140446a9b155cb8a61690 (patch)
tree0f939b2fc69d9b396cfa5052922c36f3d3852d29
parente18c0f2a23fc9e62a5be13af270cb81326ee6550 (diff)
ui: Rename ui_table_row_print -> ui_table_row_col_set
Really ui_table_row_print(x) no more prints anything, it just sets column value in a row. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--flowtop.c44
-rw-r--r--ui.c2
-rw-r--r--ui.h4
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 1ab56af..2177964 100644
--- a/ui.c
+++ b/ui.c
@@ -170,7 +170,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);