axutil_utils.h

Go to the documentation of this file.
00001 
00002 /*
00003  * Licensed to the Apache Software Foundation (ASF) under one or more
00004  * contributor license agreements.  See the NOTICE file distributed with
00005  * this work for additional information regarding copyright ownership.
00006  * The ASF licenses this file to You under the Apache License, Version 2.0
00007  * (the "License"); you may not use this file except in compliance with
00008  * the License.  You may obtain a copy of the License at
00009  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 
00019 #ifndef AXUTIL_UTILS_H
00020 #define AXUTIL_UTILS_H
00021 
00022 #include <axutil_utils_defines.h>
00023 #include <axutil_error.h>
00024 #include <axutil_env.h>
00025 #include <axutil_date_time.h>
00026 #include <axutil_base64_binary.h>
00027 
00028 #ifdef __cplusplus
00029 extern "C"
00030 {
00031 #endif
00032 
00043 #define AXUTIL_LOG_FILE_SIZE 1024 * 1024 * 32
00044 #define AXUTIL_LOG_FILE_NAME_SIZE 512
00045 
00056 #define AXIS2_FUNC_PARAM_CHECK(object, env, error_return)               \
00057     if (!object)                                                        \
00058     {                                                                   \
00059         AXIS2_ERROR_SET_ERROR_NUMBER(env->error, AXIS2_ERROR_INVALID_NULL_PARAM); \
00060         AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_FAILURE);         \
00061         return error_return;                                            \
00062     }                                                                   \
00063     else                                                                \
00064     {                                                                   \
00065         AXIS2_ERROR_SET_STATUS_CODE(env->error, AXIS2_SUCCESS);              \
00066     }
00067 
00068 
00078 #define AXIS2_PARAM_CHECK(error, object, error_return)                  \
00079     if (!object)                                                        \
00080     {                                                                   \
00081         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
00082         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
00083         return error_return;                                            \
00084     }                                                                   \
00085     else                                                                \
00086     {                                                                   \
00087         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_SUCCESS);              \
00088     }
00089 
00090 
00091 
00092 #define AXIS2_PARAM_CHECK_VOID(error, object)                           \
00093     if (!object)                                                        \
00094     {                                                                   \
00095         AXIS2_ERROR_SET_ERROR_NUMBER(error, AXIS2_ERROR_INVALID_NULL_PARAM); \
00096         AXIS2_ERROR_SET_STATUS_CODE(error, AXIS2_FAILURE);              \
00097         return;                                                         \
00098     }
00099 
00100 
00101 
00110 #define AXIS2_ERROR_SET(error, error_number, status_code)   \
00111     {                                                       \
00112         AXIS2_ERROR_SET_ERROR_NUMBER(error, error_number);  \
00113         AXIS2_ERROR_SET_STATUS_CODE(error, status_code);    \
00114     }
00115 
00118 #define AXIS2_CREATE_FUNCTION "axis2_get_instance"
00119 #define AXIS2_DELETE_FUNCTION "axis2_remove_instance"
00120 
00121     typedef void(
00122         AXIS2_CALL
00123         * AXIS2_FREE_VOID_ARG)(
00124             void *obj_to_be_freed,
00125             const axutil_env_t * env);
00126 
00127     /* Function pointer typedef for read callback */
00128     typedef int(
00129         AXIS2_CALL
00130         * AXIS2_READ_INPUT_CALLBACK)(
00131             char *buffer,
00132             int size,
00133             void *ctx);
00134 
00135     /* Function pointer typedef for close callback */
00136     typedef int(
00137         AXIS2_CALL
00138         * AXIS2_CLOSE_INPUT_CALLBACK)(
00139             void *ctx);
00140 
00146     enum axis2_scopes
00147     {
00148 
00150         AXIS2_SCOPE_REQUEST = 0,
00151 
00153         AXIS2_SCOPE_SESSION,
00154 
00156         AXIS2_SCOPE_APPLICATION
00157     };
00158 
00159 #define AXIS2_TARGET_EPR "target_epr"
00160 #define AXIS2_DUMP_INPUT_MSG_TRUE "dump"
00161 
00171     AXIS2_EXTERN axis2_char_t **AXIS2_CALL
00172 
00173     axutil_parse_request_url_for_svc_and_op(
00174         const axutil_env_t * env,
00175         const axis2_char_t * request);
00176 
00190     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00191     axutil_xml_quote_string(
00192         const axutil_env_t * env,
00193         const axis2_char_t * s,
00194         axis2_bool_t quotes);
00195 
00196     AXIS2_EXTERN int AXIS2_CALL
00197     axutil_hexit(axis2_char_t c);
00198 
00199     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00200     axutil_url_decode(
00201         const axutil_env_t * env,
00202         axis2_char_t * dest,
00203         axis2_char_t * src);
00204 
00207 #ifdef __cplusplus
00208 }
00209 #endif
00210 
00211 #endif                          /* AXIS2_UTILS_H */

Generated on Tue Jan 8 01:28:17 2008 for Axis2/C by  doxygen 1.5.1