source: trunk/Jgraph/prio_list.h@ 539

Last change on this file since 539 was 420, checked in by Nicholas Riley, 16 years ago

Jgraph: my changes - ANSIfication, few minor bug fixes; works on OS X 10.5 now

File size: 993 bytes
Line 
1/*
2 * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/prio_list.h,v $
3 * $Revision: 8.3 $
4 * $Date: 92/11/30 11:42:34 $
5 * $Author: jsp $
6 */
7
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 */
16
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
21typedef struct prio_list {
22 struct prio_list *flink;
23 struct prio_list *blink;
24 int prio;
25 /* ... */
26} *Prio_list;
27
28typedef int Boolean;
29
30void prio_insert(void *node, void *list, Boolean descending);
31
Note: See TracBrowser for help on using the repository browser.