Ignore:
Timestamp:
Apr 30, 2007, 12:28:55 AM (13 years ago)
Author:
Bruno Cornec
Message:

Update for the mr_list structure to have a pointer on function to remove data allocated in the structure mr_list_elt in the data field.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/lib/mr_list.c

    r1361 r1363  
    2121
    2222/* Elt of list allocation and initialization */
    23 void mr_list_alloc_elt(struct mr_list_elt *elt, void *data) {
     23void mr_list_alloc_elt(struct mr_list_elt *elt, void *data, void (*mr_free_data)(void *data)) {
    2424
    2525    elt = mr_malloc(sizeof(struct mr_list_elt));
     26    elt->mr_free_data = mr_free_data;
    2627    elt->data = (void *)data;
    2728    elt->prev = NULL;
     
    3031
    3132void mr_list_free_elt(struct mr_list_elt *elt) {
     33    elt->mr_free_data(elt->data);
    3234    mr_free(elt->data);
    3335    mr_free(elt);
Note: See TracChangeset for help on using the changeset viewer.