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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7420
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <bruno@clisp.org>, 2006.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
52a8ff5ade8a New module 'sublist'.
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: 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
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
7420
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #ifndef _GL_SUBLIST_H
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #define _GL_SUBLIST_H
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include "gl_list.h"
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #ifdef __cplusplus
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 extern "C" {
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #endif
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 /* Create a sublist of a given list.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 This is the list of elements with indices i, start_index <= i < end_index.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 The sublist is backed by the given list, which means:
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 - Modifications to the sublist affect the whole list.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 - Modifications to the whole list are immediately visible in the sublist.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 - The sublist is only valid as long as the whole list is valid.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 - The sublist must not be passed to the gl_list_sortedlist_add() function.
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 #ifdef __cplusplus
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 }
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 #endif
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48
52a8ff5ade8a New module 'sublist'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 #endif /* _GL_SUBLIST_H */