3#ifndef FSAUTOPROC_LCMD_H
4#define FSAUTOPROC_LCMD_H
16#define LCTRIG_NEW (1 << 0)
20#define LCTRIG_MOD (1 << 1)
24#define LCTRIG_DEL (1 << 2)
28#define LCTRIG_ALL (LCTRIG_NEW | LCTRIG_MOD | LCTRIG_DEL)
32#define LCTOPT_TRACE (1 << 7)
36#define LCTOPT_VERBOSE (1 << 8)
struct lcmdset_s ** lcmdparse(const char *fp)
Parses the provided file path and populates an array of command sets. The file must be a valid JSON f...
Definition lcmd.c:175
void lcmdfree_r(struct lcmdset_s **cs)
Iterates and frees all memory allocated by the command set array.
Definition lcmd.c:39
bool lcmdmatchany(struct lcmdset_s **cs, const char *fp)
Checks if the provided file path matches any of the file patterns in the command set.
Definition lcmd.c:227
int lcmdexec(struct lcmdset_s **cs, const char *fp, struct fdset_s fds, int flags)
Sequentially iterates the command set and executes the configured system commands on the provided fil...
Definition lcmd.c:296
A set of file descriptors for redirecting writes to stdout and stderr from child processes to log fil...
Definition fd.h:9
A set of system commands to execute when a file event of a specific type and file path is triggered.
Definition lcmd.h:41
slist_t syscmds
Commands to pass to system(3)
Definition lcmd.h:44
uint64_t msspent
Sum milliseconds spent executing commands.
Definition lcmd.h:46
char * name
Command set name or description for logging.
Definition lcmd.h:45
int onflags
Command set trigger bit flags.
Definition lcmd.h:42
regex_t ** fpatterns
Compiled regex patterns used for file path matching.
Definition lcmd.h:43