18 #define impl_afw_list_get_entry_meta afw_list_impl_get_entry_meta
19 #define impl_afw_list_get_next_entry_meta afw_list_impl_get_next_entry_meta
22 #define AFW_IMPLEMENTATION_ID "afw_list_wrapper_for_array"
23 #define AFW_IMPLEMENTATION_INF_SPECIFIER AFW_DEFINE_CONST_DATA
24 #define AFW_IMPLEMENTATION_INF_LABEL afw_list_wrapper_for_array_inf
26 #undef AFW_IMPLEMENTATION_INF_SPECIFIER
27 #undef AFW_IMPLEMENTATION_INF_LABEL
46 self->internal =
internal;
47 self->data_type = data_type;
49 self->indirect = indirect;
53 for (count = 0, ptr = (
const afw_octet_t *)
internal;
54 *(
const void *
const *)ptr;
55 count++, ptr +=
sizeof(
void *));
58 if (data_type->c_type_size <
sizeof(
const void *
const *)) {
60 "count -1 is not supported for this data type",
63 for (count = 0, ptr = (
const afw_octet_t *)
internal;
64 *(
const void *
const *)ptr;
65 count++, ptr += data_type->c_type_size);
108 self->internal =
internal;
111 self->indirect =
false;
114 for (iterator = NULL;;
125 "data type needed in afw_list_convert_to_list_of_strings()",
180 return self->data_type;
193 const void * *
internal,
204 if (index < 0 || i != index) {
209 else if (self->count == -1) {
210 for (count = 0, e = self->internal;
211 *(
void **)e && count < i;
212 count++, e = ((
void **)e) + 1);
218 if (i > self->count) {
221 else if (self->indirect) {
222 e = *(((
void **)self->internal) + i);
227 (i * self->data_type->c_type_size));
235 *data_type =
self->data_type;
263 const void *
internal;
267 index, &data_type, &
internal, xctx))
270 internal, data_type, p, xctx);
290 const void * *
internal,
303 size = (
self->indirect) ?
sizeof(
void *) :
self->data_type->c_type_size;
307 ((
const afw_octet_t *)self->internal) + (size *
self->count)))
319 *data_type =
self->data_type;
321 if (self->indirect) {
322 *
internal = *(
const void **)*iterator;
325 *
internal = (
const void *)*iterator;
331 return *
internal != NULL;
354 "afw_list_get_next_value() requires p",
364 size = (
self->indirect) ?
sizeof(
void *) :
self->data_type->c_type_size;
368 ((
const afw_octet_t *)self->internal) + (size *
self->count)))
377 (self->indirect) ? *(
void **)*iterator: (
void *)*iterator,
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
afw_data_type_string
Data type struct for string.
struct afw_iterator_s afw_iterator_t
unsigned char afw_byte_t
A byte of memory (unsigned).
apr_size_t afw_size_t
size_t.
unsigned char afw_octet_t
8 bits (unsigned).
apr_int64_t afw_integer_t
typedef for big signed int.
#define afw_data_type_internal_to_utf8(instance, from_internal, p, xctx)
Call method internal_to_utf8 of interface afw_data_type.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
impl_afw_list_get_next_value(const afw_list_t *instance, const afw_iterator_t **iterator, const afw_pool_t *p, afw_xctx_t *xctx)
impl_afw_list_get_entry_internal(const afw_list_t *instance, afw_integer_t index, const afw_data_type_t **data_type, const void **internal, afw_xctx_t *xctx)
impl_afw_list_get_data_type(const afw_list_t *instance, afw_xctx_t *xctx)
impl_afw_list_release(const afw_list_t *instance, afw_xctx_t *xctx)
impl_afw_list_get_next_internal(const afw_list_t *instance, const afw_iterator_t **iterator, const afw_data_type_t **data_type, const void **internal, afw_xctx_t *xctx)
impl_afw_list_get_setter(const afw_list_t *instance, afw_xctx_t *xctx)
impl_afw_list_get_count(const afw_list_t *instance, afw_xctx_t *xctx)
impl_afw_list_get_entry_value(const afw_list_t *instance, afw_integer_t index, const afw_pool_t *p, afw_xctx_t *xctx)
#define afw_list_get_next_value(instance, iterator, p, xctx)
Call method get_next_value of interface afw_list.
#define afw_list_get_data_type(instance, xctx)
Call method get_data_type of interface afw_list.
#define afw_list_get_count(instance, xctx)
Call method get_count of interface afw_list.
afw_list_create_wrapper_for_array(const void *internal, afw_boolean_t indirect, const afw_data_type_t *data_type, afw_size_t count, const afw_pool_t *p, afw_xctx_t *xctx)
Create a immutable list wrapper for an array.
afw_list_wrapper_for_array_inf
inf for afw_list_wrapper_for_array afw_list implementation.
afw_list_convert_to_list_of_strings(const afw_list_t *list, const afw_pool_t *p, afw_xctx_t *xctx)
Convert a list to a list of strings.
#define afw_pool_malloc(instance, size, xctx)
Call method malloc of interface afw_pool.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
#define afw_value_get_data_type(instance, xctx)
Call method get_data_type of interface afw_value.
#define afw_value_evaluate(value, p, xctx)
Evaluate value if needed using specific pool.
const afw_value_t * afw_value_evaluated_create(const void *value, const afw_data_type_t *data_type, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for an evaluated data type value.
Interface afw_data_type public struct.
Interface afw_list public struct.
Interface afw_list_setter public struct.
Self for immutable list wrapper for a array.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Struct to access internal of all evaluated values.
Interface afw_value public struct.
Interface afw_xctx public struct.