15 #include "afw_config.h"
18 #include <libxml/xmlversion.h>
35 afw_error_code_general,
37 "Early error creating environment",
43 impl_check_manifest_cb(
52 impl_internal_additional_register_default(
57 const void *register_additional_param,
58 const void **register_additional_use,
67 type = apr_hash_get(env->registry_names_ht, type_id->s, type_id->len);
79 type->object_type_id, key,
80 (
void *)value,
true, xctx);
92 impl_internal_additional_register_log_type(
97 const void *register_additional_param,
98 const void **register_additional_use,
101 impl_internal_additional_register_default(type_id, type_number,
103 register_additional_param, register_additional_use, xctx);
112 impl_internal_additional_register_key_only(
117 const void *register_additional_param,
118 const void **register_additional_use,
128 type = apr_hash_get(env->registry_names_ht, type_id->s, type_id->len);
139 type->object_type_id, key, (
void *)ps,
true, xctx);
152 impl_internal_additional_register_object(
157 const void *register_additional_param,
158 const void **register_additional_use,
167 type = apr_hash_get(env->registry_names_ht, type_id->s, type_id->len);
203 impl_initial_types[] = {
204 #define XX(id, register_additional, allow_reregister, property_name, \
205 object_type_id, description) \
207 AFW_UTF8_LITERAL(AFW_STRINGIFY(id)), \
208 AFW_UTF8_LITERAL(AFW_STRINGIFY(id)), \
209 AFW_UTF8_LITERAL(object_type_id), \
210 AFW_UTF8_LITERAL(description), \
211 register_additional, \
223 unsigned int version,
224 int argc, const
char * const *argv,
242 rv = apr_initialize();
243 if (rv != APR_SUCCESS) {
244 *environment_create_error = &impl_early_error;
249 p = afw_pool_internal_create_base_pool();
250 if (!p)
goto early_error;
255 *environment_create_error = &impl_early_error;
260 AFW_ERROR_INTERNAL_ON_UNHANDLED(unhandled_error) {
261 *environment_create_error = error;
278 "apr_pcalloc() failed");
294 env->base_xctx = xctx;
303 40,
sizeof(apr_array_header_t *));
309 for (s = name->s = argv[0]; *s; s++) {
310 if (*s ==
'/' || *s ==
'\\') {
314 name->len = strlen(name->s);
318 xctx->name = &impl_default_name;
320 env->pub.program_name.s = xctx->name->s;
321 env->pub.program_name.len = xctx->name->len;
328 afw_xctx_internal_create_finishup(xctx);
335 env->registry_types =
341 for (i = 0; i < afw_environemnt_registry_type_max_core_type; i++) {
344 APR_ARRAY_PUSH(env->registry_types,
346 type->registry_type_id = &impl_initial_types[i].registry_type_id;
347 type->property_name = &impl_initial_types[i].property_name;
348 type->object_type_id = &impl_initial_types[i].object_type_id;
349 type->description = &impl_initial_types[i].description;
351 type->register_additional = impl_initial_types[i].register_additional;
352 type->allow_reregister = impl_initial_types[i].allow_reregister;
353 type->auto_register = NULL;
356 apr_hash_set(env->registry_names_ht,
357 type->registry_type_id->s, type->registry_type_id->len, type);
364 for (i = 0; i < env->registry_types->nelts; i++) {
365 type = APR_ARRAY_IDX(env->registry_types, i,
369 type->registry_type_id, type,
true, xctx);
371 afw_environemnt_registry_type_registry_type,
372 type->property_name, (
void *)type, xctx);
377 afw_lock_create_environment_lock(
378 &afw_s_a_lock_multithreaded_pool, p, xctx);
383 &afw_s_a_lock_environment,
384 &afw_s_a_lock_environment_brief,
385 &afw_s_a_lock_environment_description,
391 &afw_s_a_lock_adaptor_id_anchor,
392 &afw_s_a_lock_adaptor_id_anchor_brief,
393 &afw_s_a_lock_adaptor_id_anchor_description,
399 &afw_s_a_lock_authorization_handler_id_anchor,
400 &afw_s_a_lock_authorization_handler_id_anchor_brief,
401 &afw_s_a_lock_authorization_handler_id_anchor_description,
407 &afw_s_a_lock_log_list,
408 &afw_s_a_lock_log_list_brief,
409 &afw_s_a_lock_log_list_description,
416 &afw_s_a_lock_flags_brief,
417 &afw_s_a_lock_flags_description,
425 AFW_ERROR_INTERNAL_ON_UNHANDLED(unhandled_error) {
431 *environment_create_error = NULL;
459 void * register_additional_param,
468 type = apr_hash_get(env->registry_names_ht, registry_type_id->s,
469 registry_type_id->len);
472 "registry_type \"%" AFW_UTF8_FMT "\" is already assigned",
480 APR_ARRAY_PUSH(env->registry_types,
488 type->description =
afw_utf8_clone(description, xctx->env->p, xctx);
489 type->number = env->registry_types->nelts - 1;
491 type->allow_reregister = allow_reregister;
492 type->auto_register = auto_register;
493 type->auto_register_specified = auto_register != NULL;
494 type->register_additional = register_additional;
495 type->register_additional_param = register_additional_param;
496 apr_hash_set(env->registry_names_ht,
497 type->registry_type_id->s, type->registry_type_id->len, type);
500 type->registry_type_id, type,
true, xctx);
502 afw_environemnt_registry_type_registry_type,
503 type->property_name, (
void *)type, xctx);
526 env->registry_names_ht,
528 registry_type_id->len);
530 if (!type && load_extension) {
531 ctx.type = &afw_s_registry_type;
532 ctx.key = registry_type_id;
534 &ctx, impl_check_manifest_cb, xctx);
536 env->registry_names_ht,
538 registry_type_id->len);
550 int registry_type_number,
558 if (registry_type_number >= env->registry_types->nelts) {
564 [registry_type_number];
581 const void *old_value;
590 if (type_number >= env->registry_types->nelts) {
598 old_value = apr_hash_get(type->ht, key->s, key->len);
599 if (old_value && !type->allow_reregister) {
603 &impl_initial_types[type_number].registry_type_id),
607 if (value && !old_value) {
609 memcpy(new_key, key->s, key->len);
613 apr_hash_set(type->ht, use_key, key->len, value);
615 if (type->register_additional) {
616 type->register_additional(
617 type->registry_type_id, type->number, key, value,
618 type->register_additional_param, &type->register_additional_use,
628 impl_check_manifest_cb(
648 if (!registers_value) {
660 for (iterator = NULL;;)
663 (
const void **)&entry, xctx);
673 registry_type_id.s = entry->s,
674 registry_key.s = entry->s,
675 registry_key.len = entry->len;
676 registry_key.len > 0 && *registry_key.s !=
'/';
677 registry_key.len--, registry_key.s++);
679 if (registry_key.len > 0)
681 registry_type_id.len = registry_key.s - registry_type_id.s;
688 &afw_s_extensionId, xctx);
690 &afw_s_modulePath, xctx);
691 if (extension_id && module_path) {
721 if (type_number < 0 ||
722 type_number >= env->registry_types->nelts)
731 result = (apr_hash_get(type->ht, key->s, key->len) != NULL);
756 if (type_number < 0 ||
757 type_number >= env->registry_types->nelts)
766 result = apr_hash_get(type->ht, key->s, key->len);
773 ctx.type = type->registry_type_id;
776 &ctx, impl_check_manifest_cb, xctx);
777 result = apr_hash_get(type->ht, key->s, key->len);
781 if (!result && type->auto_register) {
782 result = type->auto_register(type->registry_type_id, key, xctx);
795 afw_environment_registry_get_xctxless(
806 if (type_number < 0 ||
807 type_number >= self->registry_types->nelts)
815 result = apr_hash_get(type->ht, key->s, key->len);
833 apr_hash_index_t *hi;
840 if (type_number >= env->registry_types->nelts) {
851 hi = apr_hash_next(hi))
853 apr_hash_this(hi, (
const void **)&key_s, &key_len, &value);
854 if (callback(type_number, data, key_s, key_len, value, p, xctx)) {
877 const
afw_utf8_t *subtype_runtime_object_type_id,
892 conf_type->
create = create;
913 afw_environemnt_registry_type_conf_type,
929 apr_dso_handle_t *dso_handle;
949 &afw_s_extensionId, xctx);
954 ") does not match properties.extension_id (%" AFW_UTF8_FMT,
961 &afw_s_modulePath, xctx);
966 ") does not match properties.extension_id (%" AFW_UTF8_FMT,
973 if (!extension_id && !module_path) {
975 "Either extension_id or module_path must be supplied",
984 extension_id_for_message = extension_id;
988 afw_environemnt_registry_type_extension,
1000 &afw_s_extensionId, extension_id, xctx);
1005 extension_id, xctx);
1008 &afw_s_modulePath, xctx);
1014 "\"modulePath\" needed for \"extension\" %" AFW_UTF8_FMT ".",
1025 &afw_s_type, &afw_s_extension, xctx);
1034 extension_id_for_message = &afw_s_unknown;
1041 &afw_s_modulePath, module_path, xctx);
1048 rv = apr_dso_load(&(dso_handle), (
const char *)path_z,
1050 if (rv != APR_SUCCESS) {
1057 rv = apr_dso_load(&(dso_handle), (
const char *)path_z,
1061 if (rv != APR_SUCCESS) {
1065 rv = apr_dso_load(&(dso_handle), (
const char *)path_z,
1067 if (rv != APR_SUCCESS) {
1074 rv = apr_dso_load(&(dso_handle), (
const char *)path_z,
1080 if (rv != APR_SUCCESS) {
1081 memset(&dsoError, 0,
sizeof(dsoError));
1082 apr_dso_error(dso_handle, dsoError,
sizeof(dsoError));
1086 " modulePath=%s: %s",
1091 rv = apr_dso_sym((apr_dso_handle_sym_t *)&extension_instance,
1093 if (rv != APR_SUCCESS) {
1094 apr_dso_unload(dso_handle);
1106 if (extension_id_for_message == &afw_s_unknown) {
1107 extension_id = &(*extension_instance)->extension_id;
1109 afw_environemnt_registry_type_extension,
1110 extension_id, xctx);
1118 &(*extension_instance)->extension_id,
1119 (*extension_instance)->afw_compiled_version_hex,
1124 (*extension_instance), properties, p, xctx);
1125 extension_id = &extension->extension_id;
1129 &afw_s_extensionId, extension_id, xctx);
1133 afw_environemnt_registry_type_extension,
1134 extension_id, extension, xctx);
1156 apr_array_header_t **h;
1170 if (data_type->data_type_number == 0) {
1173 dt->data_type_number = env->data_type_methods->nelts;
1178 else if (env->core_data_types_registered) {
1180 "Only core data types can have preassigned data type number",
1185 while (env->data_type_methods->nelts < data_type->data_type_number) {
1186 APR_ARRAY_PUSH(env->data_type_methods, apr_array_header_t *) = NULL;
1188 h = &((apr_array_header_t **)env->data_type_methods->elts)
1189 [data_type->data_type_number - 1];
1192 "Data type number %d is already registered.",
1193 data_type->data_type_number);
1196 30,
sizeof(apr_array_header_t *));
1200 afw_environemnt_registry_type_data_type,
1213 impl_resolve_function_parameter(
1230 if (parameter->dataType.s) {
1242 impl_resolve_function(
1260 object->internal = result;
1271 result->
returns = impl_resolve_function_parameter(function->returns, xctx);
1274 for (count = 0;
function->parameters[count]; count++);
1278 parameters[count] = NULL;
1280 for (count = 0;
function->parameters[count]; count++) {
1282 impl_resolve_function_parameter(
1283 function->parameters[count],
1302 apr_array_header_t *methods;
1305 if (!function->inf) {
1306 function = impl_resolve_function(
function, xctx);
1319 if (function->dataType.len > 0 && !function->data_type) {
1325 &function->dataType, xctx);
1326 if (!function->data_type) {
1331 if (function->dataTypeMethodNumber != 0)
1334 "Only core function can have preassigned "
1335 "dataTypeMethodNumber",
1338 method_number = apr_hash_get(
1339 env->data_type_method_number_ht,
1340 function->untypedFunctionId.s,
1341 function->untypedFunctionId.len);
1342 if (method_number) {
1347 env->data_type_method_number_ht) + 1;
1348 apr_hash_set(env->data_type_method_number_ht,
1349 function->untypedFunctionId.s,
1350 function->untypedFunctionId.len,
1351 &function->dataTypeMethodNumber);
1359 if (env->core_functions_registered &&
1360 function->dataTypeMethodNumber != 0)
1363 "Only core function can have preassigned function number",
1368 if (function->data_type) {
1370 method_number = apr_hash_get(env->data_type_method_number_ht,
1371 function->untypedFunctionId.s,
1372 function->untypedFunctionId.len);
1373 if (method_number) {
1374 if (function->dataTypeMethodNumber == 0) {
1379 if (function->dataTypeMethodNumber == 0) {
1381 env->data_type_method_number_ht) + 1;
1383 apr_hash_set(env->data_type_method_number_ht,
1384 function->untypedFunctionId.s,
1385 function->untypedFunctionId.len,
1386 &function->dataTypeMethodNumber);
1392 afw_environemnt_registry_type_function,
1398 if (function->camelCaseFunctionLabel.len > 0 &&
1402 afw_environemnt_registry_type_function,
1403 &function->camelCaseFunctionLabel,
1409 if (function->afwCamelCaseFunctionLabel.len > 0 &&
1410 !
afw_utf8_equal(&function->afwCamelCaseFunctionLabel, function_id)
1413 &function->camelCaseFunctionLabel)
1417 afw_environemnt_registry_type_function,
1418 &function->afwCamelCaseFunctionLabel,
1424 if (function->afwCamelCaseFunctionLabel.len > 0 &&
1428 &function->functionLabel)
1431 &function->camelCaseFunctionLabel)
1435 afw_environemnt_registry_type_function,
1436 &function->functionLabel,
1442 if (function->dataType.len > 0) {
1443 methods = ((apr_array_header_t **)env->data_type_methods->elts)
1444 [
function->data_type->data_type_number - 1];
1445 while (methods->nelts < function->dataTypeMethodNumber) {
1450 [
function->dataTypeMethodNumber - 1] =
function;
1471 apr_array_header_t *methods;
1475 if (qualifier && qualifier->s) {
1480 method_number = apr_hash_get(env->data_type_method_number_ht,
1481 name->s, name->len);
1482 if (method_number) {
1483 methods = ((apr_array_header_t **)
1484 env->data_type_methods->elts)
1485 [data_type->data_type_number - 1];
1486 if (*method_number <= methods->nelts) {
1488 methods->elts)[(*method_number) - 1];
1497 afw_environemnt_registry_type_function, name, xctx);
1514 apr_array_header_t *d;
1526 if (data_type->data_type_number > env->data_type_methods->nelts) {
1530 d = ((apr_array_header_t **)env->data_type_methods->elts)
1531 [data_type->data_type_number - 1];
1532 if (dataTypeMethodNumber <= d->nelts) {
1534 [dataTypeMethodNumber - 1];
1552 for (e = data_types; *e; e++) {
1554 &(*e)->data_type_id, *e, xctx);
1568 for (
function = functions; *
function;
function++) {
1591 afw_environemnt_registry_type_adaptor_type,
1605 "This produces a basic plus additional detail trace for "
1610 &afw_s_a_flag_trace_adaptor_detail, xctx);
1621 "This produces a basic trace of all adaptors of type %" AFW_UTF8_FMT ".",
1625 &afw_s_a_flag_trace_adaptor, xctx);
1637 const
afw_utf8_t *authorization_handler_type,
1650 afw_environemnt_registry_type_authorization_handler_type,
1651 authorization_handler_type,
1652 authorization_handler_factory,
1656 "trace:authorizationHandlerType:%" AFW_UTF8_FMT ":detail",
1660 "Debug trace authorizationHandler type %" AFW_UTF8_FMT,
1664 "This produces a basic plus additional detail trace for "
1665 "all authorizationHandlers of type %" AFW_UTF8_FMT ".",
1669 &afw_s_a_flag_trace_authorizationHandler_detail, xctx);
1680 "This produces a basic trace of all authorizationHandlers "
1685 &afw_s_a_flag_trace_authorizationHandler, xctx);
AFW_DEFINE(const afw_object_t *)
#define AFW_DECLARE(type)
Declare a public afw function.
Adaptive Framework Core Internal.
afw_runtime_inf__AdaptiveFunction_
Runtime object inf for object type AdaptiveFunction
afw_runtime_inf__AdaptiveEnvironmentRegistryType_
Runtime object inf for object type AdaptiveEnvironmentRegistryType
afw_runtime_inf__AdaptiveFunctionParameter_
Runtime object inf for object type AdaptiveFunctionParameter
afw_authorization_mode_id_core_value
AdaptiveAuthorizationMode core.
#define afw_value_is_list_of_anyURI(A_VALUE)
Macro to determine if value is evaluated list of anyURI.
#define afw_object_old_get_property_as_string(object, property_name, xctx)
Get property function for data type string value.
afw_object_set_property_as_string(const afw_object_t *object, const afw_utf8_t *property_name, const afw_utf8_t *internal, afw_xctx_t *xctx)
Set property function for data type string values.
#define afw_value_is_list_of_string(A_VALUE)
Macro to determine if value is evaluated list of string.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
#define AFW_UTF8_LITERAL(A_STRING)
String literal initializer.
struct afw_iterator_s afw_iterator_t
#define AFW_ENVIRONMENT_DEFAULT_EVALUATION_STACK_MAXIMUM_COUNT
Default for afw_environment_t evaluation_stack_maximum_count.
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
afw_utf8_octet_t afw_utf8_z_t
NFC normalized UTF-8 null terminated string.
char afw_utf8_octet_t
8 bits of utf-8 codepoint.
apr_size_t afw_size_t
size_t.
#define AFW_ENVIRONMENT_DEFAULT_EVALUATION_STACK_INITIAL_COUNT
Default for afw_environment_t evaluation_stack_initial_count.
#define AFW__FILE_LINE__
file:line
apr_int64_t afw_integer_t
typedef for big signed int.
void afw_environment_internal_register_core(afw_xctx_t *xctx)
afw_environment_set_stdout_fd(FILE *fd, afw_xctx_t *xctx)
Override fd used for stdout.
const afw_environment_registry_type_t * afw_environment_get_registry_type_by_id(const afw_utf8_t *registry_type_id, afw_boolean_t load_extension, afw_xctx_t *xctx)
Get the registry type associated with a registry type id.
afw_environment_create_registry_type(const afw_utf8_t *registry_type_id, const afw_utf8_t *property_name, const afw_utf8_t *object_type_id, const afw_utf8_t *description, afw_boolean_t allow_reregister, afw_environment_auto_register_cb_t auto_register, afw_environment_register_additional_cb_t register_additional, void *register_additional_param, afw_xctx_t *xctx)
Create a new registry type.
afw_environment_registry_key_exists(int type_number, const afw_utf8_t *key, afw_xctx_t *xctx)
Check to see if a key exists.
afw_environment_registry_get_data_type_method(const afw_data_type_t *data_type, afw_integer_t dataTypeMethodNumber, afw_xctx_t *xctx)
Get the function associated with a data type method.
afw_environment_register_data_types(const afw_data_type_t *const *data_types, afw_xctx_t *xctx)
Register a NULL terminated list of data types.
afw_environment_get_registry_type_by_number(int registry_type_number, afw_xctx_t *xctx)
Get the registry type associated with a registry type number.
const afw_object_t * afw_environment_prepare_conf_type_properties(const afw_object_t *properties, afw_xctx_t *xctx)
Prepare properties for a conf type.
#define afw_environment_register_flag(flag_id, brief, description, included_by_flag_id, xctx)
Register a flag.
afw_environment_register_adaptor_type(const afw_utf8_t *adaptor_type, const afw_adaptor_factory_t *adaptor_factory, afw_xctx_t *xctx)
Register an adaptor factory.
afw_environment_get_qualified_function(const afw_utf8_t *qualifier, const afw_utf8_t *name, afw_xctx_t *xctx)
Get the qualified function instance.
afw_environment_load_extension(const afw_utf8_t *extension_id, const afw_utf8_t *module_path, const afw_object_t *properties, afw_xctx_t *xctx)
Load and initialize environment extension.
afw_environment_create(unsigned int version, int argc, const char *const *argv, const afw_error_t **environment_create_error)
Create the Adaptive Framework core environment and return base xctx.
afw_environment_create_and_register_conf_type(const afw_utf8_t *conf_type_id, afw_environment_conf_type_create_cede_p_t create, const afw_utf8_t *title, const afw_utf8_t *description, const afw_utf8_t *id_property_name, const afw_utf8_t *id_registry_type_id, const afw_utf8_t *id_runtime_object_type_id, const afw_utf8_t *subtype_property_name, const afw_utf8_t *subtype_registry_type_id, const afw_utf8_t *subtype_runtime_object_type_id, afw_boolean_t is_unique, afw_xctx_t *xctx)
Create and register a configuration (conf) type.
const afw_data_type_t * afw_environment_get_data_type(const afw_utf8_t *type, afw_xctx_t *xctx)
Get the data_type associated with configuration entry type.
afw_environment_registry_register(int type_number, const afw_utf8_t *key, const void *value, afw_xctx_t *xctx)
Register a value by key for a registry type.
#define AFW_ENVIRONMENT_REGISTRY_TYPE_MAP(XX)
Environment Core Registry Type Map.
afw_environment_register_functions(const afw_value_function_definition_t **functions, afw_xctx_t *xctx)
Register a NULL terminated list of functions.
afw_boolean_t(* afw_environment_foreach_cb_t)(int type_number, void *data, const afw_utf8_octet_t *key_s, afw_size_t key_len, void *value, const afw_pool_t *p, afw_xctx_t *xctx)
Callback function typedef for afw_environment_foreach().
void(* afw_environment_conf_type_create_cede_p_t)(const afw_utf8_t *type, const afw_object_t *conf, const afw_utf8_t *source_location, const afw_pool_t *p, afw_xctx_t *xctx)
Typedef for afw conf type create functions.
void(* afw_environment_register_additional_cb_t)(const afw_utf8_t *registry_type_id, int type_number, const afw_utf8_t *key, const void *value, const void *register_additional_param, const void **register_additional_use, afw_xctx_t *xctx)
Additional register callback function.
afw_environment_register_authorization_handler_type(const afw_utf8_t *authorization_handler_type, const afw_authorization_handler_factory_t *authorization_handler_factory, afw_xctx_t *xctx)
Register an authorization handler factory.
afw_environment_foreach(int type_number, afw_environment_foreach_cb_t callback, void *data, const afw_pool_t *p, afw_xctx_t *xctx)
Call a callback function for each entry of a registry type.
afw_environment_register_function(const afw_utf8_t *function_id, const afw_value_function_definition_t *function, afw_xctx_t *xctx)
Register a function.
afw_environment_release(afw_xctx_t *xctx)
Create the Adaptive Framework core environment and return base xctx.
afw_environment_registry_get(int type_number, const afw_utf8_t *key, afw_xctx_t *xctx)
Get the value associated with a key for a registry type.
void *(* afw_environment_auto_register_cb_t)(const afw_utf8_t *registry_type_id, const afw_utf8_t *key, afw_xctx_t *xctx)
Auto register callback function.
afw_environment_set_stderr_fd(FILE *fd, afw_xctx_t *xctx)
Override fd used for stderr.
afw_environment_set_debug_fd(FILE *fd, afw_xctx_t *xctx)
Override fd used for debug.
#define AFW_ENVIRONMENT_Q_EXTENSION_INSTANCE
environment extension instance quoted string.
afw_environment_register_data_type(const afw_utf8_t *data_type_id, const afw_data_type_t *data_type, afw_xctx_t *xctx)
Register a data type.
#define AFW_THROW_MEMORY_ERROR(xctx)
#define AFW_THROW_UNHANDLED_ERROR(unhandled_error, _ERROR, _CODE, _RV_SOURCE_ID, _RV, _MESSAGE_Z)
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
#define AFW_THROW_ERROR_RV_FZ(code, rv_source_id, rv, xctx, format_z,...)
Macro used to set error and rv in xctx and throw it.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
#define afw_extension_initialize(instance, properties, p, xctx)
Call method initialize of interface afw_extension.
void afw_flag_add_included_by(const afw_utf8_t *flag_id, const afw_utf8_t *included_by_flag_id, afw_xctx_t *xctx)
Add another include_by flag to a registered flag.
#define afw_list_get_next_internal(instance, iterator, data_type, internal, xctx)
Call method get_next_internal of interface afw_list.
afw_lock_create_rw_and_register(const afw_utf8_t *lock_id, const afw_utf8_t *brief, const afw_utf8_t *description, afw_xctx_t *xctx)
Create a read/write lock and register in environment.
#define AFW_LOCK_BEGIN(instance)
Macro to begin a lock section.
afw_lock_create_and_register(const afw_utf8_t *lock_id, const afw_utf8_t *brief, const afw_utf8_t *description, afw_boolean_t insure_recursive_lock, afw_xctx_t *xctx)
Create a lock and register in environment.
#define AFW_LOCK_END
Macro to end a lock section.
const afw_log_t * afw_log_internal_create_environment_log(afw_xctx_t *xctx)
Internal create environment log.
void afw_log_internal_register_logType_context_type(const afw_utf8_t *log_type_id, afw_xctx_t *xctx)
Register logType context type.
#define AFW_LOG_FZ(priority, xctx, format_z,...)
Log an message to environment's log using a printf style format and parameters.
void * afw_memory_dup(const void *from, apr_size_t size, const afw_pool_t *p, afw_xctx_t *xctx)
Duplicate a block of memory into specified pool.
#define afw_object_get_property(instance, property_name, xctx)
Call method get_property of interface afw_object.
#define afw_object_has_property(instance, property_name, xctx)
Call method has_property of interface afw_object.
#define afw_object_create_managed(p, xctx)
Create an empty entity object in its own pool.
const afw_utf8_t * afw_os_get_dso_suffix()
Return the suffix appended to dso file names for this system.
#define afw_pool_malloc(instance, size, xctx)
Call method malloc of interface afw_pool.
#define afw_pool_calloc(instance, size, xctx)
Call method calloc of interface afw_pool.
#define afw_pool_get_apr_pool(instance)
Call method get_apr_pool of interface afw_pool.
#define afw_pool_release(instance, xctx)
Call method release of interface afw_pool.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
afw_runtime_env_create_and_set_indirect_object(const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, void *internal, afw_boolean_t overwrite, afw_xctx_t *xctx)
Create and set an indirect runtime object.
afw_runtime_env_set_object(const afw_object_t *object, afw_boolean_t overwrite, afw_xctx_t *xctx)
Set an object pointer in the environment's runtime objects.
afw_runtime_remove_object(const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
Remove object by object type id and object id.
afw_runtime_get_object(const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, afw_xctx_t *xctx)
Get a runtime object.
afw_runtime_env_create_and_set_indirect_object_using_inf(const afw_object_inf_t *inf, const afw_utf8_t *object_id, void *internal, afw_boolean_t overwrite, afw_xctx_t *xctx)
Create and set an indirect runtime object.
afw_runtime_foreach(const afw_utf8_t *object_type_id, void *context, afw_object_cb_t callback, afw_xctx_t *xctx)
Call a callback for each runtime object.
afw_utf8_ends_with(const afw_utf8_t *string, const afw_utf8_t *ends_with)
Check to see if a string ends with another string.
afw_boolean_t afw_utf8_equal(const afw_utf8_t *s1, const afw_utf8_t *s2)
Check to see if a string equals another string.
const afw_utf8_z_t * afw_utf8_z_printf(const afw_pool_t *p, afw_xctx_t *xctx, const afw_utf8_z_t *format_z,...)
const afw_utf8_t * afw_utf8_clone(const afw_utf8_t *string, const afw_pool_t *p, afw_xctx_t *xctx)
Clone a utf-8 string into a specific pool.
const afw_utf8_z_t * afw_utf8_to_utf8_z(const afw_utf8_t *string, const afw_pool_t *p, afw_xctx_t *xctx)
Convert utf8 to utf8_z in specified pool.
afw_utf8_printf(const afw_pool_t *p, afw_xctx_t *xctx, const afw_utf8_z_t *format,...)
Create a utf-8 string using a c format string in specified pool.
afw_value_function_definition_inf
Value function inf.
const afw_utf8_z_t * afw_version_check(unsigned int version)
Version check.
#define AFW_VERSION_THROW_ERROR_SUPPLIED_HEX_VERSION_IF_NOT_COMPATIBLE(info, compiled_version, xctx)
Throw error if AFW core is not compatible with the supplied version.
afw_xctx_internal_create_initialize(afw_try_t *unhandled_error, afw_error_t *error, afw_environment_internal_t *env, const afw_pool_t *p)
#define afw_xctx_calloc(size, xctx)
Macro to allocate cleared memory in xctx's pool.
#define afw_xctx_calloc_type(type, xctx)
Macro to allocate cleared memory to hold type in xctx's pool.
Interface afw_adaptor_factory public struct.
Interface afw_authorization_handler_factory public struct.
Interface afw_data_type public struct.
Struct for afw environment conf type.
const afw_utf8_t * subtype_property_name
Subtype property name for instances of this conf type.
const afw_utf8_t * subtype_runtime_object_type_id
Subtype runtime object type for instances of this conf type.
const afw_utf8_t * id_property_name
Id property name for instances of this conf type.
afw_boolean_t is_unique
This conf type can only be specified once.
afw_environment_conf_type_create_cede_p_t create
Create function for this type.
afw_utf8_t conf_type_id
Id of type.
const afw_utf8_t * description
Description of this type.
const afw_utf8_t * title
Title of this type.
const afw_utf8_t * id_runtime_object_type_id
Runtime object type for instances of this conf type.
const afw_utf8_t * subtype_registry_type_id
Subtype registry type for instances of this conf type.
const afw_utf8_t * id_registry_type_id
Registry type for instances of this conf type.
Struct for typedef afw_environment_t defined in afw_common.h.
AFW_ATOMIC afw_integer_t pool_number
Used to give unique number for pool.
FILE * stdout_fd
Open file descriptor used for writing standard output. Default stdout.
const afw_lock_t * multithreaded_pool_lock
Lock used internal to afw_pool.c.
afw_utf8_t application_id
The id of the application.
afw_size_t evaluation_stack_maximum_count
maximum_count used to create xctx's evaluation stack.
const afw_lock_t * active_log_list_lock
Lock for protecting changes to active log list.
const afw_log_t * log
Director log. This log will direct to other logs.
const afw_pool_t * p
Pool used to hold environment.
const afw_lock_t * flags_lock
Lock for protecting changes to flags (internal to afw_flag.c).
const afw_lock_t * adaptor_id_anchor_lock
Lock for protecting changes to adaptor id anchors.
afw_size_t evaluation_stack_initial_count
initial_count used to create xctx's evaluation stack.
FILE * debug_fd
Open file descriptor used for debug writes. Default stderr.
const afw_lock_rw_t * authorization_handler_id_anchor_rw_lock
Lock for protecting changes to authorization handler id anchors.
const afw_lock_t * environment_lock
Lock for whole environment.
FILE * stderr_fd
Open file descriptor used for writing error output. Default stderr.
Adaptive Framework Error.
Interface afw_extension public struct.
Interface afw_list public struct.
Interface afw_object public struct.
Interface afw_pool public struct.
Struct for runtime objects.
NFC normalized UTF-8 string.
Struct for function value.
const afw_value_function_parameter_t *const * parameters
Function parameters.
const afw_object_t * object
Object representing function.
const afw_data_type_t * data_type
If this is a data type method, this is the data type.
afw_integer_t dataTypeMethodNumber
Data type member number.
const afw_value_function_parameter_t * returns
Function returns.
afw_utf8_t dataType
If this is a data type method, this is the data type id.
Struct for adaptive function parameter.
struct for data type list values.
Interface afw_value public struct.
Interface afw_xctx public struct.