From 0d706ae72ceefd74053ad6cb0900ecce6cf1f085 Mon Sep 17 00:00:00 2001 From: auric Date: Sat, 21 Feb 2026 11:08:36 -0600 Subject: Add Umbrella 0.1.5 --- src/log_tail.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/log_tail.h (limited to 'src/log_tail.h') diff --git a/src/log_tail.h b/src/log_tail.h new file mode 100644 index 0000000..3131ff6 --- /dev/null +++ b/src/log_tail.h @@ -0,0 +1,31 @@ +#ifndef UMBRELLA_LOG_TAIL_H +#define UMBRELLA_LOG_TAIL_H + +#include "umbrella.h" + +/* + * log_tail_init: open log files for all units that have them defined, + * seek to end, and register fds with epoll. + * Call once after units are loaded. + */ +void log_tail_init(void); + +/* + * log_tail_handle: called when a log fd becomes readable. + * Reads new lines, pushes to the unit's ring buffer, and broadcasts + * to all attached clients. + */ +void log_tail_handle(int fd); + +/* + * log_tail_cleanup: close all open log fds. + */ +void log_tail_cleanup(void); + +/* + * log_tail_fd_to_unit: find which unit owns a given log fd. + * Returns NULL if not found. + */ +Unit *log_tail_fd_to_unit(int fd); + +#endif /* UMBRELLA_LOG_TAIL_H */ -- cgit v1.2.3