199 |
199 |
200 int ucx_properties2map(UcxProperties *parser, CxMap *map) { |
200 int ucx_properties2map(UcxProperties *parser, CxMap *map) { |
201 cxstring name; |
201 cxstring name; |
202 cxstring value; |
202 cxstring value; |
203 while(ucx_properties_next(parser, &name, &value)) { |
203 while(ucx_properties_next(parser, &name, &value)) { |
204 cxmutstr mutvalue = cx_strdup_a(map->allocator, value); |
204 cxmutstr mutvalue = cx_strdup_a(map->collection.allocator, value); |
205 if(!mutvalue.ptr) { |
205 if(!mutvalue.ptr) { |
206 return 1; |
206 return 1; |
207 } |
207 } |
208 if(cxMapPut(map, cx_hash_key_cxstr(name), mutvalue.ptr)) { |
208 if(cxMapPut(map, cx_hash_key_cxstr(name), mutvalue.ptr)) { |
209 cxFree(map->allocator, mutvalue.ptr); |
209 cxFree(map->collection.allocator, mutvalue.ptr); |
210 return 1; |
210 return 1; |
211 } |
211 } |
212 } |
212 } |
213 if (parser->error) { |
213 if (parser->error) { |
214 return parser->error; |
214 return parser->error; |