OSSP CVS Repository

ossp - Difference in ossp-pkg/sio/al.c versions 1.18 and 1.19
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sio/al.c 1.18 -> 1.19

--- al.c 2002/10/17 15:02:49     1.18
+++ al.c 2002/10/18 08:58:19     1.19
@@ -36,138 +36,7 @@
 #include <stdio.h>
 #endif
 
-/****************************************************************************/
-
-#define LIST(elem) \
-    struct { elem *head, *tail; }
-#define NODE(elem) \
-    struct { elem *next, *prev; }
-
-#define HEAD(q,l)       ((q)->l.head)
-#define TAIL(q,l)       ((q)->l.tail)
-#define NEXT(n,l)       ((n)->l.next)
-#define PREV(n,l)       ((n)->l.prev)
-
-#define ISEMPTY(q,l)    (HEAD(q,l) == NULL)
-
-#define LISTINIT(q,l) \
-do { \
-    HEAD(q,l) = NULL; \
-    TAIL(q,l) = NULL;  \
-} while(0)
-
-#define NODEINIT(n,l) \
-do { \
-    NEXT(n,l) = NULL; \
-    PREV(n,l) = NULL; \
-} while(0)
-
-#define ADDTAIL(q,l,n) \
-do { \
-    if (TAIL(q,l)) { \
-        NEXT(TAIL(q,l),l) = (n); \
-        PREV(n,l) = TAIL(q,l); \
-    } else { \
-        PREV(n,l) = NULL; \
-        HEAD(q,l) = (n); \
-    } \
-    TAIL(q,l) = (n); \
-    NEXT(n,l) = NULL; \
-} while (0)
-
-#define ADDHEAD(q,l,n) \
-do { \
-    if (HEAD(q,l)) { \
-        PREV(HEAD(q,l),l) = (n); \
-        NEXT(n,l) = HEAD(q,l); \
-    } else { \
-        NEXT(n,l) = NULL; \
-        TAIL(q,l) = (n); \
-    } \
-    HEAD(q,l) = (n); \
-    PREV(n,l) = NULL; \
-} while (0)
-
-#define REMHEAD(q,l,n) \
-do { \
-    (n) = HEAD(q,l); \
-    if (n) { \
-        HEAD(q,l) = NEXT(n,l); \
-        if (HEAD(q,l)) \
-            PREV(HEAD(q,l),l) = NULL; \
-        else \
-            TAIL(q,l) = NULL; \
-    } \
-} while(0)
-
-#define REMTAIL(q,l,n) \
-do { \
-    (n) = TAIL(q,l); \
-    if (n) { \
-        TAIL(q,l) = PREV(n,l); \
-        if (TAIL(q,l)) \
-            NEXT(TAIL(q,l),l) = NULL; \
-        else \
-            HEAD(q,l) = NULL; \
-    } \
-} while(0)
-
-#define REMOVE(q,l,n) \
-do { \
-    if (PREV(n,l)) \
-        NEXT(PREV(n,l),l) = NEXT(n,l); \
-    else \
-        HEAD(q,l) = NEXT(n,l); \
-    if (NEXT(n,l)) \
-        PREV(NEXT(n,l),l) = PREV(n,l); \
-    else \
-        TAIL(q,l) = PREV(n,l); \
-    NEXT(n,l) = NULL; \
-    PREV(n,l) = NULL; \
-} while (0)
-
-#define INSERT(q,l,i,n) \
-do { \
-    if (PREV(i,l)) { \
-        NEXT(PREV(i,l),l) = (n); \
-    } else { \
-        HEAD(q,l) = (n); \
-    } \
-    PREV(n,l) = PREV(i,l); \
-    PREV(i,l) = (n); \
-    NEXT(n,l) = (i); \
-} while (0)
-
-#define APPENDLIST(q1,l,q2) \
-do { \
-    if (TAIL(q1,l)) { \
-        NEXT(TAIL(q1,l),l) = HEAD(q2,l); \
-        PREV(HEAD(q2,l),l) = TAIL(q1,l); \
-    } else { \
-        HEAD(q1,l) = HEAD(q2,l); \
-    } \
-    TAIL(q1,l) = TAIL(q2,l); \
-    LISTINIT(q2,l); \
-} while(0)
-
-#define INSERTLIST(q1,l,i,q2) \
-do { \
-    if (PREV(i,l)) { \
-        NEXT(PREV(i,l),l) = HEAD(q2,l); \
-    } else { \
-        HEAD(q1,l) = HEAD(q2,l); \
-    } \
-    PREV(HEAD(q2,l),l) = PREV(i,l); \
-    NEXT(TAIL(q2,l),l) = (i); \
-    PREV(i,l) = TAIL(q2,l); \
-    LISTINIT(q2,l); \
-} while(0)
-
-#define FOREACH(q,l,n)    for (n = HEAD(q,l); n; n = NEXT(n,l))
-#define FOREACHR(q,l,n)   for (n = TAIL(q,l); n; n = PREV(n,l))
-#define FOREACHD(q,l,n,r) for (n = TAIL(q,l); n && (r = PREV(n,l), 1); n = r)
-
-/****************************************************************************/
+#include "list.h"
 
 #include "al.h"
 

CVSTrac 2.0.1