axis2_env.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 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                          /* AXIS2_ENV_H */

Generated on Wed Dec 20 20:34:49 2006 for Axis2/C by  doxygen 1.5.1