libidav/config.h

changeset 796
81e0f67386a6
parent 795
05647e862a17
equal deleted inserted replaced
795:05647e862a17 796:81e0f67386a6
46 typedef struct CfgInt CfgInt; 46 typedef struct CfgInt CfgInt;
47 typedef struct CfgUInt CfgUInt; 47 typedef struct CfgUInt CfgUInt;
48 typedef struct CfgBool CfgBool; 48 typedef struct CfgBool CfgBool;
49 49
50 typedef enum dav_cfg_key_type DavCfgKeyType; 50 typedef enum dav_cfg_key_type DavCfgKeyType;
51
52 typedef cxmutstr (*dav_loadkeyfile_func)(const char *filename);
51 53
52 #define DAV_HTTP_PROXY 1 54 #define DAV_HTTP_PROXY 1
53 #define DAV_HTTPS_PROXY 2 55 #define DAV_HTTPS_PROXY 2
54 56
55 enum dav_cfg_key_type { 57 enum dav_cfg_key_type {
158 DAV_CONFIG_ERROR_XML = 0 160 DAV_CONFIG_ERROR_XML = 0
159 }; 161 };
160 162
161 DavConfig* dav_config_load(cxmutstr xmlfilecontent, int *error); 163 DavConfig* dav_config_load(cxmutstr xmlfilecontent, int *error);
162 164
165 void dav_config_free(DavConfig *config);
166
163 CxBuffer* dav_config2buf(DavConfig *config); 167 CxBuffer* dav_config2buf(DavConfig *config);
164 168
165 void dav_config_add_repository(DavConfig *config, DavCfgRepository *repo); 169 void dav_config_add_repository(DavConfig *config, DavCfgRepository *repo);
166 170
167 DavCfgRepository* dav_repository_new(DavConfig *config); 171 DavCfgRepository* dav_repository_new(DavConfig *config);
177 181
178 DavCfgRepository* dav_config_get_repository(DavConfig *config, cxstring name); 182 DavCfgRepository* dav_config_get_repository(DavConfig *config, cxstring name);
179 DavCfgRepository* dav_config_url2repo(DavConfig *config, const char *url, char **path); 183 DavCfgRepository* dav_config_url2repo(DavConfig *config, const char *url, char **path);
180 DavCfgRepository* dav_config_url2repo_s(DavConfig *config, cxstring url, cxmutstr *path); 184 DavCfgRepository* dav_config_url2repo_s(DavConfig *config, cxstring url, cxmutstr *path);
181 185
186 int dav_config_keytype(DavCfgKeyType type);
187 int dav_config_register_keys(DavConfig *config, DavContext *ctx, dav_loadkeyfile_func loadkey);
182 188
183 #ifdef __cplusplus 189 #ifdef __cplusplus
184 } 190 }
185 #endif 191 #endif
186 192

mercurial