gettext: Sync with gettext 0.23.
[gnulib.git] / lib / gl_anylinked_list1.h
blob5aeb69e71042eb5c244d6c8dd2421b04c25fae02
1 /* Sequential list data type implemented by a linked list.
2 Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser 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;