Error.h 663 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef SNUVI_ERROR_H
  2. #define SNUVI_ERROR_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <stdarg.h>
  7. #include <stdbool.h>
  8. #include "Check.h"
  9. typedef struct Error {
  10. int line;
  11. int codeLine;
  12. char message[256];
  13. char paths[256];
  14. } Error;
  15. check_format(5, 6) void eInitError(Error* e, const char* path, int line,
  16. int codeLine, const char* format, ...);
  17. void eInitErrorV(Error* e, const char* path, int codeLine, int line,
  18. const char* format, va_list ap);
  19. void eInitSuccess(Error* e);
  20. void eAddPath(Error* e, const char* path);
  21. bool eHasError(const Error* e);
  22. #ifdef __cplusplus
  23. }
  24. #endif
  25. #endif