annotate lib/gl_linked_list.c @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Sequential list data type implemented by a linked list.
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7410
diff changeset
5 This program is free software: you can redistribute it and/or modify
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7410
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7410
diff changeset
8 (at your option) any later version.
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
9309
bbbbbf4cd1c5 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents: 7410
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
7304
1c4ed7637c24 Include <config.h> unconditionally.
Bruno Haible <bruno@clisp.org>
parents: 6978
diff changeset
18 #include <config.h>
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 /* Specification. */
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include "gl_linked_list.h"
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <stdlib.h>
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 /* -------------------------- gl_list_t Data Type -------------------------- */
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 /* Generic linked list code. */
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include "gl_anylinked_list1.h"
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #include "gl_anylinked_list2.h"
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 const struct gl_list_implementation gl_linked_list_implementation =
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 {
12445
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
34 gl_linked_nx_create_empty,
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
35 gl_linked_nx_create,
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 gl_linked_size,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 gl_linked_node_value,
12445
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
38 gl_linked_node_nx_set_value,
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 gl_linked_next_node,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 gl_linked_previous_node,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 gl_linked_get_at,
12445
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
42 gl_linked_nx_set_at,
7405
0de49c40e105 Add searching operations, limited to a subsequence of the list.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
43 gl_linked_search_from_to,
0de49c40e105 Add searching operations, limited to a subsequence of the list.
Bruno Haible <bruno@clisp.org>
parents: 7304
diff changeset
44 gl_linked_indexof_from_to,
12445
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
45 gl_linked_nx_add_first,
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
46 gl_linked_nx_add_last,
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
47 gl_linked_nx_add_before,
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
48 gl_linked_nx_add_after,
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
49 gl_linked_nx_add_at,
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 gl_linked_remove_node,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 gl_linked_remove_at,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 gl_linked_remove,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 gl_linked_list_free,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 gl_linked_iterator,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 gl_linked_iterator_from_to,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 gl_linked_iterator_next,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 gl_linked_iterator_free,
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 gl_linked_sortedlist_search,
7410
9704ff2cbdfe Add bounded list search operations.
Bruno Haible <bruno@clisp.org>
parents: 7405
diff changeset
59 gl_linked_sortedlist_search_from_to,
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 gl_linked_sortedlist_indexof,
7410
9704ff2cbdfe Add bounded list search operations.
Bruno Haible <bruno@clisp.org>
parents: 7405
diff changeset
61 gl_linked_sortedlist_indexof_from_to,
12445
a8c91b846640 Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents: 9686
diff changeset
62 gl_linked_sortedlist_nx_add,
6978
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 gl_linked_sortedlist_remove
ec26419f7c0b Sequential list data type implemented by a linked list.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 };