diff options
| author | auric <auric@japegames.com> | 2026-02-21 11:08:36 -0600 |
|---|---|---|
| committer | auric <auric@japegames.com> | 2026-02-21 11:08:36 -0600 |
| commit | 0d706ae72ceefd74053ad6cb0900ecce6cf1f085 (patch) | |
| tree | 6faf7d3919182b8838a6ae69ad1a2a0fac468740 /src/log_tail.h | |
Add Umbrella 0.1.5
Diffstat (limited to 'src/log_tail.h')
| -rw-r--r-- | src/log_tail.h | 31 |
1 files changed, 31 insertions, 0 deletions
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 */ |
