Sequential list data type implemented by a linked list.
[gnulib.git] / lib / gl_linked_list.c
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.
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 2, or (at your option)
8    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, write to the Free Software Foundation,
17    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18
19 #ifdef HAVE_CONFIG_H
20 # include <config.h>
21 #endif
22
23 /* Specification.  */
24 #include "gl_linked_list.h"
25
26 #include <stdlib.h>
27
28 #include "xalloc.h"
29
30 /* -------------------------- gl_list_t Data Type -------------------------- */
31
32 /* Generic linked list code.  */
33 #include "gl_anylinked_list1.h"
34 #include "gl_anylinked_list2.h"
35
36
37 const struct gl_list_implementation gl_linked_list_implementation =
38   {
39     gl_linked_create_empty,
40     gl_linked_create,
41     gl_linked_size,
42     gl_linked_node_value,
43     gl_linked_next_node,
44     gl_linked_previous_node,
45     gl_linked_get_at,
46     gl_linked_set_at,
47     gl_linked_search,
48     gl_linked_indexof,
49     gl_linked_add_first,
50     gl_linked_add_last,
51     gl_linked_add_before,
52     gl_linked_add_after,
53     gl_linked_add_at,
54     gl_linked_remove_node,
55     gl_linked_remove_at,
56     gl_linked_remove,
57     gl_linked_list_free,
58     gl_linked_iterator,
59     gl_linked_iterator_from_to,
60     gl_linked_iterator_next,
61     gl_linked_iterator_free,
62     gl_linked_sortedlist_search,
63     gl_linked_sortedlist_indexof,
64     gl_linked_sortedlist_add,
65     gl_linked_sortedlist_remove
66   };