axutil_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 AXUTIL_ENV_H
00019 #define AXUTIL_ENV_H
00020 
00027 #include <axutil_allocator.h>
00028 #include <axutil_error.h>
00029 #include <axutil_log.h>
00030 #include <axutil_thread_pool.h>
00031 
00032 #ifdef __cplusplus
00033 extern "C"
00034 {
00035 #endif
00036 
00044     struct axutil_env;
00045     struct axutil_env_ops;
00046 
00059     typedef struct axutil_env
00060     {
00061 
00063         axutil_allocator_t *allocator;
00064 
00066         axutil_error_t *error;
00067 
00069         axutil_log_t *log;
00070 
00072         axis2_bool_t log_enabled;
00073 
00075         axutil_thread_pool_t *thread_pool;
00076 
00077         int ref;
00078     }
00079     axutil_env_t;
00080 
00088     AXIS2_EXTERN axutil_env_t *AXIS2_CALL
00089     axutil_env_create(
00090         axutil_allocator_t * allocator);
00091 
00100     AXIS2_EXTERN axutil_env_t *AXIS2_CALL
00101     axutil_env_create_all(
00102         const axis2_char_t * log_file,
00103         const axutil_log_levels_t log_level);
00104 
00105 
00112     AXIS2_EXTERN axutil_env_t *AXIS2_CALL
00113     axutil_env_create_with_error(
00114         axutil_allocator_t * allocator,
00115         axutil_error_t * error);
00116 
00125     AXIS2_EXTERN axutil_env_t *AXIS2_CALL
00126     axutil_env_create_with_error_log(
00127         axutil_allocator_t * allocator,
00128         axutil_error_t * error,
00129         axutil_log_t * log);
00130 
00140     AXIS2_EXTERN axutil_env_t *AXIS2_CALL
00141     axutil_env_create_with_error_log_thread_pool(
00142         axutil_allocator_t * allocator,
00143         axutil_error_t * error,
00144         axutil_log_t * log,
00145         axutil_thread_pool_t * pool);
00146 
00154     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00155     axutil_env_enable_log(
00156         axutil_env_t * env,
00157         axis2_bool_t enable);
00158 
00165     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00166     axutil_env_check_status(
00167         const axutil_env_t * env);
00168 
00174     AXIS2_EXTERN void AXIS2_CALL
00175     axutil_env_free(
00176         axutil_env_t * env);
00177 
00178 
00179     #define AXIS_ENV_FREE_LOG        0x1
00180     #define AXIS_ENV_FREE_ERROR      0x2
00181     #define AXIS_ENV_FREE_THREADPOOL 0x4
00182 
00195     AXIS2_EXTERN void AXIS2_CALL
00196     axutil_env_free_masked(
00197         axutil_env_t * env,
00198         char mask);
00199 
00207     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00208     axutil_env_increment_ref(
00209         axutil_env_t * env);
00210     
00211 
00212 
00213 /* AXIS2_ENV_CHECK is a macro to check environment pointer.
00214    Currently this is set to an empty value.
00215    But it was used to be defined as:
00216    #define AXIS2_ENV_CHECK(env, error_return) \
00217        if(!env) \
00218        { \
00219            return error_return; \
00220        }
00221 */
00222 #define AXIS2_ENV_CHECK(env, error_return)
00223 
00226 #ifdef __cplusplus
00227 }
00228 #endif
00229 
00230 #endif                          /* AXIS2_ENV_H */

Generated on Fri Apr 17 11:49:42 2009 for Axis2/C by  doxygen 1.5.3