2 * lists.c -- Includefile of lists.c
4 * Copyright 1995,2009 Free Software Foundation, Inc.
6 * ------------------------------------------------------------------------
8 * GNU XBoard 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 3 of the License, or (at
11 * your option) any later version.
13 * GNU XBoard is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * 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, see http://www.gnu.org/licenses/. *
21 *------------------------------------------------------------------------
22 ** See the file ChangeLog for a revision history. */
25 * This file could well be a part of backend.c, but I prefer it this
33 /* Type definition: Node of a double linked list.
35 typedef struct _ListNode {
36 struct _ListNode *succ;
37 struct _ListNode *pred;
41 /* Type definition: Double linked list.
43 * The list structure consists of two ListNode's: The pred entry of
44 * the head being the succ entry of the tail. Thus a list is empty
45 * if and only if it consists of 2 nodes. :-)
48 struct _ListNode *head; /* The list structure consists of two */
49 struct _ListNode *tail; /* ListNode's: The pred entry of the */
50 struct _ListNode *tailPred; /* head being the succ entry of the */
55 /* Function prototypes
57 extern int ListEmpty P((List *));
58 void ListNew P((List *));
59 void ListRemove P((ListNode *));
60 void ListNodeFree P((ListNode *));
61 ListNode *ListNodeCreate P((size_t));
62 void ListInsert P((ListNode *, ListNode *));
63 void ListAddHead P((List *, ListNode *));
64 void ListAddTail P((List *, ListNode *));
65 ListNode *ListElem P((List *, int));