This source file includes following definitions.
- gl_set_create_empty
- gl_set_add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef _GL_XSET_H
19 #define _GL_XSET_H
20
21 #include "gl_set.h"
22 #include "xalloc.h"
23
24 #ifndef _GL_INLINE_HEADER_BEGIN
25 #error "Please include config.h first."
26 #endif
27 _GL_INLINE_HEADER_BEGIN
28 #ifndef GL_XSET_INLINE
29 # define GL_XSET_INLINE _GL_INLINE
30 #endif
31
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38
39
40 #if 0
41 extern gl_set_t gl_set_create_empty (gl_set_implementation_t implementation,
42 gl_setelement_equals_fn equals_fn,
43 gl_setelement_hashcode_fn hashcode_fn,
44 gl_setelement_dispose_fn dispose_fn)
45
46 _GL_ATTRIBUTE_RETURNS_NONNULL;
47 extern bool gl_set_add (gl_set_t set, const void *elt);
48 #endif
49
50 GL_XSET_INLINE
51
52 _GL_ATTRIBUTE_RETURNS_NONNULL
53 gl_set_t
54 gl_set_create_empty (gl_set_implementation_t implementation,
55 gl_setelement_equals_fn equals_fn,
56 gl_setelement_hashcode_fn hashcode_fn,
57 gl_setelement_dispose_fn dispose_fn)
58 {
59 gl_set_t result =
60 gl_set_nx_create_empty (implementation, equals_fn, hashcode_fn, dispose_fn);
61 if (result == NULL)
62 xalloc_die ();
63 return result;
64 }
65
66 GL_XSET_INLINE bool
67 gl_set_add (gl_set_t set, const void *elt)
68 {
69 int result = gl_set_nx_add (set, elt);
70 if (result < 0)
71 xalloc_die ();
72 return result;
73 }
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 _GL_INLINE_HEADER_END
80
81 #endif