| 282 assert(prop->text_pos == prop->text_size); |
282 assert(prop->text_pos == prop->text_size); |
| 283 return CX_PROPERTIES_NO_DATA; |
283 return CX_PROPERTIES_NO_DATA; |
| 284 } |
284 } |
| 285 |
285 |
| 286 static int cx_properties_sink_map( |
286 static int cx_properties_sink_map( |
| 287 __attribute__((__unused__)) CxProperties *prop, |
287 cx_attr_unused CxProperties *prop, |
| 288 CxPropertiesSink *sink, |
288 CxPropertiesSink *sink, |
| 289 cxstring key, |
289 cxstring key, |
| 290 cxstring value |
290 cxstring value |
| 291 ) { |
291 ) { |
| 292 CxMap *map = sink->sink; |
292 CxMap *map = sink->sink; |
| 320 } |
320 } |
| 321 return 0; |
321 return 0; |
| 322 } |
322 } |
| 323 |
323 |
| 324 static int cx_properties_read_file( |
324 static int cx_properties_read_file( |
| 325 __attribute__((__unused__)) CxProperties *prop, |
325 cx_attr_unused CxProperties *prop, |
| 326 CxPropertiesSource *src, |
326 CxPropertiesSource *src, |
| 327 cxstring *target |
327 cxstring *target |
| 328 ) { |
328 ) { |
| 329 target->ptr = src->data_ptr; |
329 target->ptr = src->data_ptr; |
| 330 target->length = fread(src->data_ptr, 1, src->data_size, src->src); |
330 target->length = fread(src->data_ptr, 1, src->data_size, src->src); |
| 331 return ferror(src->src); |
331 return ferror(src->src); |
| 332 } |
332 } |
| 333 |
333 |
| 334 static int cx_properties_read_init_file( |
334 static int cx_properties_read_init_file( |
| 335 __attribute__((__unused__)) CxProperties *prop, |
335 cx_attr_unused CxProperties *prop, |
| 336 CxPropertiesSource *src |
336 CxPropertiesSource *src |
| 337 ) { |
337 ) { |
| 338 src->data_ptr = malloc(src->data_size); |
338 src->data_ptr = malloc(src->data_size); |
| 339 if (src->data_ptr == NULL) return 1; |
339 if (src->data_ptr == NULL) return 1; |
| 340 return 0; |
340 return 0; |
| 341 } |
341 } |
| 342 |
342 |
| 343 static void cx_properties_read_clean_file( |
343 static void cx_properties_read_clean_file( |
| 344 __attribute__((__unused__)) CxProperties *prop, |
344 cx_attr_unused CxProperties *prop, |
| 345 CxPropertiesSource *src |
345 CxPropertiesSource *src |
| 346 ) { |
346 ) { |
| 347 free(src->data_ptr); |
347 free(src->data_ptr); |
| 348 } |
348 } |
| 349 |
349 |