Mercurial > gnulib
annotate lib/gl_sublist.h @ 40186:8964917f9574
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Mon, 18 Feb 2019 08:02:49 -0800 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
7420 | 1 /* Sequential list data type backed by another list. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2006, 2009-2019 Free Software Foundation, Inc. |
7420 | 3 Written by Bruno Haible <bruno@clisp.org>, 2006. |
4 | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7420
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify |
7420 | 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:
7420
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:
7420
diff
changeset
|
8 (at your option) any later version. |
7420 | 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 | |
19190 | 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
7420 | 17 |
18 #ifndef _GL_SUBLIST_H | |
19 #define _GL_SUBLIST_H | |
20 | |
21 #include "gl_list.h" | |
22 | |
23 #ifdef __cplusplus | |
24 extern "C" { | |
25 #endif | |
26 | |
27 | |
28 /* Create a sublist of a given list. | |
29 This is the list of elements with indices i, start_index <= i < end_index. | |
30 The sublist is backed by the given list, which means: | |
31 - Modifications to the sublist affect the whole list. | |
32 - Modifications to the whole list are immediately visible in the sublist. | |
33 - The sublist is only valid as long as the whole list is valid. | |
34 - The sublist must not be passed to the gl_list_sortedlist_add() function. | |
35 */ | |
12445
a8c91b846640
Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
36 #if 0 /* declared in gl_xsublist.h */ |
7420 | 37 extern gl_list_t gl_sublist_create (gl_list_t whole_list, |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
9309
diff
changeset
|
38 size_t start_index, size_t end_index); |
12445
a8c91b846640
Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
39 #endif |
a8c91b846640
Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
40 /* Likewise. Return NULL upon out-of-memory. */ |
a8c91b846640
Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
41 extern gl_list_t gl_sublist_nx_create (gl_list_t whole_list, |
a8c91b846640
Move the malloc checking from module 'list' to new module 'xlist'.
Bruno Haible <bruno@clisp.org>
parents:
12421
diff
changeset
|
42 size_t start_index, size_t end_index); |
7420 | 43 |
44 | |
45 #ifdef __cplusplus | |
46 } | |
47 #endif | |
48 | |
49 #endif /* _GL_SUBLIST_H */ |