#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 */