Error.h 543 B

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