.TH "ttypt/axil-xy.h" 3 "axil" \" -*- nroff -*- .ad l .nh .SH NAME ttypt/axil-xy.h \- XY hook declarations for the axil event loop\&. .SH SYNOPSIS .br .PP \fR#include \fP .br \fR#include \fP .br .SS "Typedefs" .in +1c .ti -1c .RI "typedef int \fBsocket_t\fP" .br .RI "Socket descriptor type\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_post_chroot, void)" .br .RI "Hook fired once after startup's \fR-C\fP chroot/chdir, before any bind\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_post_bind, void)" .br .RI "Hook fired once after listening sockets are bound and privileges dropped, immediately before the event loop begins\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_exit, int, i)" .br .RI "Hook fired as the server is about to exit (i = exit code)\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_update, unsigned long long, dt)" .br .RI "Hook fired each event-loop update (dt = millisecond delta)\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_vim, \fBsocket_t\fP, fd, int, argc, char **, argv)" .br .RI "Hook fired for vim (-v) command input on a client fd\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_command, \fBsocket_t\fP, fd, int, argc, char **, argv)" .br .RI "Hook fired for a command string from a client fd\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_flush, \fBsocket_t\fP, fd, int, argc, char **, argv)" .br .RI "Hook fired after every dispatched command (tail flush)\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_connect, \fBsocket_t\fP, fd)" .br .RI "Hook fired when a client connects\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_disconnect, \fBsocket_t\fP, fd)" .br .RI "Hook fired when a client disconnects\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_tick, \fBsocket_t\fP, fd)" .br .RI "Hook fired on each periodic tick for a client fd\&. " .ti -1c .RI "\fBXY_DECL\fP (int, on_axil_parse, \fBsocket_t\fP, fd, unsigned char *, input, int, nread)" .br .RI "Hook fired with raw parsed input bytes from a client fd\&. " .in -1c .SH "Detailed Description" .PP XY hook declarations for the axil event loop\&. Modules listen on these hooks to react to server lifecycle, command input, and client connect/disconnect events\&. .SH "Function Documentation" .PP .SS "XY_DECL (int , on_axil_flush , \fBsocket_t\fP , fd , int , argc , char ** , argv )" .PP Hook fired after every dispatched command (tail flush)\&. axil calls the executable's weak \fR\fBaxil_flush\fP\fP bridge at the tail of cmd_proc(); that bridge dispatches here\&. A module that buffers output (e\&.g\&. a history+dedup typewriter buffer) drains it from this hook so the last reply is not left pending until the next, different write\&. .SS "XY_DECL (int , on_axil_post_chroot , void )" .PP Hook fired once after startup's \fR-C\fP chroot/chdir, before any bind\&. This is the point where the process's filesystem view has changed but no socket is listening yet, so a module that resolves paths at boot -- a content loader, say -- can load from inside the jail here and be finished before the first request is served\&. Hooks fired later (on_axil_update, on_axil_connect, \&.\&.\&.) all run after bind, which is too late for that\&. .PP Zero implementors is a safe no-op; a second fire (a host that does not chroot has nothing to do) is the implementor's own to ignore\&. .SH "Author" .PP Generated automatically by Doxygen for axil from the source code\&.