# oxs_error.h

Go to the documentation of this file.

    00001 /*
    00002  * Licensed to the Apache Software Foundation (ASF) under one or more
    00003  * contributor license agreements.  See the NOTICE file distributed with
    00004  * this work for additional information regarding copyright ownership.
    00005  * The ASF licenses this file to You under the Apache License, Version 2.0
    00006  * (the "License"); you may not use this file except in compliance with
    00007  * the License.  You may obtain a copy of the License at
    00008  *
    00009  *      http://www.apache.org/licenses/LICENSE-2.0
    00010  *
    00011  * Unless required by applicable law or agreed to in writing, software
    00012  * distributed under the License is distributed on an "AS IS" BASIS,
    00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00014  * See the License for the specific language governing permissions and
    00015  * limitations under the License.
    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     /*Macros for locating thr error*/
    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     /*Error codes*/
    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                          /* OXS_ERROR_H */