2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $XConsortium: OrderList.hh /main/3 1996/06/11 16:21:08 cde-hal $
24 #ifndef _OrderListType_hh
25 #define _OrderListType_hh
28 // List status definitions
30 #define OLIST_ERROR (int)-1
31 #define OLIST_OK (int)1
32 #define OLIST_NOOP (int)0
33 #define OLIST_LAST_REMOVD (int)100
34 #define OLIST_TAIL_REMOVD (int)101
35 #define OLIST_HEAD_REMOVD (int)102
37 // Where flags for add
40 addAfter, // Add after list cursor
41 addBefore, // Add before list cursor
42 addHead, // Add at list head
43 addTail // Add at list tail
56 int add(ListEntry *entry, AddCode where, bool mvcursor = 1);
66 ListEntry *set_cursor(ListEntry *cursor_pos);
67 // NOTE: could just put the OrderList as user data
68 ListEntry *iterate(bool (*fn)(ListEntry *, void *), void *usr_def);
69 ListEntry *iterate(bool (*fn)(OrderList *, ListEntry *, void *), void *usr_def);
78 void insertNew (ListEntry *node);
79 void insertAfter (ListEntry *node);
80 void insertBefore (ListEntry *node);
81 void insertTail (ListEntry *node);
82 void insertHead (ListEntry *node);
85 inline OrderList::OrderList()
115 OrderList::set_cursor(ListEntry *value)
117 assert(value != NULL);
121 // //////////////////////////////////////////////////////////////
123 // //////////////////////////////////////////////////////////////
125 class ListEntry : public FolioObject {
126 friend class OrderList;
130 virtual ~ListEntry ();
138 ListEntry::ListEntry()
144 #endif /* _OrderListType_hh */