ucx/properties.c

branch
dav-2
changeset 889
42cdbf9bbd49
parent 886
da79af4baec8
equal deleted inserted replaced
887:26541c37b619 889:42cdbf9bbd49
49 void cxPropertiesDestroy(CxProperties *prop) { 49 void cxPropertiesDestroy(CxProperties *prop) {
50 cxBufferDestroy(&prop->input); 50 cxBufferDestroy(&prop->input);
51 cxBufferDestroy(&prop->buffer); 51 cxBufferDestroy(&prop->buffer);
52 } 52 }
53 53
54 void cxPropertiesReset(CxProperties *prop) {
55 CxPropertiesConfig config = prop->config;
56 cxPropertiesDestroy(prop);
57 cxPropertiesInit(prop, config);
58 }
59
54 int cxPropertiesFilln( 60 int cxPropertiesFilln(
55 CxProperties *prop, 61 CxProperties *prop,
56 const char *buf, 62 const char *buf,
57 size_t len 63 size_t len
58 ) { 64 ) {
242 cxstring value 248 cxstring value
243 ) { 249 ) {
244 CxMap *map = sink->sink; 250 CxMap *map = sink->sink;
245 CxAllocator *alloc = sink->data; 251 CxAllocator *alloc = sink->data;
246 cxmutstr v = cx_strdup_a(alloc, value); 252 cxmutstr v = cx_strdup_a(alloc, value);
247 int r = cx_map_put_cxstr(map, key, v.ptr); 253 int r = cxMapPut(map, key, v.ptr);
248 if (r != 0) cx_strfree_a(alloc, &v); 254 if (r != 0) cx_strfree_a(alloc, &v);
249 return r; 255 return r;
250 } 256 }
251 257
252 CxPropertiesSink cxPropertiesMapSink(CxMap *map) { 258 CxPropertiesSink cxPropertiesMapSink(CxMap *map) {

mercurial