File: list.h

package info (click to toggle)
jgraph 83-23
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 652 kB
  • ctags: 446
  • sloc: ansic: 4,596; makefile: 146; sh: 106; awk: 104
file content (37 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _LIST_H
#define _LIST_H

/* 
 * $Source: /tmp_mnt/n/fs/grad1/jsp/src/jgraph/RCS/list.h,v $
 * $Revision: 8.3 $
 * $Date: 92/11/30 11:42:27 $
 * $Author: jsp $
 */

/* This is the header file for the list manipulation routines in list.c.
 * Any struct can be turned into a list as long as its first two fields are
 * flink and blink. */

typedef struct list {
  struct list *flink;
  struct list *blink;
} *List;

/* Nil, first, next, and prev are macro expansions for list traversal 
 * primitives. */

#define nil(l) (l)
#define first(l) (l->flink)
#define last(l) (l->blink)
#define next(n) (n->flink)
#define prev(n) (n->blink)

/* These are the routines for manipluating lists */

/* void insert(node list);     Inserts a node to the end of a list */
/* void delete_item(node);     Deletes an arbitrary node */
/* List make_list(node_size);  Creates a new list */
/* List get_node(list);        Allocates a node to be inserted into the list */
/* void free_node(node, list); Deallocates a node from the list */

#endif