1 // $XConsortium: OrderList.hh /main/3 1996/06/11 16:21:08 cde-hal $
2 #ifndef _OrderListType_hh
3 #define _OrderListType_hh
6 // List status definitions
8 #define OLIST_ERROR (int)-1
9 #define OLIST_OK (int)1
10 #define OLIST_NOOP (int)0
11 #define OLIST_LAST_REMOVD (int)100
12 #define OLIST_TAIL_REMOVD (int)101
13 #define OLIST_HEAD_REMOVD (int)102
15 // Where flags for add
18 addAfter, // Add after list cursor
19 addBefore, // Add before list cursor
20 addHead, // Add at list head
21 addTail // Add at list tail
34 int add(ListEntry *entry, AddCode where, bool mvcursor = 1);
44 ListEntry *set_cursor(ListEntry *cursor_pos);
45 // NOTE: could just put the OrderList as user data
46 ListEntry *iterate(bool (*fn)(ListEntry *, void *), void *usr_def);
47 ListEntry *iterate(bool (*fn)(OrderList *, ListEntry *, void *), void *usr_def);
56 void insertNew (ListEntry *node);
57 void insertAfter (ListEntry *node);
58 void insertBefore (ListEntry *node);
59 void insertTail (ListEntry *node);
60 void insertHead (ListEntry *node);
63 inline OrderList::OrderList()
93 OrderList::set_cursor(ListEntry *value)
95 assert(value != NULL);
99 // //////////////////////////////////////////////////////////////
101 // //////////////////////////////////////////////////////////////
103 class ListEntry : public FolioObject {
104 friend class OrderList;
108 virtual ~ListEntry ();
116 ListEntry::ListEntry()
122 #endif /* _OrderListType_hh */