18 #define impl_afw_value_optional_release NULL
19 #define impl_afw_value_get_reference NULL
23 #define impl_afw_value_get_evaluated_meta \
24 afw_value_internal_get_evaluated_meta_default
26 #define impl_afw_value_get_evaluated_metas \
27 afw_value_internal_get_evaluated_metas_default
30 #define AFW_IMPLEMENTATION_ID "call_built_in_function"
31 #define AFW_IMPLEMENTATION_INF_SPECIFIER AFW_DEFINE_CONST_DATA
32 #define AFW_IMPLEMENTATION_INF_LABEL afw_value_call_built_in_function_inf
50 "afw_value_call_built_in_function_create() argv[0] must be "
51 "function definition", xctx);
58 result->args.
argc = argc;
59 result->args.
argv = argv;
66 afw_value_call_built_in_function(
77 contextual, argc, argv, p, xctx);
101 xctx->error->
contextual =
self->args.contextual;
110 x.
argv =
self->args.argv;
111 x.
argc =
self->args.argc;
141 if (self->function->execute ==
148 " requires first parameter not be undefined",
187 impl_afw_value_get_data_type(
198 impl_afw_value_get_evaluated_data_type(
210 impl_afw_value_get_evaluated_data_type_parameter(
223 impl_afw_value_produce_compiler_listing(
231 afw_value_compiler_listing_begin_value(writer, instance,
232 self->args.contextual, xctx);
237 afw_value_compiler_listing_call_args(writer, &self->args, xctx);
250 impl_afw_value_decompile(
274 impl_afw_value_get_info(
284 info->detail = &
self->function->functionId;
285 info->value_inf_id = &instance->inf->rti.implementation_id;
286 info->contextual =
self->args.contextual;
AFW_DEFINE(const afw_object_t *)
#define AFW_DEFINE_INTERNAL(type)
Define an internal function for /src/afw/ source*.c files.
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
apr_size_t afw_size_t
size_t.
#define AFW_SIZE_T_FMT
Format string specifier used for afw_size_t.
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.
#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.
#define AFW_FUNCTION_EXECUTE_STANDARD_POLYMORPHIC_FUNCTION_HANDLING
Function execute is handled by standard polymorphic function handling.
afw_function_evaluate_parameter(afw_function_execute_t *x, afw_size_t parameter_number, const afw_data_type_t *data_type)
Evaluate a parameter and convert if necessary.
#define afw_memory_clear(to)
Clear preallocated memory for sizeof(*(to)).
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
const afw_value_t * impl_afw_value_optional_evaluate(const afw_value_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
#define afw_value_get_data_type(instance, xctx)
Call method get_data_type of interface afw_value.
afw_value_call_built_in_function_inf
Value call inf.
#define afw_value_is_function_definition(A_VALUE)
Macro to determine if value is a function definition.
afw_value_call_built_in_function_create(const afw_compile_value_contextual_t *contextual, afw_size_t argc, const afw_value_t *const *argv, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for call_built_in_function value.
#define afw_writer_increment_indent(instance, xctx)
Call method increment_indent of interface afw_writer.
#define afw_writer_write_eol(instance, xctx)
Call method write_eol of interface afw_writer.
#define afw_writer_decrement_indent(instance, xctx)
Call method decrement_indent of interface afw_writer.
#define afw_writer_write_z(writer, s_z, xctx)
Call afw_writer_write() with zero terminated string.
#define afw_xctx_evaluation_stack_push_value(VALUE, xctx)
Push VALUE onto execution stack.
#define afw_xctx_evaluation_stack_pop_value(xctx)
Pop top VALUE off execution stack.
Contextual information provided in some values.
Interface afw_data_type public struct.
const afw_compile_value_contextual_t * contextual
Contextual information or NULL.
Function execute parameter.
const afw_value_t *const * argv
This is the function parameters.
afw_xctx_t * xctx
The execution context (xctx) of caller.
const afw_value_function_definition_t * function
The evaluated function definition.
const afw_pool_t * p
Pool for result.
const afw_data_type_t * data_type
This is the <dataType> for data type functions or NULL.
const afw_value_call_built_in_function_t * self
self of call_built_in_function.
afw_size_t argc
This is the argv count not counting argv[0].
const afw_value_t * first_arg
This is the evaluated first parameter if data type function.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
const afw_value_t *const * argv
const afw_compile_value_contextual_t * contextual
Struct for function value.
afw_integer_t numberOfRequiredParameters
The number of required parameters.
afw_function_execute_cb_t execute
Function called to execute this Adaptive function.
afw_integer_t dataTypeMethodNumber
Data type member number.
afw_utf8_t functionId
Function id of function.
afw_integer_t maximumNumberOfParameters
The maximum number of required parameters or -1 is no max.
Filled in by afw_value get_info method.
Interface afw_value public struct.
Interface afw_writer public struct.
Interface afw_xctx public struct.