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,2009 Free Software Foundation, Inc.
7 * ------------------------------------------------------------------------
9 * GNU XBoard is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or (at
12 * your option) any later version.
14 * GNU XBoard is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see http://www.gnu.org/licenses/. *
22 *------------------------------------------------------------------------
23 ** See the file ChangeLog for a revision history. */
26 * This file could well be a part of backend.c, but I prefer it this
34 /* Type definition: Node of a double linked list.
36 typedef struct _ListNode {
37 struct _ListNode *succ;
38 struct _ListNode *pred;
42 /* Type definition: Double linked list.
44 * The list structure consists of two ListNode's: The pred entry of
45 * the head being the succ entry of the tail. Thus a list is empty
46 * if and only if it consists of 2 nodes. :-)
49 struct _ListNode *head; /* The list structure consists of two */
50 struct _ListNode *tail; /* ListNode's: The pred entry of the */
51 struct _ListNode *tailPred; /* head being the succ entry of the */
56 /* Function prototypes
58 extern int ListEmpty P((List *));
59 void ListNew P((List *));
60 void ListRemove P((ListNode *));
61 void ListNodeFree P((ListNode *));
62 ListNode *ListNodeCreate P((size_t));
63 void ListInsert P((ListNode *, ListNode *));
64 void ListAddHead P((List *, ListNode *));
65 void ListAddTail P((List *, ListNode *));
66 ListNode *ListElem P((List *, int));