1 /* Sequential list data type implemented by a linked list.
2 Copyright (C) 2006 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
19 /* Common code of gl_linked_list.c and gl_linkedhash_list.c. */
21 /* -------------------------- gl_list_t Data Type -------------------------- */
23 /* Concrete list node implementation, valid for this file only. */
24 struct gl_list_node_impl
27 struct gl_hash_entry h; /* hash table entry fields; must be first */
29 struct gl_list_node_impl *next;
30 struct gl_list_node_impl *prev;
34 /* Concrete gl_list_impl type, valid for this file only. */
37 struct gl_list_impl_base base;
39 /* A hash table: managed as an array of collision lists. */
40 struct gl_hash_entry **table;
43 /* A circular list anchored at root.
44 The first node is = root.next, the last node is = root.prev.
45 The root's value is unused. */
46 struct gl_list_node_impl root;
47 /* Number of list nodes, excluding the root. */