sys_stat: Fix 'implicit declaration of function' warning on OS/2 kLIBC.
[gnulib.git] / lib / gl_anylinked_list1.h
bloba12b1adc24405120c14e61607651df7d511431d2
1 /* Sequential list data type implemented by a linked list.
2 Copyright (C) 2006, 2009-2019 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 3 of the License, or
8 (at your option) any later version.
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, see <https://www.gnu.org/licenses/>. */
18 /* Common code of gl_linked_list.c and gl_linkedhash_list.c. */
20 /* -------------------------- gl_list_t Data Type -------------------------- */
22 /* Concrete list node implementation, valid for this file only. */
23 struct gl_list_node_impl
25 #if WITH_HASHTABLE
26 struct gl_hash_entry h; /* hash table entry fields; must be first */
27 #endif
28 struct gl_list_node_impl *next;
29 struct gl_list_node_impl *prev;
30 const void *value;
33 /* Concrete gl_list_impl type, valid for this file only. */
34 struct gl_list_impl
36 struct gl_list_impl_base base;
37 #if WITH_HASHTABLE
38 /* A hash table: managed as an array of collision lists. */
39 struct gl_hash_entry **table;
40 size_t table_size;
41 #endif
42 /* A circular list anchored at root.
43 The first node is = root.next, the last node is = root.prev.
44 The root's value is unused. */
45 struct gl_list_node_impl root;
46 /* Number of list nodes, excluding the root. */
47 size_t count;