--- a/libidav/resource.c Mon Sep 08 11:39:54 2025 +0200 +++ b/libidav/resource.c Mon Sep 08 12:10:13 2025 +0200 @@ -281,6 +281,18 @@ return resource->href; } +CxHashKey dav_resource_path_key(DavResource *res) { + CxHashKey key = { NULL, 0, 0 }; + if(res && res->path) { + cxstring res_path = cx_str(res->path); + if(res_path.length > 0 && res_path.ptr[res_path.length-1] == '/') { + res_path.length--; + } + key = cx_hash_key(res_path.ptr, res_path.length); + } + return key; +} + CxTreeIterator dav_resource_iterator(DavResource *res) { return cx_tree_iterator(res, FALSE, offsetof(DavResource, children), offsetof(DavResource, next)); }