axis2_properties.h

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_PROPERTIES_H
00019 #define AXIS2_PROPERTIES_H
00020 
00021 #include <axis2_utils_defines.h>
00022 #include <axis2_error.h>
00023 #include <axis2_env.h>
00024 #include <axis2_hash.h>
00025 #include <stdio.h>
00026 
00027 #ifdef __cplusplus
00028 extern "C"
00029 {
00030 #endif
00031     
00032 typedef struct axis2_properties axis2_properties_t;
00033 typedef struct axis2_properties_ops axis2_properties_ops_t;
00034     
00045  struct axis2_properties_ops
00046 {
00054     axis2_status_t (AXIS2_CALL *
00055     free) (axis2_properties_t *properties, 
00056             const axis2_env_t *env);
00057 
00065     axis2_char_t* (AXIS2_CALL *
00066     get_property) (axis2_properties_t *properties,
00067                 const axis2_env_t *env,
00068                 axis2_char_t *key);
00078     axis2_status_t (AXIS2_CALL *
00079     set_property) (axis2_properties_t *properties,
00080                  const axis2_env_t *env,
00081                  axis2_char_t *key,
00082                  axis2_char_t *value);
00089     axis2_hash_t* (AXIS2_CALL *
00090     get_all)( axis2_properties_t *properties,
00091                 const axis2_env_t *env);
00092 
00101     axis2_status_t (AXIS2_CALL *
00102     load)(axis2_properties_t *properties,
00103                  const axis2_env_t *env,
00104                  axis2_char_t *input_filename);
00105   
00114     axis2_status_t (AXIS2_CALL *
00115     store)(axis2_properties_t *properites,
00116                 const axis2_env_t *env,
00117                 FILE *output);
00118 };
00119     
00120      
00124  struct axis2_properties
00125 {
00126    axis2_properties_ops_t *ops;
00127 };
00128 
00133 AXIS2_EXTERN axis2_properties_t * AXIS2_CALL
00134 axis2_properties_create(const axis2_env_t *env);
00135 
00136 /*************************** Function macros **********************************/
00137 
00138 #define AXIS2_PROPERTIES_FREE(properties, env) \
00139       ((properties)->ops->free (properties, env))
00140 
00141 #define AXIS2_PROPERTIES_GET_PROPERTY(properties, env, key) \
00142       ((properties)->ops->get_property(properties, env, key))  
00143 
00144 #define AXIS2_PROPERTIES_SET_PROPERTY(properties, env, key, value) \
00145       ((properties)->ops->set_property(properties, env, key, value))  
00146 
00147 #define AXIS2_PROPERTIES_GET_ALL(properties, env) \
00148       ((properties)->ops->get_all(properties, env))  
00149 
00150 #define AXIS2_PROPERTIES_LOAD(properties, env, input) \
00151       ((properties)->ops->load(properties, env, input)) 
00152 
00153 #define AXIS2_PROPERTIES_STORE(properties, env, output) \
00154       ((properties)->ops->store(properties, env, output))
00155          
00156 /*************************** End of function macros ***************************/
00157 
00158 
00159 
00162 #ifdef __cplusplus
00163 }
00164 #endif
00165 
00166 #endif  /* AXIS2_PROPERTIES_H */

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