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