00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef OXS_ERROR_H
00019 #define OXS_ERROR_H
00020 
00021 
00031 #include <axis2_defines.h>
00032 #include <axutil_env.h>
00033 
00034 #ifdef __cplusplus
00035 extern "C"
00036 {
00037 #endif
00038 
00039 #if defined( WIN32 ) && (_MSC_VER < 1300)
00040 #define __FUNCTION__ NULL
00041 #endif
00042 
00043     
00044 #define FUNCTION_NAME __FUNCTION__
00045 #define LINE_NUMBER __LINE__
00046 #define FILE_NAME __FILE__
00047 
00048 #define OXS_ERROR_LOCATION FILE_NAME,LINE_NUMBER,FUNCTION_NAME
00049 
00050     
00051 #define OXS_ERROR_DEFAULT               0
00052 #define OXS_ERROR_ENCRYPT_FAILED        1
00053 #define OXS_ERROR_DECRYPT_FAILED        2
00054 #define OXS_ERROR_INVALID_DATA          3
00055 #define OXS_ERROR_INVALID_SIZE          4
00056 #define OXS_ERROR_INVALID_FORMAT        5
00057 #define OXS_ERROR_ELEMENT_FAILED        6
00058 #define OXS_ERROR_UNSUPPORTED_ALGO      7
00059 #define OXS_ERROR_CREATION_FAILED       8
00060 #define OXS_ERROR_INITIALIZATION_FAILED 9
00061 #define OXS_ERROR_DATA_CONV_FAILED     10
00062 #define OXS_ERROR_OPENSSL_FUNC_FAILED  11
00063 #define OXS_ERROR_TRANSFORM_FAILED     12
00064 #define OXS_ERROR_SIGN_FAILED          13
00065 #define OXS_ERROR_SIG_VERIFICATION_FAILED        14
00066 #define OXS_ERROR_KEY_DERIVATION_FAILED 15
00067 
00068     typedef struct _oxs_error_description oxs_error_description, *oxs_error_description_ptr;
00069 
00075     struct _oxs_error_description
00076     {
00077         int code;
00078         const char* message;
00079     };
00080 
00086     AXIS2_EXTERN const char* AXIS2_CALL
00087     oxs_errors_get_msg_by_code(int code);
00088 
00094     AXIS2_EXTERN const char* AXIS2_CALL
00095     oxs_errors_get_msg(unsigned int pos);
00096 
00102     AXIS2_EXTERN int AXIS2_CALL
00103     oxs_errors_get_code(unsigned int pos);
00104 
00114     AXIS2_EXTERN void AXIS2_CALL
00115     oxs_error(const axutil_env_t *env, const char* file, int line, const char* func,
00116               int code, const char* msg,...);
00117 
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122 
00123 #endif