diff -r 3cbe57eeaed1 -r 755b8198b071 libidav/resource.c --- a/libidav/resource.c Tue Sep 05 16:03:48 2017 +0200 +++ b/libidav/resource.c Tue Sep 05 17:25:09 2017 +0200 @@ -569,6 +569,31 @@ return ret; } +int dav_load_prop(DavResource *res, DavPropName *properties, size_t numprop) { + UcxMempool *mp = ucx_mempool_new(64); + + UcxList *proplist = NULL; + for(size_t i=0;iname = properties[i].name; + p->ns = ucx_mempool_malloc(mp, sizeof(DavNamespace)); + p->ns->name = properties[i].ns; + if(!strcmp(properties[i].ns, "DAV:")) { + p->ns->prefix = "D"; + } else { + p->ns->prefix = ucx_asprintf(mp->allocator, "x%d", i).ptr; + } + p->value = NULL; + proplist = ucx_list_append_a(mp->allocator, proplist, p); + } + + UcxBuffer *rqbuf = create_propfind_request(res->session, proplist); + int ret = dav_propfind(res->session, res, rqbuf); + ucx_buffer_free(rqbuf); + ucx_mempool_destroy(mp); + return ret; +} + int dav_store(DavResource *res) { DavSession *sn = res->session; DavResourceData *data = res->data;