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 
00027 #include <axis2_defines.h>
00028 #include <axis2_env.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif
00034 
00035 /*Macros for locating thr error*/
00036 #define FUNCTION_NAME __FUNCTION__
00037 #define LINE_NUMBER __LINE__
00038 #define FILE_NAME __FILE__
00039 
00040 #define ERROR_LOCATION FILE_NAME,LINE_NUMBER,FUNCTION_NAME
00041 
00042 /*Error codes*/
00043 #define OXS_ERROR_DEFAULT               0
00044 #define OXS_ERROR_ENCRYPT_FAILED        1
00045 #define OXS_ERROR_DECRYPT_FAILED        2
00046 #define OXS_ERROR_INVALID_DATA          3
00047 #define OXS_ERROR_INVALID_SIZE          4
00048 #define OXS_ERROR_INVALID_FORMAT        5
00049 #define OXS_ERROR_ELEMENT_FAILED        6
00050 #define OXS_ERROR_UNSUPPORTED_ALGO      7
00051 #define OXS_ERROR_CREATION_FAILED       8
00052 #define OXS_ERROR_INITIALIZATION_FAILED 9
00053 #define OXS_ERROR_DATA_CONV_FAILED     10
00054 #define OXS_ERROR_OPENSSL_FUNC_FAILED  11
00055 
00056 
00057 typedef struct _oxs_error_description oxs_error_description, *oxs_error_description_ptr;
00058 
00064 struct _oxs_error_description
00065 {
00066     int code;
00067     const char* message;
00068 };
00069 
00075 AXIS2_EXTERN const char* AXIS2_CALL
00076 oxs_errors_get_msg_by_code(int code);
00077 
00083 AXIS2_EXTERN const char* AXIS2_CALL
00084 oxs_errors_get_msg(unsigned int pos);
00085 
00091 AXIS2_EXTERN int AXIS2_CALL
00092 oxs_errors_get_code(unsigned int pos);
00093 
00103 AXIS2_EXTERN void AXIS2_CALL
00104 oxs_error(const char* file, int line, const char* func,
00105         int code, const char* msg,...);
00106 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 
00112 #endif                          /* OXS_ERROR_H */

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1