Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_associative_array.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework Associative Array
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_ASSOCIATIVE_ARRAY_H__
10 #define __AFW_ASSOCIATIVE_ARRAY_H__
11 
12 #include "afw_interface.h"
13 
28 
29 typedef struct afw_associative_array_s {
30  const afw_pool_t *p;
32 
33 typedef void(*afw_associative_array_add_reference_value_cb)
34  (const void *value, afw_xctx_t *xctx);
35 
36 typedef void(*afw_associative_array_release_value_cb)
37  (const void *value, afw_xctx_t *xctx);
38 
40 afw_associative_array_create(
41  afw_associative_array_add_reference_value_cb add_reference_value,
42  afw_associative_array_release_value_cb release_value,
43  const afw_pool_t *p, afw_xctx_t *xctx);
44 
45 AFW_DECLARE(void)
46 afw_associative_array_release(
47  const afw_associative_array_t *instance,
48  afw_xctx_t *xctx);
49 
50 AFW_DECLARE(void)
51 afw_associative_array_add_reference(
52  const afw_associative_array_t *instance,
53  afw_xctx_t *xctx);
54 
55 AFW_DECLARE(const void *)
56 afw_associative_array_get(
57  const afw_associative_array_t *instance,
58  const afw_utf8_t *key, afw_xctx_t *xctx);
59 
60 AFW_DECLARE(const void *)
61 afw_associative_array_get_reference(
62  const afw_associative_array_t *instance,
63  const afw_utf8_t *key, afw_xctx_t *xctx);
64 
65 AFW_DECLARE(void)
66 afw_associative_array_for_each(
67  const afw_associative_array_t *instance,
68  void *context, afw_value_cb_t callback, afw_xctx_t *xctx);
69 
70 AFW_DECLARE(void)
71 afw_associative_array_set(
72  const afw_associative_array_t *instance,
73  const afw_utf8_t *key, const void *value, afw_xctx_t *xctx);
74 
75 
76 AFW_END_DECLARES
77 
80 #endif /* __AFW_ASSOCIATIVE_ARRAY_H__ */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
afw_boolean_t(* afw_value_cb_t)(const void *value, void *context, afw_xctx_t *xctx)
Typedef for value callback.
Definition: afw_common.h:1190
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_xctx public struct.