~ubuntu-branches/ubuntu/trusty/patch/trusty-security

« back to all changes in this revision

Viewing changes to lib/gl_anylinked_list1.h

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-01-03 17:34:45 UTC
  • mto: (6.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20130103173445-5vf8qmnfgd7ug67h
Tags: upstream-2.7.1
ImportĀ upstreamĀ versionĀ 2.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Sequential list data type implemented by a linked list.
 
2
   Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
 
3
   Written by Bruno Haible <bruno@clisp.org>, 2006.
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
15
   You should have received a copy of the GNU General Public License
 
16
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
17
 
 
18
/* Common code of gl_linked_list.c and gl_linkedhash_list.c.  */
 
19
 
 
20
/* -------------------------- gl_list_t Data Type -------------------------- */
 
21
 
 
22
/* Concrete list node implementation, valid for this file only.  */
 
23
struct gl_list_node_impl
 
24
{
 
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;
 
31
};
 
32
 
 
33
/* Concrete gl_list_impl type, valid for this file only.  */
 
34
struct gl_list_impl
 
35
{
 
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;
 
48
};