00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _SQUAREBALL_ERROR_H
00010 #define _SQUAREBALL_ERROR_H
00011
00012 #include <stdarg.h>
00013
00029 typedef struct {
00030
00038 int code;
00039
00043 char *msg;
00044
00045 } sb_error_t;
00046
00054 enum {
00055 SB_ERROR_FILE_OPEN = -1,
00056 SB_ERROR_FILE_READ = -2,
00057 SB_ERROR_FILE_WRITE = -3,
00058 SB_ERROR_DIR_CREATE = -4,
00059 };
00060
00068 sb_error_t* sb_error_new(int code, const char *msg);
00069
00079 sb_error_t* sb_error_new_printf(int code, const char *format, ...);
00080
00086 void sb_error_free(sb_error_t *err);
00087
00090 #endif