Go to the documentation of this file.
9 #ifndef __AFW_ASSOCIATIVE_ARRAY_TEMPLATE_H__
10 #define __AFW_ASSOCIATIVE_ARRAY_TEMPLATE_H__
24 #define AFW_ASSOCIATIVE_ARRAY_TEMPLATE(name, type) \
27 const afw_pool_t *p; \
30 AFW_DEFINE_STATIC_INLINE( const name##_t * ) \
32 afw_associative_array_add_reference_value_cb add_reference_value, \
33 afw_associative_array_release_value_cb release_value, \
34 const afw_pool_t *p, afw_xctx_t *xctx) \
36 return (const name##_t *)afw_associative_array_create( \
37 add_reference_value, release_value, p, xctx); \
40 AFW_DEFINE_STATIC_INLINE( void ) \
41 name##_release(const name##_t *instance, \
44 afw_associative_array_release( \
45 (const afw_associative_array_t *)instance, \
49 AFW_DEFINE_STATIC_INLINE( void ) \
50 name##_add_reference(const name##_t *instance, \
53 afw_associative_array_add_reference( \
54 (const afw_associative_array_t *)instance, \
58 AFW_DEFINE_STATIC_INLINE( const type * ) \
59 name##_get(const name##_t *instance, const afw_utf8_t *key, \
62 return afw_associative_array_get( \
63 (const afw_associative_array_t *)instance, \
67 AFW_DEFINE_STATIC_INLINE( const type * ) \
68 name##_get_reference(const name##_t *instance, const afw_utf8_t *key, \
71 return afw_associative_array_get_reference( \
72 (const afw_associative_array_t *)instance, \
76 AFW_DEFINE_STATIC_INLINE( void ) \
77 name##_for_each(const name##_t *instance, void *context, \
78 afw_value_cb_t callback, afw_xctx_t *xctx) \
80 afw_associative_array_for_each( \
81 (const afw_associative_array_t *)instance, \
82 context, callback, xctx); \
85 AFW_DEFINE_STATIC_INLINE( void ) \
86 name##_set(const name##_t *instance, \
87 const afw_utf8_t *key, const type *value, \
90 afw_associative_array_set( \
91 (const afw_associative_array_t *)instance, \
92 key, ( const void * )value, xctx); \