annotate lib/gl_xset.h @ 40231:9b3c79fdfe0b

strtod: fix clash with strtold Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817). * lib/strtod.c (compute_minus_zero, minus_zero): Simplify by remving the macro / external variable, and having just a function. User changed. This avoids the need for an external variable that might clash.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 11 Mar 2019 16:40:29 -0700
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39995
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Abstract set data type, with out-of-memory checking.
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 39995
diff changeset
2 Copyright (C) 2009-2019 Free Software Foundation, Inc.
39995
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 Written by Bruno Haible <bruno@clisp.org>, 2009.
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 This program is free software: you can redistribute it and/or modify
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 (at your option) any later version.
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #ifndef _GL_XSET_H
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #define _GL_XSET_H
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include "gl_set.h"
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include "xalloc.h"
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #ifndef _GL_INLINE_HEADER_BEGIN
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #error "Please include config.h first."
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #endif
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 _GL_INLINE_HEADER_BEGIN
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #ifndef GL_XSET_INLINE
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 # define GL_XSET_INLINE _GL_INLINE
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 #endif
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 #ifdef __cplusplus
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 extern "C" {
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #endif
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 /* These functions are thin wrappers around the corresponding functions with
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 _nx_ infix from gl_set.h. Upon out-of-memory, they invoke xalloc_die (),
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 instead of returning an error indicator. */
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 #if 0 /* These are defined inline below. */
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 extern gl_set_t gl_set_create_empty (gl_set_implementation_t implementation,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 gl_setelement_equals_fn equals_fn,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 gl_setelement_hashcode_fn hashcode_fn,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 gl_setelement_dispose_fn dispose_fn);
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 extern bool gl_set_add (gl_set_t set, const void *elt);
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 #endif
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 GL_XSET_INLINE gl_set_t
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 gl_set_create_empty (gl_set_implementation_t implementation,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 gl_setelement_equals_fn equals_fn,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 gl_setelement_hashcode_fn hashcode_fn,
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 gl_setelement_dispose_fn dispose_fn)
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 {
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 gl_set_t result =
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 gl_set_nx_create_empty (implementation, equals_fn, hashcode_fn, dispose_fn);
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 if (result == NULL)
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 xalloc_die ();
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 return result;
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 }
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 GL_XSET_INLINE bool
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 gl_set_add (gl_set_t set, const void *elt)
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 {
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 int result = gl_set_nx_add (set, elt);
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 if (result < 0)
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 xalloc_die ();
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 return result;
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 }
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 #ifdef __cplusplus
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 }
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 #endif
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 _GL_INLINE_HEADER_END
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75
0070ec212588 xset: New module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 #endif /* _GL_XSET_H */