*/
/*
- Copyright (C) 2003-2004 Kern Sibbald and John Walker
+ Copyright (C) 2003-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
* Loop var through each member of list
*/
#define foreach_alist(var, list) \
- for((*((void **)&(var))=(void*)((list)->first())); (var); (*((void **)&(var))=(void*)((list)->next())))
+ for((*((void **)&(var))=(void*)((list)->first())); \
+ (var); \
+ (*((void **)&(var))=(void*)((list)->next())))
#ifdef the_easy_way
#define foreach_alist(var, list) \
- for((void*(var))=(list)->first(); (var); (void *(var))=(list)->next(var)); )
+ for((void*(var))=(list)->first(); (var); (void *(var))=(list)->next(var)); )
#endif
int size() const;
void destroy();
void grow(int num);
+
+ /* Use it as a stack, pushing and poping from the end */
+ void push(void *item) { append(item); };
+ void pop() { num_items?NULL:remove(num_items-1); };
};
inline void * alist::operator [](int index) const {