4 /* dlist.h - linked list routines by Harry Sintonen <sintonen@iki.fi>
6 faster swapnodes() by Jamie van den Berge <entity@vapor.com>
7 mergesortlist() by Fabio Alemagna <falemagn@aros.org>
9 MinList.c and MinList.h are public domain as long name of all contributers
10 still appear in both files.
14 #include <exec/lists.h>
27 struct dnode
*l_tailpred
;
31 /* callback function type for callfornode()
33 typedef int (*LISTFUNCPTR
) (struct MinNode
*, void *);
35 /* return value for LISTFUNCPTR:
37 #define LFR_CONTINUE 0 /* continue list travelsal */
38 #define LFR_BREAK 1 /* stop list travelsal and return current node */
40 /* flags for callfornode()
42 #define CFNF_BACKWARDS (1 << 0)
44 /* callback function type for qsortlist()
46 typedef int (*COMPARFUNCPTR
) (struct MinNode
*, struct MinNode
*);
51 /* use this as qsortlist() nmemb to sort all nodes from base
53 #define QSL_ALL 0xffffffff
58 #define LISTEMPTY(l) \
59 ((l)->mlh_TailPred == (struct MinNode *) (l))
62 {(struct MinNode *) &(l)->mlh_Tail, NULL, (struct MinNode *) &(l)->mlh_Head}
84 struct MinNode
*afterof
);
86 struct MinNode
*remhead(
89 struct MinNode
*remtail(
95 struct MinNode
*finMinNode(
99 struct MinNode
*callfornode(
103 unsigned long int flags
);
107 struct MinNode
*base
,
108 unsigned long int nmemb
,
109 COMPARFUNCPTR compar
);
113 COMPARFUNCPTR compar
);
119 #endif /* __DLIST_H__ */