Revision a2d01907

View differences:

lib/lists.h
9 9
#ifndef _BIRD_LISTS_H_
10 10
#define _BIRD_LISTS_H_
11 11

  
12
/*
13
 * I admit the list structure is very tricky and also somewhat awkward,
14
 * but it's both efficient and easy to manipulate once one understands the
15
 * basic trick: The list head always contains two synthetic nodes which are
16
 * always present in the list: the head and the tail. But as the `next'
17
 * entry of the tail and the `prev' entry of the head are both NULL, the
18
 * nodes can overlap each other:
19
 *
20
 *     head    head_node.next
21
 *     null    head_node.prev  tail_node.next
22
 *     tail                    tail_node.prev
23
 */
24

  
12 25
typedef struct node {
13 26
  struct node *next, *prev;
14 27
} node;

Also available in: Unified diff