1 /*- 2 *********************************************************************** 3 * 4 * $Id: error.h,v 1.26 2014/07/18 06:40:44 mavrik Exp $ 5 * 6 *********************************************************************** 7 * 8 * Copyright 2000-2014 The FTimes Project, All Rights Reserved. 9 * 10 *********************************************************************** 11 */ 12 #ifndef _ERROR_H_INCLUDED 13 #define _ERROR_H_INCLUDED 14 15 /*- 16 *********************************************************************** 17 * 18 * Defines 19 * 20 *********************************************************************** 21 */ 22 #define MESSAGE_SIZE 1024 23 24 #define XER_OK 0 25 #define XER_Abort 1 26 #define XER_Usage 2 27 #define XER_BootStrap 3 28 #define XER_ProcessArguments 4 29 #define XER_Initialize 5 30 #define XER_CheckDependencies 6 31 #define XER_Finalize 7 32 #define XER_WorkHorse 8 33 #define XER_FinishUp 9 34 #define XER_FinalStage 10 35 #define XER_MaxExternalErrorCode 255 36 37 #define ER -1 38 #define ER_OK 0 39 40 enum InternalErrors 41 { 42 ER_BadHandle = 256, 43 ER_BadValue, 44 ER_DoDig, 45 ER_DoDigest, 46 ER_DoXMagic, 47 ER_Failure, 48 ER_FileSystem, 49 #ifdef USE_PCRE 50 ER_Filtered, 51 #endif 52 ER_FindFirstFile, 53 ER_Header, 54 ER_InvalidSeverity, 55 #ifdef USE_PCRE 56 ER_IncompatibleOptions, 57 #endif 58 ER_Length, 59 ER_MissingControl, 60 ER_NeuterPathname, 61 ER_NothingToDo, 62 ER_NullFields, 63 ER_Overflow, 64 ER_ReadFile, 65 ER_ReadPropertiesFile, 66 ER_Special, 67 ER_URLGetRequest, 68 ER_URLPingRequest, 69 ER_URLPutRequest, 70 ER_Usage, 71 ER_Warning, 72 ER_XMagic, 73 ER_execlp, 74 ER_fgets, 75 ER_fopen, 76 ER_fread, 77 ER_lstat, 78 ER_opendir, 79 ER_readdir, 80 ER_readlink 81 }; 82 83 enum ErrorLevels 84 { 85 ERROR_WARNING, 86 ERROR_FAILURE, 87 ERROR_CRITICAL 88 }; 89 90 /*- 91 *********************************************************************** 92 * 93 * Function Prototypes 94 * 95 *********************************************************************** 96 */ 97 void ErrorFormatWin32Error(char **ppmsg); 98 int ErrorGetWarnings(void); 99 int ErrorGetFailures(void); 100 int ErrorGetWipeouts(void); 101 void ErrorHandler(int iError, char *pcError, int iSeverity); 102 #ifdef WIN32 103 void ErrorFormatWinxError(DWORD dwError, TCHAR **pptcMessage); 104 #endif 105 106 #endif /* !_ERROR_H_INCLUDED */ 107