The configuration module reponsible for managing the configuration of xy. Any change to xy’s runtime configuration (RC) file will cause the configuration to be reloaded (see config_reinit()).
The type made available after a call to config_init(). It contains all the necessary configuration options xy uses while running.
Initializes xy’s configuration. Returns the configuration or NULL on failure. This function makes CONFIG available for use.
The configuration module’s shutdown hook.
Writes the default xy configuration to the xy runtime configuration path.
Reinitializes the configuration from the xy runtime configuration path.
A collection of utility functions meant to stand alone from other xy modules.
Returns the path of xy’s runtime configuration. The returned string should be freed by the caller.
Returns true if the strings are equal or null, false otherwise.
Removes leading and trailing whitespace from the string and returns a pointer starting from the first non-whitespace character. The returned string is contained in the same memory as the argument.
Example:
char *conststr = " test string ";
char *dup = strdup(conststr);
char *trimmed = trim(dup); // trimmed: "test string"
free(dup);
Dumps num_frames stack frames to stderr.
Tokenizes cmd by spaces into tokens placed in argv.
Example:
char *command = "some string here";
char *dup = strdup(command);
char *argv[3];
parse_command(dup, argv);
// argv[0]: "some"
// argv[1]: "string"
// argv[2]: "here"
free(dup);
Executes the supplied command by calling execvp. The command will be parsed before the call is made (see parse_command()).
The inotify module. XY uses the inotify module to react to changes occurring on the filesystem.
The inotify file descriptor made available after a call to xy_inotify_init(). This file descriptor is suitable for system calls like select and epoll.
Initializes xy’s inotify module. This function makes in_fd available for use, which may be -1 on failure.
Reinitializes the inotify module. This function makes a new in_fd available for use.
The inotify module’s shutdown hook.
Drains the inotify event queue of all events.