00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __nanohttp_error_h
00025 #define __nanohttp_error_h
00026
00063 #define H_OK 0
00064
00070 #define GENERAL_ERROR 1400
00071 #define GENERAL_INVALID_PARAM (GENERAL_ERROR + 1)
00072 #define GENERAL_HEADER_PARSE_ERROR (GENERAL_ERROR + 2)
00073
00079 #define THREAD_ERROR 1500
00080 #define THREAD_BEGIN_ERROR (THREAD_ERROR)
00081
00087 #define FILE_ERROR 8000
00088 #define FILE_ERROR_OPEN (FILE_ERROR + 1)
00089 #define FILE_ERROR_READ (FILE_ERROR + 2)
00090
00098 typedef void *herror_t;
00099
00100 #ifdef __cplusplus
00101 extern "C" {
00102 #endif
00103
00111 extern herror_t herror_new(const char *func, int errcode, const char *format, ...);
00112
00118 extern int herror_code(herror_t err);
00119
00125 extern const char *herror_func(herror_t err);
00126
00132 extern const char *herror_message(herror_t err);
00133
00139 extern void herror_release(herror_t err);
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif