4 * [Generated from llistMan, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
40 /* --- llist_create --- *
42 * On entry: R0 == pointer to 12 byte list head to fill in
43 * R1 == sort routine to use (0 for none)
45 * On exit: List head filled in appropriately
47 * Use: This call set up list. It must be made just once, before
48 * and other list alls are made. On entry, R0 must point to
49 * 12 bytes in memory, which is filled in by this call.
50 * Example code may look like:
63 extern routine llist_create;
65 /* --- llist_destroy --- *
67 * On entry: R0 == pointer to list head
69 * On exit: R0 corrupted
71 * Use: Destroys the given list.
74 extern routine llist_destroy;
76 /* --- llist_addItem --- *
78 * On entry: R0 == pointer to list head
79 * R1 == pointer to user data (or 0 if none to copy)
80 * R2 == size of user data
82 * On exit: R0 preserved
83 * R1 == pointer to the new user data
86 * Use: This call will add an item to a list. Notice that the
87 * item is entirely allocated by the list manager, it does not
88 * point to the data that you supply it, instead it
89 * copies the data into the newly created item. For this reason
90 * if 0 is supplied as the user data, nothing is copied.
91 * It is the returned user data pointer, that must be
92 * used to reference the item in other llist calls.
95 extern routine llist_addItem;
97 /* --- llist_removeItem --- *
99 * On entry: R0 == list head pointer
100 * R1 == pointer to item to remove (as returned by addItem)
104 * Use: This call removes the item from the given list. All
105 * memory taken up by the item is freed. If the value
106 * passed in R1 is not an item in the list, then all hell is
107 * likely to break loose, so I don't advise making this mistake.
110 extern routine llist_removeItem;
112 /* --- llist_reinsert --- *
114 * On entry: R0 == pointer to list head
115 * R1 == item to reinsert
119 * Use: Reinserts the given item into the list. This call is
120 * used if the item is updated in such a way that its
121 * position in the list may change.
124 extern routine llist_reinsert;
126 /* --- llist_setFlags --- *
128 * On entry: R1 == pointer to list item
132 * On exit: R2 == the new flags word
134 * Use: Sets the flags associated with the given item. If you
135 * just wish to read them, set R2 and R3 to 0.
138 extern routine llist_setFlags;
140 /* --- llist_items --- *
142 * On entry: R0 == pointer to list head
144 * On exit: R1 == number of items in list
146 * Use: Returns the number of items in the list given. This is
147 * a cached value, and so is very fast.
150 extern routine llist_items;
152 /* --- llist_enumerate --- *
154 * On entry: R0 == pointer to list head
155 * R1 == pointer to item (0 for first)
159 * On exit: CS and R1 == next item that matches
160 * CC and R1 corrupted if no more items
162 * Use: This calls return each item in the list, one at a time,
163 * as long as the item matches the pattern given.
166 extern routine llist_enumerate;
168 /* --- llist_itemToIndex --- *
170 * On entry: R0 == pointer to list head
171 * R1 == point to the item
173 * On exit: R1 == index of the item, -1 if it's not there
175 * Use: Returns the index of the item given, indexed from 0.
178 extern routine llist_itemToIndex;
180 /* --- llist_indexToItem --- *
182 * On entry: R0 == pointer to list head
183 * R1 == point to the index (indexed from 0)
185 * On exit: R1 == the item itself, or 0 if index doesn't exist
187 * Use: Returns the index of the item given, indexed from 0.
190 extern routine llist_indexToItem;
192 /* --- llist_registerSort --- *
194 * On entry: R0 == pointer to list head
195 * R1 == pointer to new sort routine
199 * Use: Registers a new sort routine to be used on the given
200 * list. This call will also cause a complete resort
201 * of the given list using a mergesort algorithm -- O(n log n).
204 extern routine llist_registerSort;
206 /* --- llist_init --- *
212 * Use: Initialises the llistMan unit.
215 extern routine llist_init;
217 /* --- llist_desc --- *
219 * A llist decription for use with listbox
222 extern routine llist_desc;
224 /*----- That's all, folks -------------------------------------------------*/