add configured namespaces to the dav context

Sun, 21 Jul 2024 23:27:52 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 21 Jul 2024 23:27:52 +0200
changeset 823
04c60a353331
parent 822
f9e40f5c6daf
child 824
76ca3dac6506

add configured namespaces to the dav context

dav/config.c file | annotate | diff | comparison | revisions
libidav/config.c file | annotate | diff | comparison | revisions
libidav/config.h file | annotate | diff | comparison | revisions
--- a/dav/config.c	Sun Jul 21 23:19:40 2024 +0200
+++ b/dav/config.c	Sun Jul 21 23:27:52 2024 +0200
@@ -156,6 +156,10 @@
         return 1;
     }
     
+    if(dav_config_register_namespaces(davconfig, ctx)) {
+        return 1;
+    }
+    
     return dav_config_register_keys(davconfig, ctx, load_key_file);
 }
 
--- a/libidav/config.c	Sun Jul 21 23:19:40 2024 +0200
+++ b/libidav/config.c	Sun Jul 21 23:27:52 2024 +0200
@@ -818,3 +818,12 @@
     }
     return 0;
 }
+
+int dav_config_register_namespaces(DavConfig *config, DavContext *ctx) {
+    DavCfgNamespace *ns = config->namespaces;
+    while(ns) {
+        dav_add_namespace(ctx, ns->prefix.ptr, ns->uri.ptr);
+        ns = ns->next;
+    }
+    return 0;
+}
--- a/libidav/config.h	Sun Jul 21 23:19:40 2024 +0200
+++ b/libidav/config.h	Sun Jul 21 23:27:52 2024 +0200
@@ -186,6 +186,8 @@
 int dav_config_keytype(DavCfgKeyType type);
 int dav_config_register_keys(DavConfig *config, DavContext *ctx, dav_loadkeyfile_func loadkey);
 
+int dav_config_register_namespaces(DavConfig *config, DavContext *ctx);
+
 #ifdef __cplusplus
 }
 #endif

mercurial