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