diff --git a/src/util.c b/src/util.c index 2d94ffe..9cfd212 100644 --- a/src/util.c +++ b/src/util.c @@ -9,12 +9,24 @@ #include #include + +/** + * @description Wrapper around getenv(3), allowing to set a default value + * @param name The name of the environment variable + * @param dflt The default value to set if the variable is not present. + * @return default value or value of environment variable. + */ const char *getenv_default(const char *name, const char *dflt) { return getenv(name) ? : dflt; } +/** + * @description Centralized exit point, called due to an error + * @param msg The message to display on stderr before killing the program + * @param ... Values for the format string. + */ void die(const char *msg, ...) { va_list args;