/*#*
*#* $Log$
+ *#* Revision 1.12 2005/01/22 04:21:32 bernie
+ *#* Add integrity checks.
+ *#*
+ *#* Revision 1.11 2004/12/31 16:44:11 bernie
+ *#* list_remHead(), list_remTail(): Name like normal functions.
+ *#*
*#* Revision 1.10 2004/11/28 23:21:05 bernie
*#* Remove obsolete INITLIST macro.
*#*
(l)->tail = (Node *)(&(l)->head); \
} while (0)
+/* Make sure that a list is valid (it was initialized and is not corrupted) */
+#ifdef _DEBUG
+ #define LIST_ASSERT_VALID(l) \
+ do { \
+ Node *n, *pred; \
+ ASSERT((l)->head != NULL); \
+ ASSERT((l)->null == NULL); \
+ ASSERT((l)->tail != NULL); \
+ pred = (Node *)(&(l)->head); \
+ FOREACHNODE(n, l) \
+ { \
+ ASSERT(n->pred == pred); \
+ pred = n; \
+ } \
+ ASSERT(n == (Node *)(&(l)->null)); \
+ } while (0)
+#else
+ #define LIST_ASSERT_VALID(l) do {} while (0)
+#endif
+
/*! Add node to list head. */
#define ADDHEAD(l,n) \
do { \
*
* \return Pointer to node, or NULL if the list was empty.
*/
-INLINE Node *REMHEAD(List *l)
+INLINE Node *list_remHead(List *l)
{
Node *n;
*
* \return Pointer to node, or NULL if the list was empty.
*/
-INLINE Node *REMTAIL(List *l)
+INLINE Node *list_remTail(List *l)
{
Node *n;
return n;
}
+/* OBSOLETE names */
+#define REMHEAD list_remHead
+#define REMTAIL list_remTail
+
#endif /* MWARE_LIST_H */