41 a = function->parameters,
44 minArgs_found =
false;
50 "minArgs must be on last parameter", xctx);
52 if ((*a)->minArgs == -1) {
59 if (!args && parent_request) {
65 for (varg = vargs; *varg; varg++) {
75 for (i = 1, a = function->parameters; i <= argc; i++, a++) {
78 if ((*a)->minArgs == -1) {
96 else if (parent_request) {
103 if ((*a)->data_type &&
107 (*a)->data_type,
true, p, xctx);
112 else if (!(*a)->optional) {
121 for (varg = vargs; *varg; varg++, i++) {
125 if ((*a)->data_type &&
129 (*a)->data_type,
true, p, xctx);
137 if (!value && parent_request) {
146 result = afw_value_call_built_in_function(
147 contextual,
function, argc, argv, p, xctx);
157 " returned a value that is not fully evaluated. ("
173 &afw_s_resultDataType, &data_type->data_type_id, xctx);
180 impl_add_stream_properties(
257 action_response_entry = NULL;
262 name = &afw_s_actions;
265 name = &afw_s_function;
269 "Either actions or function property must be specified",
285 impl_call_function(contextual,
function, NULL,
286 request, response_content_type, response,
290 &afw_s_success, xctx);
299 "Property %" AFW_UTF8_FMT " of actions is missing or invalid",
305 action_response_entries = NULL;
310 action_response_entries, xctx);
314 for (iterator = NULL, action_number = 1; ; action_number++) {
324 "Entries in actions list must be objects",
339 action_response_entry, response->p, xctx);
342 action_response_entry_value, xctx);
346 name = &afw_s_function;
355 " is missing or invalid",
371 "action%d", action_number);
372 impl_call_function(contextual,
function, request,
373 action_entry, response_content_type, action_response_entry,
378 impl_add_stream_properties(action_response_entry, p, xctx);
383 response_content_type,
384 action_response_entry_value,
385 NULL, (
void *)stream, stream->write_cb,
394 &afw_s_success, xctx);
401 &afw_s_status, &afw_s_error, xctx);
406 if (action_number > 0) {
408 &afw_s_actionNumber, action_number, xctx);
413 impl_add_stream_properties(response, p, xctx);
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
afw_action_perform(const afw_object_t *request, const afw_content_type_t *response_content_type, const afw_object_t *response, const afw_pool_t *p, afw_xctx_t *xctx)
Perform actions(s) specified in AdaptiveActions object.
afw_object_set_property_as_integer(const afw_object_t *object, const afw_utf8_t *property_name, afw_integer_t internal, afw_xctx_t *xctx)
Set property function for data type integer values.
#define afw_value_is_list(A_VALUE)
Macro to determine if value is evaluated list.
afw_object_set_property_as_list(const afw_object_t *object, const afw_utf8_t *property_name, const afw_list_t *internal, afw_xctx_t *xctx)
Set property function for data type list values.
#define afw_value_is_object(A_VALUE)
Macro to determine if value is evaluated object.
afw_data_type_object
Data type struct for object.
afw_value_create_object(const afw_object_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type object 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_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
struct afw_iterator_s afw_iterator_t
#define AFW_UTF8_FMT_OPTIONAL_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify optional arg.
#define AFW_INTEGER_FMT
Format string specifier used for afw_integer_t.
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
apr_size_t afw_size_t
size_t.
apr_int64_t afw_integer_t
typedef for big signed int.
#define afw_content_type_write_value(instance, value, options, context, callback, p, xctx)
Call method write_value of interface afw_content_type.
#define afw_content_type_is_application_afw(instance)
Determine if content type it application/x-afw.
const afw_value_function_definition_t * afw_environment_get_function(const afw_utf8_t *function_id, afw_xctx_t *xctx)
Get the function instance associated with function id.
#define AFW_FINALLY
Always executed regardless of error.
#define AFW_CATCH_UNHANDLED
Catch an unhandled error that occurs in a AFW_TRY block.
#define AFW_ENDTRY
Ends an AFW try block.
void afw_error_add_to_object(const afw_object_t *object, const afw_error_t *error, afw_xctx_t *xctx)
Add error info to existing object using specified pool.
#define AFW_TRY
Begin an AFW TRY block.
#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_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
afw_boolean_t afw_flag_by_id_is_active(const afw_utf8_t *flag_id, afw_xctx_t *xctx)
Determine if flag for flag id is set in xctx.
afw_flag_set_to_defaults_plus_array(const afw_utf8_t *const *flag_ids, afw_xctx_t *xctx)
Set xctx default flags plus one or more additional flags.
#define afw_list_get_next_value(instance, iterator, p, xctx)
Call method get_next_value of interface afw_list.
afw_list_add_value(const afw_list_t *instance, const afw_value_t *value, afw_xctx_t *xctx)
Call method add_value of interface afw_list_setter.
#define afw_list_of_create(data_type, p, xctx)
Create an list of a specific data type in memory.
#define afw_object_get_property(instance, property_name, xctx)
Call method get_property of interface afw_object.
#define afw_object_release(instance, xctx)
Call method release of interface afw_object.
#define afw_object_create_managed(p, xctx)
Create an empty entity object in its own pool.
#define afw_object_create(p, xctx)
Create an empty unmanaged object in memory.
const afw_object_t * afw_object_create_merged(const afw_object_t *primary, const afw_object_t *secondary, const afw_pool_t *p, afw_xctx_t *xctx)
Create a memory object with properties from two other objects.
afw_object_set_property(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
Set the value of an object's property.
const afw_object_t * afw_object_create_embedded(const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Create an empty embedded object in a memory object.
#define afw_pool_calloc(instance, size, xctx)
Call method calloc of interface afw_pool.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
#define afw_stream_flush(instance, xctx)
Call method flush of interface afw_stream.
#define afw_stream_standard_is_set(enum_suffix, xctx)
Determine if an xctx's standard stream is set.
#define afw_stream_standard(enum_suffix, xctx)
Get xctx stream instance.
#define afw_stream_standard_release(enum_suffix, xctx)
Release an xctx's stream.
void afw_utf8_stream_get_current_cached_string(const afw_stream_t *stream, afw_utf8_t *current_cached_string, afw_xctx_t *xctx)
Get the current string in a UTF-8 writer.
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.
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.
#define afw_value_get_info(instance, info, p, xctx)
Call method get_info of interface afw_value.
afw_value_as_array_of_utf8(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Return a NULL terminated list of utf8 in a specified pool.
#define afw_value_quick_data_type(A_VALUE)
Get the easily accessible data type for a value.
afw_value_as_utf8(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
afw_value_convert(const afw_value_t *value, const afw_data_type_t *to_data_type, afw_boolean_t required, const afw_pool_t *p, afw_xctx_t *xctx)
Convert a value to a value/data type.
afw_value_is_fully_evaluated(const afw_value_t *value, afw_xctx_t *xctx)
Determine if value and all of it contained values are evaluated.
afw_value_true
Adaptive value true.
afw_value_as_array_of_values(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Return a NULL terminated list of values in a specified pool.
Contextual information provided in some values.
const afw_utf8_t * source_location
Source location.
Interface afw_content_type public struct.
Interface afw_data_type public struct.
Interface afw_list public struct.
Interface afw_object public struct.
Interface afw_pool public struct.
Interface afw_stream public struct.
NFC normalized UTF-8 string.
Struct for function value.
Struct for adaptive function parameter.
Filled in by afw_value get_info method.
struct for data type list values.
struct for data type object values.
Interface afw_value public struct.
Interface afw_xctx public struct.