src/linked_list.c

changeset 1605
55b13f583356
parent 1534
38d3f40a50ec
equal deleted inserted replaced
1604:68b75c091028 1605:55b13f583356
1270 cx_ll_iterator, 1270 cx_ll_iterator,
1271 }; 1271 };
1272 1272
1273 CxList *cxLinkedListCreate( 1273 CxList *cxLinkedListCreate(
1274 const CxAllocator *allocator, 1274 const CxAllocator *allocator,
1275 cx_compare_func comparator,
1276 size_t elem_size 1275 size_t elem_size
1277 ) { 1276 ) {
1278 if (allocator == NULL) { 1277 if (allocator == NULL) {
1279 allocator = cxDefaultAllocator; 1278 allocator = cxDefaultAllocator;
1280 } 1279 }
1285 list->loc_next = sizeof(void*); 1284 list->loc_next = sizeof(void*);
1286 list->loc_data = sizeof(void*)*2; 1285 list->loc_data = sizeof(void*)*2;
1287 list->loc_extra = -1; 1286 list->loc_extra = -1;
1288 list->extra_data_len = 0; 1287 list->extra_data_len = 0;
1289 cx_list_init((CxList*)list, &cx_linked_list_class, 1288 cx_list_init((CxList*)list, &cx_linked_list_class,
1290 allocator, comparator, elem_size); 1289 allocator, elem_size);
1291 1290
1292 return (CxList *) list; 1291 return (CxList *) list;
1293 } 1292 }
1294 1293
1295 void cx_linked_list_extra_data(cx_linked_list *list, size_t len) { 1294 void cx_linked_list_extra_data(cx_linked_list *list, size_t len) {

mercurial