void vdl_list_remove (struct VdlList *list, void *data) { void **i; for (i = vdl_list_find (list, data); i != vdl_list_end (list); i = vdl_list_find_from (list, i, data)) { i = vdl_list_erase (list, i); } }
void vdl_list_unicize (struct VdlList *list) { void **i; for (i = vdl_list_begin (list); i != vdl_list_end (list); i = vdl_list_next (i)) { void *next = vdl_list_find_from (list, vdl_list_next (i), *i); while (next != vdl_list_end (list)) { next = vdl_list_erase (list, next); next = vdl_list_find_from (list, next, *i); } } }
void vdl_list_unique (struct VdlList *list) { void **i = vdl_list_begin (list); while (i != vdl_list_end (list)) { void **prev = vdl_list_prev (i); if (prev == vdl_list_end (list) || *prev != *i) { i = vdl_list_next (i); } else { i = vdl_list_erase (list, i); } } }
struct VdlList * vdl_utils_splitpath (const char *value) { struct VdlList *list = vdl_utils_strsplit (value, ':'); void **i; for (i = vdl_list_begin (list); i != vdl_list_end (list); i = vdl_list_next (list, i)) { if (vdl_utils_strisequal (*i, "")) { // the empty string is interpreted as '.' vdl_alloc_free (*i); i = vdl_list_erase (list, i); i = vdl_list_insert (list, i, vdl_utils_strdup (".")); } } return list; }
void vdl_list_pop_front (struct VdlList *list) { vdl_list_erase (list, vdl_list_begin (list)); }
void vdl_list_pop_back (struct VdlList *list) { vdl_list_erase (list, vdl_list_rbegin (list)); }