00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef AXIS2_ENV_H
00019 #define AXIS2_ENV_H
00020
00027 #include <axis2_allocator.h>
00028 #include <axis2_error.h>
00029 #include <axis2_log.h>
00030 #include <axis2_thread_pool.h>
00031
00032 #ifdef __cplusplus
00033 extern "C"
00034 {
00035 #endif
00036
00044 struct axis2_env;
00045 struct axis2_env_ops;
00046
00059 typedef struct axis2_env
00060 {
00062 axis2_allocator_t *allocator;
00064 axis2_error_t *error;
00066 axis2_log_t *log;
00068 axis2_bool_t log_enabled;
00070 axis2_thread_pool_t *thread_pool;
00071 } axis2_env_t;
00072
00080 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_all (const axis2_char_t *log_file,
00081 const axis2_log_levels_t log_level);
00082
00089 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create (axis2_allocator_t
00090 *allocator);
00091
00099 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_with_error
00100 (axis2_allocator_t *allocator
00101 , axis2_error_t *error);
00102
00111 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_with_error_log
00112 (axis2_allocator_t *allocator
00113 , axis2_error_t *error
00114 , axis2_log_t *log);
00115
00125 AXIS2_EXTERN axis2_env_t * AXIS2_CALL axis2_env_create_with_error_log_thread_pool
00126 (axis2_allocator_t *allocator
00127 , axis2_error_t *error
00128 , axis2_log_t *log
00129 , axis2_thread_pool_t *pool);
00130
00139 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_free (axis2_env_t *env);
00140
00152 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_free_masked(axis2_env_t *env, char mask);
00156 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_enable_log (axis2_env_t *env, axis2_bool_t enable);
00157
00161 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_check_status (const axis2_env_t *env);
00162
00166 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_env_write_log (const axis2_env_t *env, const char* message, axis2_log_levels_t level);
00167 #define AXIS2_LOG(env, message, level) axis2_env_write_log (env,message, level)
00168
00169
00170
00171 #define AXIS2_ENV_CHECK(env, error_return) \
00172 if(!env) \
00173 { \
00174 return error_return; \
00175 }
00176
00179 #ifdef __cplusplus
00180 }
00181 #endif
00182
00183 #endif