Last change
on this file since 623 was 420, checked in by Nicholas Riley, 17 years ago |
Jgraph: my changes - ANSIfication, few minor bug fixes; works on OS X 10.5 now
|
File size:
1016 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/list.h,v $
|
---|
3 | * $Revision: 8.3 $
|
---|
4 | * $Date: 92/11/30 11:42:27 $
|
---|
5 | * $Author: jsp $
|
---|
6 | */
|
---|
7 |
|
---|
8 | /* This is the header file for the list manipulation routines in list.c.
|
---|
9 | * Any struct can be turned into a list as long as its first two fields are
|
---|
10 | * flink and blink. */
|
---|
11 |
|
---|
12 | typedef struct list {
|
---|
13 | struct list *flink;
|
---|
14 | struct list *blink;
|
---|
15 | } *List;
|
---|
16 |
|
---|
17 | /* Nil, first, next, and prev are macro expansions for list traversal
|
---|
18 | * primitives. */
|
---|
19 |
|
---|
20 | #define nil(l) (l)
|
---|
21 | #define first(l) (l->flink)
|
---|
22 | #define last(l) (l->blink)
|
---|
23 | #define next(n) (n->flink)
|
---|
24 | #define prev(n) (n->blink)
|
---|
25 |
|
---|
26 | /* These are the routines for manipulating lists */
|
---|
27 |
|
---|
28 | void insert(void *, void *);/* Inserts a node to the end of a list */
|
---|
29 | void delete_item(void *); /* Deletes an arbitrary node */
|
---|
30 | List make_list(int size); /* Creates a new list */
|
---|
31 | List get_node(void *); /* Allocates a node to be inserted into the list */
|
---|
32 | void free_node(void *, void *); /* Deallocates a node from the list */
|
---|
33 |
|
---|
34 | void error_header();
|
---|
Note:
See
TracBrowser
for help on using the repository browser.