#include #include #include "Error.h" void eInitError(Error* e, int line, const char* format, ...) { va_list args; va_start(args, format); eInitErrorV(e, line, format, args); va_end(args); } void eInitErrorV(Error* e, int line, const char* format, va_list ap) { e->line = line; vsnprintf(e->message, sizeof(e->message), format, ap); } void eInitSuccess(Error* e) { e->line = -1; e->message[0] = '\0'; } bool eHasError(const Error* e) { return e->line >= 0; }