Error.h 617 B

12345678910111213141516171819202122232425262728293031
  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. char message[256];
  12. char paths[256];
  13. } Error;
  14. check_format(4, 5) void eInitError(Error* e, const char* path, int line,
  15. const char* format, ...);
  16. void eInitErrorV(Error* e, const char* path, int line, const char* format,
  17. va_list ap);
  18. void eInitSuccess(Error* e);
  19. void eAddPath(Error* e, const char* path);
  20. bool eHasError(const Error* e);
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif