18 lines
321 B
C
18 lines
321 B
C
#ifndef _SPHO_UTIL_H
|
|
#define _SPHO_UTIL_H
|
|
|
|
|
|
#define SPHO_UTIL_SLIST_DESTROY(l, elmtype, next, term) \
|
|
do { \
|
|
struct elmtype *elm; \
|
|
while (! SLIST_EMPTY(l)) { \
|
|
elm = SLIST_FIRST(l); \
|
|
SLIST_REMOVE_HEAD(l, next); \
|
|
term(elm); \
|
|
free(elm); \
|
|
} \
|
|
} while (0)
|
|
|
|
|
|
#endif
|
|
|