source: tags/arb_5.0/ptpan/dlist.h

Last change on this file was 5566, checked in by boehnel, 16 years ago

Adding PTPan

File size: 1.1 KB
Line 
1/************************************************************************
2 Doubly linked list stuff (implementation similar to AmigaOS lists)
3 Written by Chris Hodges <hodges@in.tum.de>.
4 Last change: 06.05.03
5 ************************************************************************/
6
7#ifndef DLIST_H
8#define DLIST_H
9
10#include "types.h"
11
12/* Simple doubly linked list node */
13struct Node
14{
15  struct  Node *ln_Succ;     /* Pointer to next (successor) */
16  struct  Node *ln_Pred;     /* Pointer to previous (predecessor) */
17  /*LONG          ln_Type;*/
18  LLONG         ln_Pri;      /* priority or key */
19};
20
21/* List header, empty list must be initialized with NewList() */
22struct List
23{
24  struct  Node *lh_Head;
25  struct  Node *lh_Tail;
26  struct  Node *lh_TailPred;
27};
28
29struct BinTree
30{
31  struct BinTree *bt_Child[2];   /* children */
32  struct Node    *bt_Leaf[2];    /* data leaf pointer */
33  ULONG           bt_Key;        /* link for left/right */
34};
35
36/* prototypes */
37
38void NewList(struct List *lh);
39void AddHead(struct List *lh, struct Node *nd);
40void AddTail(struct List *lh, struct Node *nd);
41void Remove(struct Node *nd);
42
43#endif /* DLIST_H */
44
Note: See TracBrowser for help on using the repository browser.