source: trunk/Jgraph/list.h

Last change on this file 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: 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
12typedef 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
28void insert(void *, void *);/* Inserts a node to the end of a list */
29void delete_item(void *); /* Deletes an arbitrary node */
30List make_list(int size); /* Creates a new list */
31List get_node(void *); /* Allocates a node to be inserted into the list */
32void free_node(void *, void *); /* Deallocates a node from the list */
33
34void error_header();
Note: See TracBrowser for help on using the repository browser.