2 * lists.c -- Includefile of lists.c
4 * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free
5 * Software Foundation, Inc.
7 * Enhancements Copyright 2005 Alessandro Scotti
9 * ------------------------------------------------------------------------
11 * GNU XBoard is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or (at
14 * your option) any later version.
16 * GNU XBoard is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see http://www.gnu.org/licenses/. *
24 *------------------------------------------------------------------------
25 ** See the file ChangeLog for a revision history. */
28 * This file could well be a part of backend.c, but I prefer it this
36 /* Type definition: Node of a double linked list.
38 typedef struct XB_ListNode {
39 struct XB_ListNode *succ;
40 struct XB_ListNode *pred;
44 /* Type definition: Double linked list.
46 * The list structure consists of two ListNode's: The pred entry of
47 * the head being the succ entry of the tail. Thus a list is empty
48 * if and only if it consists of 2 nodes. :-)
51 struct XB_ListNode *head; /* The list structure consists of two */
52 struct XB_ListNode *tail; /* ListNode's: The pred entry of the */
53 struct XB_ListNode *tailPred; /* head being the succ entry of the */
58 /* Function prototypes
60 extern int ListEmpty P((List *));
61 void ListNew P((List *));
62 void ListRemove P((ListNode *));
63 void ListNodeFree P((ListNode *));
64 ListNode *ListNodeCreate P((size_t));
65 void ListInsert P((ListNode *, ListNode *));
66 void ListAddHead P((List *, ListNode *));
67 void ListAddTail P((List *, ListNode *));
68 ListNode *ListElem P((List *, int));