ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches
tui/mdns.c
Go to the documentation of this file.
1
2/* Storage capacities in elements; text buffers include the terminating NUL. */
3#define TUI_MDNS_INPUT_BUFFER_SIZE 32
4#define TUI_MDNS_HEADING_BUFFER_SIZE 128
5#define TUI_MDNS_LINE_BUFFER_SIZE 512
6#define TUI_MDNS_CLIPPED_BUFFER_SIZE 512
7
10#include <ascii-chat/ui/text.h>
19
20#include <ascii-chat/common.h>
22#include <ascii-chat/log/log.h>
28#include <ascii-chat/tui/mdns.h>
35#include <libplatform/atomic.h>
36#include <libplatform/compiler.h>
37#include <libplatform/system.h>
38#include <libplatform/terminal.h>
39#include <options/options.h>
40
41#include <stdio.h>
42#include <stdlib.h>
43#include <string.h>
44#ifndef _WIN32
45#include <unistd.h>
46#endif
47
48/* ============================================================================
49 * Log Management
50 * ========================================================================== */
51
52void ui_mdns_log_init(void) {
54 if (buf) {
56 }
57}
58
63
65
66void ui_mdns_log_append(const char *message) {
67 if (message) {
68 log_info("%s", message);
69 }
70}
71
80 int *out_count) {
81 if (!out_count) {
82 SET_ERRNO(ERROR_INVALID_PARAM, "out_count pointer is NULL");
83 return NULL;
84 }
85
86 *out_count = 0;
87
88 // Apply defaults if needed
89 int timeout_ms =
90 (config && config->timeout_ms > 0) ? config->timeout_ms : 2000;
91 int max_servers =
92 (config && config->max_servers > 0) ? config->max_servers : 20;
93 bool quiet = (config && config->quiet);
94
95 // Call the core mDNS discovery function from discovery.c
96 return discovery_mdns_query(timeout_ms, max_servers, quiet, out_count);
97}
98
105
109int ui_mdns_prompt_selection(const ui_mdns_server_t *servers, int count) {
110 if (terminal_can_prompt_user(!GET_OPTION(snapshot_mode)))
111 return ui_mdns_select(servers, count);
112 if (!servers || count <= 0) {
113 return -1;
114 }
115
116 log_error("Cannot select a discovered server without an interactive "
117 "terminal; specify a server address.");
118 return -1;
119}
120
141
142#define MDNS_LIVE_CAPACITY 128
143#define MDNS_LIST_MAX_ROWS 12
155
156static int compare_mdns_servers(const void *left, const void *right) {
157 const ui_mdns_server_t *a = left, *b = right;
158 int address =
160 return address ? address : (int)a->port - (int)b->port;
161}
162
163static void *refresh_mdns_servers(void *data) {
164 mdns_refresh_t *refresh = data;
165 ui_mdns_config_t config = {
166 .timeout_ms = 500, .max_servers = MDNS_LIVE_CAPACITY, .quiet = true};
167 unsigned empty_refreshes = 0;
168 while (!atomic_load_bool(&refresh->stop)) {
169 int count = 0;
170 ui_mdns_server_t *servers = ui_mdns_query(&config, &count);
171 if (count > 1)
172 qsort(servers, (size_t)count, sizeof(*servers), compare_mdns_servers);
173 if (!atomic_load_bool(&refresh->stop)) {
174 mutex_lock(&refresh->mutex);
175 bool apply_snapshot = true;
176 if (count == 0 && refresh->count > 0)
177 apply_snapshot = ++empty_refreshes >= 2;
178 else
179 empty_refreshes = 0;
180 if (apply_snapshot) {
181 bool changed = count != refresh->count ||
182 (count && memcmp(refresh->servers, servers,
183 (size_t)count * sizeof(*servers)) != 0);
184 refresh->count = count;
185 if (count)
186 memcpy(refresh->servers, servers, (size_t)count * sizeof(*servers));
187 if (changed)
188 ++refresh->generation;
189 }
190 mutex_unlock(&refresh->mutex);
191 }
192 ui_mdns_free_results(servers);
193 for (int i = 0; i < 10 && !atomic_load_bool(&refresh->stop); ++i)
194 platform_sleep_ms(100);
195 }
196 return NULL;
197}
198
199static void mdns_divider(frame_buffer_t *buffer, int columns, int width,
200 bool unicode, bool colors) {
201 frame_buffer_printf(buffer, "%*s", (columns - width) / 2, "");
202 frame_buffer_render_divider(buffer, width, unicode, colors);
203 frame_buffer_printf(buffer, "\r");
204}
205
206static void mdns_footer(frame_buffer_t *buffer, int columns, const char *input,
207 bool colors, bool live) {
208 const char *parts[] = {
209 "Arrows", "/", "j",
210 "/", "k", ": move | ",
211 "Enter", ": select | ", "Esc",
212 "/", "q", live ? ": cancel | Auto-refresh" : ": cancel",
213 input};
214 bool keys[] = {true, false, true, false, true, false, true,
215 false, true, false, true, false, false};
216 int length = 0;
217 for (size_t i = 0; i < sizeof(parts) / sizeof(parts[0]); ++i)
218 length += (int)strlen(parts[i]);
219 int width = length < columns - 1 ? length : columns - 1;
220 frame_buffer_printf(buffer, "%*s", (columns - 1 - width) / 2, "");
221 int used = 0;
222 for (size_t i = 0; i < sizeof(parts) / sizeof(parts[0]) && used < width;
223 ++i) {
224 int shown = (int)strlen(parts[i]);
225 if (shown > width - used)
226 shown = width - used;
228 buffer, "%s%.*s",
230 : "",
231 shown, parts[i]);
232 used += shown;
233 }
234 frame_buffer_printf(buffer, "%s", colors ? "\033[0m" : "");
235}
236
237static void render_mdns_selection(terminal_size_t size, const void *data) {
238 const mdns_snapshot_t *snapshot = data;
239 frame_buffer_t *buffer = frame_buffer_create(size.rows, size.cols);
240 if (!buffer)
241 return;
242 frame_buffer_printf(buffer, "\033[0m\033[H\033[2J");
243 bool colors =
244 !GET_OPTION(strip_ansi) &&
246 bool unicode = terminal_should_use_utf8(GET_OPTION(force_utf8));
247 int panel_width = size.cols - 1 < 80 ? size.cols - 1 : 80;
248 bool show_title = size.rows >= 5;
249 int chrome = show_title ? 4 : 3;
250 bool compact = size.cols < 52 || size.rows < 10;
251 int logo_rows = size.rows >= 9 ? (compact ? 1 : 4) : 0;
252 int logo_height = logo_rows ? logo_rows + 1 : 0;
253 int available = size.rows - logo_height - chrome;
254 if (available < 1 || size.cols < 2) {
255 frame_buffer_flush(buffer);
256 frame_buffer_destroy(buffer);
257 return;
258 }
259 if (available > MDNS_LIST_MAX_ROWS)
260 available = MDNS_LIST_MAX_ROWS;
261 int shown = snapshot->count < available ? snapshot->count : available;
262 if (!shown)
263 shown = 1;
264 int height = logo_height + shown + chrome;
265 int top = (size.rows - height) / 2 + 1;
266 frame_buffer_printf(buffer, "\033[%d;1H", top);
267 if (logo_rows) {
269 int tick = sample ? (int)(sample->seconds * 60)
270 : (int)((time_get_ns() / NS_PER_MS_INT / 16) % 100000);
271 invitation_render_logo(buffer, size.cols - 1, tick, colors, compact);
272 frame_buffer_printf(buffer, "\r\n");
273 }
274 char heading[TUI_MDNS_HEADING_BUFFER_SIZE];
275 if (show_title) {
276 truncate_with_ellipsis("LAN servers", heading, sizeof(heading),
277 size.cols - 1);
278 frame_buffer_render_centered(buffer, heading, size.cols - 1);
279 frame_buffer_printf(buffer, "\r");
280 }
281 mdns_divider(buffer, size.cols - 1, panel_width, unicode, colors);
282 if (snapshot->count == 0) {
283 truncate_with_ellipsis("Searching for LAN servers...", heading,
284 sizeof(heading), size.cols - 1);
285 frame_buffer_render_centered(buffer, heading, size.cols - 1);
286 frame_buffer_printf(buffer, "\r");
287 }
288 ui_selectable_list_t list = snapshot->list;
289 ui_selectable_list_keep_visible(&list, snapshot->count, available);
290 int first = list.first_visible;
291 for (int i = first; i < snapshot->count && i < first + available; ++i) {
293 const char *address = ui_mdns_get_best_address(&snapshot->servers[i]);
294 snprintf(line, sizeof(line), "%s [%d] %s (%s%s%s:%u)",
295 i == list.selected ? ">" : " ", i + 1, snapshot->servers[i].name,
296 strchr(address, ':') ? "[" : "", address,
297 strchr(address, ':') ? "]" : "", snapshot->servers[i].port);
298 truncate_with_ellipsis(line, clipped, sizeof(clipped), size.cols - 2);
299 if (colors && i == list.selected)
301 frame_buffer_render_centered(buffer, clipped, size.cols - 1);
302 frame_buffer_printf(buffer, "\033[0m\r");
303 }
304 if (snapshot->count > available)
305 ui_scrollbar_render(buffer, top + logo_height + (show_title ? 2 : 1),
306 size.cols, available, (size_t)snapshot->count,
307 (size_t)available, (size_t)first);
308 mdns_divider(buffer, size.cols - 1, panel_width, unicode, colors);
309 mdns_footer(buffer, size.cols, snapshot->input, colors, snapshot->live);
310 frame_buffer_flush(buffer);
311 frame_buffer_destroy(buffer);
312}
313
314int ui_mdns_select(const ui_mdns_server_t *servers, int count) {
315 if (!servers || count <= 0)
316 return -1;
317 return ui_mdns_select_until(servers, count, ui_input_deadline(30));
318}
319
320static int select_mdns_until(const ui_mdns_server_t *servers, int count,
321 uint64_t deadline, mdns_refresh_t *refresh,
322 ui_mdns_server_t *chosen) {
323 if (count < 0 || (!servers && count > 0))
324 return -1;
325 if (!terminal_can_prompt_user(!GET_OPTION(snapshot_mode)))
326 return ui_mdns_prompt_selection(servers, count);
327 if (keyboard_init() != ASCIICHAT_OK)
328 return -1;
329 size_t bytes =
330 sizeof(mdns_snapshot_t) +
331 (size_t)(refresh ? MDNS_LIVE_CAPACITY : count) * sizeof(*servers);
332 mdns_snapshot_t *snapshot = SAFE_CALLOC(1, bytes, mdns_snapshot_t *);
333 if (!snapshot)
334 return -1;
335 snapshot->count = count;
336 snapshot->live = refresh != NULL;
337 if (count > 0)
338 memcpy(snapshot->servers, servers, (size_t)count * sizeof(*servers));
339 bool logging = log_get_terminal_output();
341 if (refresh) {
342 thread_init(&refresh->thread);
343 refresh->running =
344 platform_thread_create(&refresh->thread, "lan_refresh",
345 refresh_mdns_servers, refresh) == 0;
346 if (!refresh->running) {
348 SAFE_FREE(snapshot);
349 return -1;
350 }
351 }
352 unsigned generation = 0;
353 int selection = -1;
354 size_t length = 0;
355 bool timed_out = false;
356 while (!shutdown_is_requested()) {
357 if (refresh) {
358 mutex_lock(&refresh->mutex);
359 if (generation != refresh->generation) {
360 ui_mdns_server_t previous = {0};
361 if (count)
362 previous = snapshot->servers[snapshot->list.selected];
363 count = refresh->count;
364 snapshot->count = count;
365 memcpy(snapshot->servers, refresh->servers,
366 (size_t)count * sizeof(*servers));
367 ui_selectable_list_reset(&snapshot->list);
368 for (int i = 0; i < count; ++i) {
369 if (previous.port == snapshot->servers[i].port &&
370 strcmp(ui_mdns_get_best_address(&previous),
371 ui_mdns_get_best_address(&snapshot->servers[i])) == 0) {
372 snapshot->list.selected = i;
373 break;
374 }
375 }
376 length = 0;
377 snapshot->input[0] = '\0';
378 generation = refresh->generation;
379 }
380 mutex_unlock(&refresh->mutex);
381 }
382 if (ui_controller_submit(UI_SCREEN_MDNS, STDERR_FILENO,
383 (terminal_size_t){.cols = 2, .rows = 4},
384 render_mdns_selection, snapshot,
385 bytes) != ASCIICHAT_OK)
386 break;
387 keyboard_key_t key = ui_input_wait_key(UI_SCREEN_MDNS, 100);
388 if (ui_input_expired(deadline)) {
389 timed_out = true;
390 break;
391 }
392 if (key == KEY_ESCAPE || key == 'q' || key == 3)
393 break;
394 if (key == KEY_HOME || key == KEY_END) {
395 ui_viewport_t viewport = {.selected = (size_t)snapshot->list.selected,
396 .first_visible =
397 (size_t)snapshot->list.first_visible};
398 ui_viewport_key(&viewport, (size_t)count, MDNS_LIST_MAX_ROWS, key);
399 snapshot->list.selected = (int)viewport.selected;
400 snapshot->list.first_visible = (int)viewport.first_visible;
401 length = 0;
402 snapshot->input[0] = '\0';
403 continue;
404 }
405 if (count &&
406 (key == KEY_UP || key == 'k' || key == KEY_DOWN || key == 'j')) {
407 int delta = (key == KEY_UP || key == 'k') ? -1 : 1;
408 snapshot->list.selected =
409 (snapshot->list.selected + delta + count) % count;
410 ui_selectable_list_keep_visible(&snapshot->list, count,
412 length = 0;
413 snapshot->input[0] = '\0';
414 continue;
415 }
416 if (key == '\r' || key == '\n') {
417 if (!count)
418 continue;
419 if (!length) {
420 selection = snapshot->list.selected;
421 break;
422 }
423 long value = strtol(snapshot->input, NULL, 10);
424 if (value >= 1 && value <= count) {
425 selection = (int)value - 1;
426 break;
427 }
428 length = 0;
429 snapshot->input[0] = '\0';
430 } else if ((key == 8 || key == 127) && length) {
431 snapshot->input[--length] = '\0';
432 } else if (key >= '0' && key <= '9' &&
433 length < sizeof(snapshot->input) - 1) {
434 snapshot->input[length++] = (char)key;
435 snapshot->input[length] = '\0';
436 }
437 }
438 if (chosen && selection >= 0)
439 *chosen = snapshot->servers[selection];
440 if (refresh && refresh->running) {
441 atomic_store_bool(&refresh->stop, true);
442 thread_join(&refresh->thread, NULL);
443 }
446 SAFE_FREE(snapshot);
447 if (timed_out)
448 ui_input_timeout_report(30u, "server selection cancelled; specify a server "
449 "address for unattended use");
450 return selection;
451}
452
453int ui_mdns_select_until(const ui_mdns_server_t *servers, int count,
454 uint64_t deadline) {
455 return select_mdns_until(servers, count, deadline, NULL, NULL);
456}
457
458int ui_mdns_select_live(const ui_mdns_server_t *servers, int count,
459 uint64_t deadline, ui_mdns_server_t *chosen) {
460 if (!chosen || count < 0 || count > MDNS_LIVE_CAPACITY || (count && !servers))
461 return -1;
462 mdns_refresh_t refresh = {0};
463 refresh.count = count;
464 if (count)
465 memcpy(refresh.servers, servers, (size_t)count * sizeof(*servers));
466 if (mutex_init(&refresh.mutex, "lan_results") != 0)
467 return -1;
468 int selected = select_mdns_until(servers, count, deadline, &refresh, chosen);
469 mutex_destroy(&refresh.mutex);
470 return selected < 0 ? -1 : 0;
471}
472
480const char *ui_mdns_get_best_address(const ui_mdns_server_t *server) {
481 if (!server) {
482 return "";
483 }
484
485 // The service instance name is a display label, not a resolvable hostname.
486 if (server->ipv4[0] != '\0') {
487 return server->ipv4;
488 }
489 if (server->ipv6[0] != '\0') {
490 return server->ipv6;
491 }
492
493 return server->address; // Fallback to address field
494}
#define SET_ERRNO(code,...)
void atomic_store_bool(atomic_t *a, bool value)
Atomically store a boolean value.
bool atomic_load_bool(atomic_t *a)
Atomic pointer wrapper.
@ LOG_COLOR_GREY
Definition color.h:13
@ LOG_COLOR_DEV
Definition color.h:7
@ LOG_COLOR_DEBUG
Definition color.h:8
void discovery_mdns_destroy(ui_mdns_server_t *servers)
Free memory from mDNS discovery results.
Definition discovery.c:285
ui_mdns_server_t * discovery_mdns_query(int timeout_ms, int max_servers, bool quiet, int *out_count)
Public mDNS query function used by both parallel discovery and TUI wrapper.
Definition discovery.c:190
unsigned char colors[(512 *256 *2) *3]
Definition fft.c:23
unsigned int height
Definition fft.c:24
unsigned int width
Definition fft.c:24
int frame_buffer_render_centered(frame_buffer_t *buf, const char *text, int cols)
Render centered text (used by both splash and status screens).
void frame_buffer_destroy(frame_buffer_t *buf)
Destroy a frame buffer.
void frame_buffer_flush(frame_buffer_t *buf)
Flush the entire buffer to stdout in one atomic write.
void frame_buffer_render_divider(frame_buffer_t *buf, int width, bool use_utf8, bool use_colors)
frame_buffer_t * frame_buffer_create(int rows, int cols)
Create a new frame buffer.
void frame_buffer_printf(frame_buffer_t *buf, const char *fmt,...)
Printf-style append to the buffer.
Buffered terminal frame rendering.
struct frame_buffer frame_buffer_t
Opaque frame buffer handle.
#define SAFE_FREE(ptr)
#define SAFE_CALLOC(count, size, cast)
unsigned long long uint64_t
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INVALID_PARAM
bool log_get_terminal_output(void)
Get current terminal output setting.
Definition log/log.c:836
struct session_log_buffer session_log_buffer_t
Thread-safe fixed-size history ring for session-screen log lines.
#define log_error(...)
Log an ERROR message.
Definition log/log.h:604
void log_clear_session_log_buffer(void)
Unregister the session log buffer.
Definition log/log.c:2272
void log_set_session_log_buffer(session_log_buffer_t *buf)
Register a session log buffer with the logger.
Definition log/log.c:2263
#define log_info(...)
Log an INFO message.
Definition log/log.h:578
void log_set_terminal_output(bool enabled)
Control stderr output to terminal.
Definition log/log.c:818
#define NS_PER_MS_INT
Definition time.h:172
#define GET_OPTION(field)
Definition options.h:1339
#define options_terminal_settings()
Definition options.h:1287
bool shutdown_is_requested(void)
Check if shutdown has been requested.
Definition common.c:87
void truncate_with_ellipsis(const char *input, char *output, size_t output_size, int max_width)
Truncate a string to a maximum display width, with ellipsis.
⚙️ Common definitions, error codes, macros, and types shared throughout the application
🖥️ Display Width and Terminal Centering Utilities
void invitation_render_logo(frame_buffer_t *buf, int cols, int frame, bool colors, bool compact)
Definition invitation.c:45
📝 Logging API with multiple log levels and terminal output control
⚙️ Unified options parsing system for ascii-chat with builder pattern and lock-free access
void ui_scrollbar_render(frame_buffer_t *out, int row, int col, int height, size_t total, size_t visible, size_t offset)
Definition scrollbar.c:46
void ui_selectable_list_reset(ui_selectable_list_t *list)
void ui_selectable_list_keep_visible(ui_selectable_list_t *list, int count, int rows)
Thread-safe circular log buffer for session screens (status, splash).
Shutdown check system for clean library/application separation.
bool terminal_should_color_output(int fd, const terminal_options_t *options)
bool terminal_can_prompt_user(bool user_setting)
bool terminal_should_use_utf8(terminal_utf8_setting_t user_setting)
🔤 String Manipulation and Shell Escaping Utilities
For animation config, this is the live record that ties type, fps, speed, hidden_policy together....
Atomic value wrapper for integral/boolean types.
Definition atomic.h:80
platform_thread_t thread
Definition tui/mdns.c:147
mutex_t mutex
Definition tui/mdns.c:145
atomic_t stop
Definition tui/mdns.c:146
ui_mdns_server_t servers[128]
Definition tui/mdns.c:151
unsigned generation
Definition tui/mdns.c:149
TUI-based server selection with formatted display.
Definition tui/mdns.c:134
ui_mdns_server_t servers[1]
Definition tui/mdns.c:139
char input[32]
Definition tui/mdns.c:138
ui_selectable_list_t list
Definition tui/mdns.c:137
Configuration for TUI discovery.
Definition tui/mdns.h:86
int max_servers
Maximum servers to collect (default: 20).
Definition tui/mdns.h:88
int timeout_ms
Maximum time to wait for responses (default: 2000).
Definition tui/mdns.h:87
bool quiet
Suppress discovery messages (default: false).
Definition tui/mdns.h:89
Discovered server information from mDNS.
Definition tui/mdns.h:68
char name[256]
"swift-river-canyon")
Definition tui/mdns.h:69
char ipv4[16]
IPv4 address (if available).
Definition tui/mdns.h:78
char ipv6[46]
IPv6 address (if available).
Definition tui/mdns.h:79
uint16_t port
Server port number.
Definition tui/mdns.h:77
char address[256]
or hostname)
Definition tui/mdns.h:75
ui selectable list keeps the values that move through the subsystem: selected, first_visible....
For ui viewport, this is the live record that ties selected, first_visible, page_size together....
Definition viewport.h:20
size_t first_visible
Definition viewport.h:21
size_t selected
Definition viewport.h:21
void terminal_screen_log_destroy(void)
Standard log cleanup for terminal screens.
void terminal_screen_log_clear(void)
Clear buffered logs for terminal screens.
session_log_buffer_t * terminal_screen_log_init(void)
Initialize session log buffer for terminal screens.
Reusable "fixed header + scrolling logs" terminal screen abstraction.
const char * ui_text_color_prefix(log_color_t color)
Definition text.c:18
⏱️ High-precision timing utilities using sokol_time.h and uthash
void ui_controller_remove(ui_screen_t screen)
asciichat_error_t ui_controller_submit(ui_screen_t screen, int fd, terminal_size_t minimum, ui_render_fn render, const void *snapshot, size_t bytes)
const animation_sample_t * ui_controller_animation_sample(void)
@ UI_SCREEN_MDNS
keyboard_key_t ui_input_wait_key(ui_screen_t screen, unsigned timeout_ms)
Definition tui/input.c:603
void ui_input_timeout_report(unsigned seconds, const char *consequence)
Definition tui/input.c:54
uint64_t ui_input_deadline(unsigned seconds)
Definition tui/input.c:48
bool ui_input_expired(uint64_t deadline)
Definition tui/input.c:52
#define MDNS_LIST_MAX_ROWS
Definition tui/mdns.c:143
ui_mdns_server_t * ui_mdns_query(const ui_mdns_config_t *config, int *out_count)
TUI-based server selection with formatted display.
Definition tui/mdns.c:79
int ui_mdns_select_live(const ui_mdns_server_t *servers, int count, uint64_t deadline, ui_mdns_server_t *chosen)
Definition tui/mdns.c:458
#define TUI_MDNS_HEADING_BUFFER_SIZE
Definition tui/mdns.c:4
#define TUI_MDNS_INPUT_BUFFER_SIZE
Definition tui/mdns.c:3
void ui_mdns_free_results(ui_mdns_server_t *servers)
Free results from mDNS discovery.
Definition tui/mdns.c:102
int ui_mdns_select_until(const ui_mdns_server_t *servers, int count, uint64_t deadline)
Definition tui/mdns.c:453
void ui_mdns_log_append(const char *message)
Append message to mDNS discovery log buffer.
Definition tui/mdns.c:66
const char * ui_mdns_get_best_address(const ui_mdns_server_t *server)
This is the handoff point for mdns refresh. Callers fill mutex, stop, thread, running before passing ...
Definition tui/mdns.c:480
void ui_mdns_log_init(void)
Discovered server information from mDNS.
Definition tui/mdns.c:52
#define TUI_MDNS_LINE_BUFFER_SIZE
Definition tui/mdns.c:5
int ui_mdns_select(const ui_mdns_server_t *servers, int count)
Definition tui/mdns.c:314
void ui_mdns_log_clear(void)
Clear mDNS discovery log buffer.
Definition tui/mdns.c:64
void ui_mdns_log_destroy(void)
Destroy mDNS discovery log buffer.
Definition tui/mdns.c:59
int ui_mdns_prompt_selection(const ui_mdns_server_t *servers, int count)
Interactive server selection.
Definition tui/mdns.c:109
#define MDNS_LIVE_CAPACITY
Definition tui/mdns.c:142
#define TUI_MDNS_CLIPPED_BUFFER_SIZE
Definition tui/mdns.c:6
mDNS service discovery UI with terminal_screen rendering
bool ui_viewport_key(ui_viewport_t *v, size_t count, size_t rows, keyboard_key_t key)
Definition viewport.c:40