00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
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
00157
00158
00159
00162 #ifdef __cplusplus
00163 }
00164 #endif
00165
00166 #endif