/// @brief Returns a generic failure result, with an error message formatted using the given format string and arguments. The error message is stored in a global buffer, and can be retrieved using the error() function.
/// @param format The format string to use for the error message.
/// @param ... The arguments to use for the format string.
/// @brief Extracts a substring from the given string, starting at the given index and with the given length, and stores the result in the given string pointer.
/// @param _str The string pointer to store the result in. The caller is responsible for freeing the string.
/// @param str The string to extract the substring from.
/// @param start The index to start the substring at.
/// @param length The length of the substring. If the length goes beyond the end of the string, the substring will be truncated to the end of the string.
/// @brief Executes the given command, and stores the result in the given exit code pointer, and the standard output and standard error in the given string pointers.
/// @param _exit_code The exit code pointer to store the result in.
/// @param _stdoutbuf The standard output string pointer to store the result in. The caller is responsible for freeing the string. This parameter can be NULL if the standard output is not needed.
/// @param _stderrbuf The standard error string pointer to store the result in. The caller is responsible for freeing the string. This parameter can be NULL if the standard error is not needed.
/// @param executable The command to execute.
/// @param ... The arguments to pass to the command. The last argument must be NULL. No need to pass the executable as the first argument.
/// @brief Lists the files in the given directory, and stores the result in the given string pointer array. A filter can be provided to only include files that match the filter.
/// @param _files The string pointer array to store the result in. The caller is responsible for freeing the strings and the array.
/// @param path The path to the directory to list the files in.
/// @param filter The filter to use to only include files that match the filter. This parameter can be NULL if no filter is needed.