libidav/resource.c

branch
dav-2
changeset 882
86e61b4ef708
parent 881
64989511f6c3
child 886
da79af4baec8
equal deleted inserted replaced
881:64989511f6c3 882:86e61b4ef708
279 resource->path); 279 resource->path);
280 } 280 }
281 return resource->href; 281 return resource->href;
282 } 282 }
283 283
284 CxHashKey dav_resource_path_key(DavResource *res) {
285 CxHashKey key = { NULL, 0, 0 };
286 if(res && res->path) {
287 cxstring res_path = cx_str(res->path);
288 if(res_path.length > 0 && res_path.ptr[res_path.length-1] == '/') {
289 res_path.length--;
290 }
291 key = cx_hash_key(res_path.ptr, res_path.length);
292 }
293 return key;
294 }
295
284 CxTreeIterator dav_resource_iterator(DavResource *res) { 296 CxTreeIterator dav_resource_iterator(DavResource *res) {
285 return cx_tree_iterator(res, FALSE, offsetof(DavResource, children), offsetof(DavResource, next)); 297 return cx_tree_iterator(res, FALSE, offsetof(DavResource, children), offsetof(DavResource, next));
286 } 298 }
287 299
288 CxTreeVisitor dav_resource_visitor(DavResource *res) { 300 CxTreeVisitor dav_resource_visitor(DavResource *res) {

mercurial