This source file includes following definitions.
- gl_omap_create_empty
- gl_omap_put
- gl_omap_getput
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef _GL_XOMAP_H
19 #define _GL_XOMAP_H
20
21 #include "gl_omap.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_XOMAP_INLINE
29 # define GL_XOMAP_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_omap_t gl_omap_create_empty (gl_omap_implementation_t implementation,
42 gl_mapkey_compar_fn compar_fn,
43 gl_mapkey_dispose_fn kdispose_fn,
44 gl_mapvalue_dispose_fn vdispose_fn)
45
46 _GL_ATTRIBUTE_RETURNS_NONNULL;
47 extern bool gl_omap_put (gl_omap_t map, const void *key, const void *value);
48 extern bool gl_omap_getput (gl_omap_t map, const void *key, const void *value,
49 const void **oldvaluep);
50 #endif
51
52 GL_XOMAP_INLINE
53
54 _GL_ATTRIBUTE_RETURNS_NONNULL
55 gl_omap_t
56 gl_omap_create_empty (gl_omap_implementation_t implementation,
57 gl_mapkey_compar_fn compar_fn,
58 gl_mapkey_dispose_fn kdispose_fn,
59 gl_mapvalue_dispose_fn vdispose_fn)
60 {
61 gl_omap_t result =
62 gl_omap_nx_create_empty (implementation, compar_fn, kdispose_fn, vdispose_fn);
63 if (result == NULL)
64 xalloc_die ();
65 return result;
66 }
67
68 GL_XOMAP_INLINE bool
69 gl_omap_put (gl_omap_t map, const void *key, const void *value)
70 {
71 int result = gl_omap_nx_put (map, key, value);
72 if (result < 0)
73 xalloc_die ();
74 return result;
75 }
76
77 GL_XOMAP_INLINE bool
78 gl_omap_getput (gl_omap_t map, const void *key, const void *value,
79 const void **oldvaluep)
80 {
81 int result = gl_omap_nx_getput (map, key, value, oldvaluep);
82 if (result < 0)
83 xalloc_die ();
84 return result;
85 }
86
87 #ifdef __cplusplus
88 }
89 #endif
90
91 _GL_INLINE_HEADER_END
92
93 #endif