Blame gettext-tools/libgettextpo/gl_anylinked_list1.h

Packit 5b56b6
/* Sequential list data type implemented by a linked list.
Packit 5b56b6
   Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
Packit 5b56b6
   Written by Bruno Haible <bruno@clisp.org>, 2006.
Packit 5b56b6
Packit 5b56b6
   This program is free software: you can redistribute it and/or modify
Packit 5b56b6
   it under the terms of the GNU General Public License as published by
Packit 5b56b6
   the Free Software Foundation; either version 3 of the License, or
Packit 5b56b6
   (at your option) any later version.
Packit 5b56b6
Packit 5b56b6
   This program is distributed in the hope that it will be useful,
Packit 5b56b6
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5b56b6
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 5b56b6
   GNU General Public License for more details.
Packit 5b56b6
Packit 5b56b6
   You should have received a copy of the GNU General Public License
Packit 5b56b6
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 5b56b6
Packit 5b56b6
/* Common code of gl_linked_list.c and gl_linkedhash_list.c.  */
Packit 5b56b6
Packit 5b56b6
/* -------------------------- gl_list_t Data Type -------------------------- */
Packit 5b56b6
Packit 5b56b6
/* Concrete list node implementation, valid for this file only.  */
Packit 5b56b6
struct gl_list_node_impl
Packit 5b56b6
{
Packit 5b56b6
#if WITH_HASHTABLE
Packit 5b56b6
  struct gl_hash_entry h;           /* hash table entry fields; must be first */
Packit 5b56b6
#endif
Packit 5b56b6
  struct gl_list_node_impl *next;
Packit 5b56b6
  struct gl_list_node_impl *prev;
Packit 5b56b6
  const void *value;
Packit 5b56b6
};
Packit 5b56b6
Packit 5b56b6
/* Concrete gl_list_impl type, valid for this file only.  */
Packit 5b56b6
struct gl_list_impl
Packit 5b56b6
{
Packit 5b56b6
  struct gl_list_impl_base base;
Packit 5b56b6
#if WITH_HASHTABLE
Packit 5b56b6
  /* A hash table: managed as an array of collision lists.  */
Packit 5b56b6
  struct gl_hash_entry **table;
Packit 5b56b6
  size_t table_size;
Packit 5b56b6
#endif
Packit 5b56b6
  /* A circular list anchored at root.
Packit 5b56b6
     The first node is = root.next, the last node is = root.prev.
Packit 5b56b6
     The root's value is unused.  */
Packit 5b56b6
  struct gl_list_node_impl root;
Packit 5b56b6
  /* Number of list nodes, excluding the root.  */
Packit 5b56b6
  size_t count;
Packit 5b56b6
};