From ef8bbd2ac496604df949e0bce978a3c53dbaede3 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Thu, 5 Jan 2006 21:29:36 +0000 Subject: various code cleanup --- src/pacman/list.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/pacman/list.h') diff --git a/src/pacman/list.h b/src/pacman/list.h index 79a4a3c0..ba72d784 100644 --- a/src/pacman/list.h +++ b/src/pacman/list.h @@ -30,6 +30,14 @@ typedef struct __list_t { } list_t; #define FREELIST(p) do { if(p) { list_free(p); p = NULL; } } while(0) +#define FREELISTPTR(p) do { \ + list_t *i; \ + for(i = p; i; i = i->next) { \ + i->data = NULL; \ + } \ + FREELIST(p); \ +} while(0) + list_t *list_new(void); void list_free(list_t* list); -- cgit v1.2.3-70-g09d2