axis2_env.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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                          /* AXIS2_ENV_H */

Generated on Tue Oct 3 18:21:09 2006 for Axis2/C by  doxygen 1.4.7