Changeset 420 for trunk/Jgraph/prio_list.h
- Timestamp:
- 02/27/08 07:13:31 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jgraph/prio_list.h
r418 r420 6 6 */ 7 7 8 /* Priority lists are just like normal lists of list.h and list.c, except 9 * that their third field is a (int) prioriy. The routines of list.c should all 10 * be used except for insert, because it will always put an item at the 11 * end of a list. Instead, use prio_insert, which will put the item 12 * into its proper place in the list. The last argument of prio_insert should 13 * be TRUE if the list is to be kept in descending order; it should be FALSE 14 * for ascending order. 8 /* Priority lists are just like normal lists of list.h and list.c, 9 * except that their third field is a (int) priority. The routines of 10 * list.c should all be used except for insert, because it will always 11 * put an item at the end of a list. Instead, use prio_insert, which 12 * will put the item into its proper place in the list. The last 13 * argument of prio_insert should be TRUE if the list is to be kept in 14 * descending order; it should be FALSE for ascending order. 15 */ 15 16 16 * Priority list should be: 17 18 struct prio_list { 17 /* A priority list is any list with the first three fields being flink, 18 * blink and prio. Use the routines of list.c to do everything except 19 * insertion */ 20 21 typedef struct prio_list { 19 22 struct prio_list *flink; 20 23 struct prio_list *blink; 21 24 int prio; 22 ...23 } 25 /* ... */ 26 } *Prio_list; 24 27 25 */ 28 typedef int Boolean; 26 29 27 /* void prio_insert(node, list, descending); */ 30 void prio_insert(void *node, void *list, Boolean descending); 28 31
Note:
See TracChangeset
for help on using the changeset viewer.