2 * lists.c -- Includefile of lists.c
3 * XBoard $Id: lists.h,v 2.1 2003/10/27 19:21:00 mann Exp $
5 * Copyright 1995 Free Software Foundation, Inc.
7 * ------------------------------------------------------------------------
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
21 * ------------------------------------------------------------------------
23 * This file could well be a part of backend.c, but I prefer it this
31 /* Type definition: Node of a double linked list.
33 typedef struct _ListNode {
34 struct _ListNode *succ;
35 struct _ListNode *pred;
39 /* Type definition: Double linked list.
41 * The list structure consists of two ListNode's: The pred entry of
42 * the head being the succ entry of the tail. Thus a list is empty
43 * if and only if it consists of 2 nodes. :-)
46 struct _ListNode *head; /* The list structure consists of two */
47 struct _ListNode *tail; /* ListNode's: The pred entry of the */
48 struct _ListNode *tailPred; /* head being the succ entry of the */
53 /* Function prototypes
55 extern int ListEmpty P((List *));
56 void ListNew P((List *));
57 void ListRemove P((ListNode *));
58 void ListNodeFree P((ListNode *));
59 ListNode *ListNodeCreate P((size_t));
60 void ListInsert P((ListNode *, ListNode *));
61 void ListAddHead P((List *, ListNode *));
62 void ListAddTail P((List *, ListNode *));
63 ListNode *ListElem P((List *, int));