ttypt/axil-xy.h(3)axil

NAME

ttypt/axil-xy.h - XY hook declarations for the axil event loop.

SYNOPSIS

#include <ttypt/xy.h>
#include <sys/select.h>

Typedefs

typedef int socket_t

Socket descriptor type.

Functions

XY_DECL (int, on_axil_post_chroot, void)

Hook fired once after startup's -C chroot/chdir, before any bind.

XY_DECL (int, on_axil_post_bind, void)

Hook fired once after listening sockets are bound and privileges dropped, immediately before the event loop begins.

XY_DECL (int, on_axil_exit, int, i)

Hook fired as the server is about to exit (i = exit code).

XY_DECL (int, on_axil_update, unsigned long long, dt)

Hook fired each event-loop update (dt = millisecond delta).

XY_DECL (int, on_axil_vim, socket_t, fd, int, argc, char **, argv)

Hook fired for vim (-v) command input on a client fd.

XY_DECL (int, on_axil_command, socket_t, fd, int, argc, char **, argv)

Hook fired for a command string from a client fd.

XY_DECL (int, on_axil_flush, socket_t, fd, int, argc, char **, argv)

Hook fired after every dispatched command (tail flush).

XY_DECL (int, on_axil_connect, socket_t, fd)

Hook fired when a client connects.

XY_DECL (int, on_axil_disconnect, socket_t, fd)

Hook fired when a client disconnects.

XY_DECL (int, on_axil_tick, socket_t, fd)

Hook fired on each periodic tick for a client fd.

XY_DECL (int, on_axil_parse, socket_t, fd, unsigned char *, input, int, nread)

Hook fired with raw parsed input bytes from a client fd.

Detailed Description

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.

Function Documentation

XY_DECL (int , on_axil_flush , socket_t , fd , int , argc , char ** , argv )

Hook fired after every dispatched command (tail flush). axil calls the executable's weak axil_flush 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.

XY_DECL (int , on_axil_post_chroot , void )

Hook fired once after startup's -C 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.

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.

Author

Generated automatically by Doxygen for axil from the source code.