From 522e11c8086b7d8ab76b9be07c1861f35ed2327f Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Mon, 4 May 2026 23:33:08 +0200 Subject: Adds prototype for the data client UI --- core/tui.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'core/tui.c') diff --git a/core/tui.c b/core/tui.c index 6c27ff5..4fc2ce4 100644 --- a/core/tui.c +++ b/core/tui.c @@ -1,3 +1,6 @@ +#define PANE_WIDTH 27 +#define PANE_AND_MARGIN_WIDTH (PANE_WIDTH + 2) + enum { PAIR_NORMAL = 0, }; @@ -70,17 +73,26 @@ void tui_field(int line, int col, int color, int attr, const char *format, ...) void tui_str_field(int l, const char *label, const char *value) { assert(label); + assert(strlen(label) <= 4); assert(value); - tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%s : %18s", label, value); + tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %18s", label, value); } void tui_ulx_field(int l, const char *label, uint64_t value) { assert(label); + assert(strlen(label) <= 4); tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %#18lx", label, value); } +void tui_uld_field(int l, const char *label, uint64_t value) { + assert(label); + assert(strlen(label) <= 4); + tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %#18ld", label, value); +} + void tui_float_field(int l, const char *label, float value) { assert(label); + assert(strlen(label) <= 4); tui_line(false, l, PAIR_NORMAL, A_NORMAL, "%-4s : %18.1f", label, value); } -- cgit v1.3