00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_ENV_H
00018 #define AXIS2_ENV_H
00019
00026 #include <axis2_allocator.h>
00027 #include <axis2_error.h>
00028 #include <axis2_log.h>
00029 #include <axis2_thread_pool.h>
00030
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035
00043 struct axis2_env;
00044 struct axis2_env_ops;
00045
00058 typedef struct axis2_env
00059 {
00061 axis2_allocator_t *allocator;
00063 axis2_error_t *error;
00065 axis2_log_t *log;
00067 axis2_bool_t log_enabled;
00069 axis2_thread_pool_t *thread_pool;
00070 } axis2_env_t;
00071
00079 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_all (const axis2_char_t *log_file,
00080 const axis2_log_levels_t log_level);
00081
00088 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create (axis2_allocator_t
00089 *allocator);
00090
00098 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_with_error
00099 (axis2_allocator_t *allocator
00100 , axis2_error_t *error);
00101
00110 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_with_error_log
00111 (axis2_allocator_t *allocator
00112 , axis2_error_t *error
00113 , axis2_log_t *log);
00114
00124 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_with_error_log_thread_pool
00125 (axis2_allocator_t *allocator
00126 , axis2_error_t *error
00127 , axis2_log_t *log
00128 , axis2_thread_pool_t *pool);
00129
00138 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_free (axis2_env_t *env);
00139
00151 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_free_masked(axis2_env_t *env, char mask);
00155 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_enable_log (axis2_env_t *env, axis2_bool_t enable);
00156
00160 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_check_status (const axis2_env_t *env);
00161
00165 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_write_log (const axis2_env_t *env, const char* message, axis2_log_levels_t level);
00166 #define AXIS2_LOG(env, message, level) axis2_env_write_log (env,message, level)
00167
00168
00169
00170 #define AXIS2_ENV_CHECK(env, error_return) \
00171 if(!env) \
00172 { \
00173 return error_return; \
00174 }
00175
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181
00182 #endif