This source file includes following definitions.
- gl_oset_create_empty
- gl_oset_add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef _GL_XOSET_H
19 #define _GL_XOSET_H
20
21 #include "gl_oset.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_XOSET_INLINE
29 # define GL_XOSET_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_oset_t gl_oset_create_empty (gl_oset_implementation_t implementation,
42 gl_setelement_compar_fn compar_fn,
43 gl_setelement_dispose_fn dispose_fn)
44
45 _GL_ATTRIBUTE_RETURNS_NONNULL;
46 extern bool gl_oset_add (gl_oset_t set, const void *elt);
47 #endif
48
49 GL_XOSET_INLINE
50
51 _GL_ATTRIBUTE_RETURNS_NONNULL
52 gl_oset_t
53 gl_oset_create_empty (gl_oset_implementation_t implementation,
54 gl_setelement_compar_fn compar_fn,
55 gl_setelement_dispose_fn dispose_fn)
56 {
57 gl_oset_t result =
58 gl_oset_nx_create_empty (implementation, compar_fn, dispose_fn);
59 if (result == NULL)
60 xalloc_die ();
61 return result;
62 }
63
64 GL_XOSET_INLINE bool
65 gl_oset_add (gl_oset_t set, const void *elt)
66 {
67 int result = gl_oset_nx_add (set, elt);
68 if (result < 0)
69 xalloc_die ();
70 return result;
71 }
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 _GL_INLINE_HEADER_END
78
79 #endif