#pragma once #include #include typedef enum { SUCCESS, FAILURE } Status; typedef enum { LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR, } LogLevel; extern LogLevel log_level; void SetLogLevel(LogLevel level); void Log(LogLevel level, const char* format, ...); Status Format(char** _string, const char* fmt, ...); Status RunExecutable(int* _exit_code, char** _stdout, char** _stderr, const char* executable, ...); Status ReadFileDescriptor(int fd, char** _content); Status WriteFileDescriptor(int fd, const char* content); Status ReadFile(const char* path, char** _content); Status WriteFile(const char* path, const char* content); Status CopyFile(const char* source_path, const char* destination_path);