.TH "ttypt/xy-watch.h" 3 "libxylem" \" -*- nroff -*- .ad l .nh .SH NAME ttypt/xy-watch.h \- Filesystem-watch auto-reload for xy modules\&. .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "int \fBxy_watch_start\fP (void)" .br .RI "Spawn the background watcher thread\&. " .ti -1c .RI "void \fBxy_watch_stop\fP (void)" .br .RI "Stop the background watcher thread and release all resources\&. " .ti -1c .RI "int \fBxy_watch_add\fP (const char *fname)" .br .RI "Add a module path to the watch set\&. " .ti -1c .RI "void \fBxy_watch_remove\fP (const char *fname)" .br .RI "Remove a module path from the watch set\&. " .in -1c .SH "Detailed Description" .PP Filesystem-watch auto-reload for xy modules\&. libxylem-watch monitors loaded module \&.so files with inotify and calls \fBxy_reload()\fP automatically when a file is updated on disk\&. .PP Typical usage: .PP xy_load("mods/foo"); xy_watch_add("mods/foo"); // start watching \fBxy_watch_start()\fP; // spawn background thread (idempotent) \&.\&.\&. \fBxy_watch_stop()\fP; // clean up before exit .PP \fBxy_watch_start()\fP is idempotent — calling it multiple times is safe\&. \fBxy_watch_add()\fP may be called before or after \fBxy_watch_start()\fP\&. .PP Thread safety: all functions are safe to call from any thread\&. .PP Platform: Linux only (uses inotify)\&. .SH "Function Documentation" .PP .SS "int xy_watch_add (const char * fname)" .PP Add a module path to the watch set\&. .PP \fBParameters\fP .RS 4 \fIfname\fP The same path string passed to \fBxy_load()\fP (without \&.so suffix)\&. .RE .PP \fBReturns\fP .RS 4 0 on success, -1 on error (check errno)\&. .RE .PP .SS "void xy_watch_remove (const char * fname)" .PP Remove a module path from the watch set\&. .PP \fBParameters\fP .RS 4 \fIfname\fP The same path string passed to \fBxy_load()\fP (without \&.so suffix)\&. .RE .PP .SS "int xy_watch_start (void )" .PP Spawn the background watcher thread\&. Safe to call multiple times; subsequent calls are no-ops\&. .PP \fBReturns\fP .RS 4 0 on success, -1 on error (check errno)\&. .RE .PP .SS "void xy_watch_stop (void )" .PP Stop the background watcher thread and release all resources\&. Blocks until the thread has exited\&. After this, \fBxy_watch_start()\fP may be called again to restart watching\&. .SH "Author" .PP Generated automatically by Doxygen for libxylem from the source code\&.