index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2007-01-24 08:51:50 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-01-24 08:51:50 +0000 |
commit | 170d63190a3cfb0c12ee9ddfe07b21f20825bd6f (patch) | |
tree | c1cad21e75daf695f61f83ca1072d0a52343a673 /lib/libalpm/alpm_list.h | |
parent | 1b61cc8c69025ddd394401a506b21f16df5d4e6d (diff) |
-rw-r--r-- | lib/libalpm/alpm_list.h | 13 |
diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h index df19c9e9..5bad4dc2 100644 --- a/lib/libalpm/alpm_list.h +++ b/lib/libalpm/alpm_list.h @@ -30,18 +30,18 @@ struct __alpm_list_t { struct __alpm_list_t *next; }; -/* TODO we should do away with these... they're messy */ -#define _FREELIST(p, f) do { if(p) { alpm_list_free(p, f); p = NULL; } } while(0) -#define FREELIST(p) _FREELIST(p, free) -#define FREELISTPTR(p) _FREELIST(p, NULL) +/* TODO we should do away with these... they're messy*/ +#define _FREELIST(p, f) do { alpm_list_free_inner(p, f); alpm_list_free(p); p = NULL; } while(0) +#define FREELIST(p) _FREELIST(p, free) +#define FREELISTPTR(p) do { alpm_list_free(p); p = NULL; } while(0) typedef void (*alpm_list_fn_free)(void *); /* item deallocation callback */ typedef int (*alpm_list_fn_cmp)(const void *, const void *); /* item comparison callback */ /* allocation */ alpm_list_t *alpm_list_new(void); -void alpm_list_free(alpm_list_t *list, alpm_list_fn_free fn); -void alpm_list_free_outer(alpm_list_t *list); +void alpm_list_free(alpm_list_t *list); +void alpm_list_free_inner(alpm_list_t *list, alpm_list_fn_free fn); /* item mutators */ alpm_list_t *alpm_list_add(alpm_list_t *list, void *data); @@ -49,6 +49,7 @@ alpm_list_t *alpm_list_add_sorted(alpm_list_t *list, void *data, alpm_list_fn_cm alpm_list_t* alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, alpm_list_fn_cmp fn); alpm_list_t* alpm_list_msort(alpm_list_t *list, int n, alpm_list_fn_cmp fn); alpm_list_t *alpm_list_remove(alpm_list_t *haystack, void *needle, alpm_list_fn_cmp fn, void **data); +alpm_list_t *alpm_list_remove_node(alpm_list_t *node); alpm_list_t *alpm_list_remove_dupes(alpm_list_t *list); alpm_list_t *alpm_list_strdup(alpm_list_t *list); alpm_list_t *alpm_list_reverse(alpm_list_t *list); |