Previous: Pass By Reference Example, Up: Functions
Function specific data sets may be indicated to be supplied to the methods implementing the function logics, together with the general execution context.
If accessing a specific data context is desired, the function definition must
include the X1f4_E4_TEXT_LINK
bit in its flags
field.
See Function Flags.
Whenever the expression parser picks up a reference to a function requiring a
specific execution context it calls the function_set.fix
method of the
struct x1f4_attributes_type
expression parsing context, immediately
after the function_set.get
call that looked up the function. The
function_set.fix
method is supplied the function lookup context as first
argument (the function_set.context
field in the parsing context) and the
function definition as the second (as retrieved via the immediately preceding
function_set.get
call). The function_set.fix
method is expected
to set the context reference (void pointer, that is) for which a reference is
passed as the third argument to the function specific execution context.
See struct x1f4_attributes_type.
The function_set.fix
method in the struct x1f4_attributes_type
expression parsing context is used only to retrieve the function specific
execution contexts and only for functions requiring specific execution contexts
(and marked by the X1f4_E4_TEXT_LINK
bit in their flags
field
defitions).
A reference to a two long array of void pointers is passed to the methods implementing the logic of functions having a specific execution context instead the general execution context. The first element of the array is the function specific execution context, while the second is the general execution context.
Assuming `method13' implementing the logic of function having a specific execution context, the two contexts can be accessed as in:
int method13(void *context, void *output, void **input) { void **the_contexts; the_contexts = context; the_contexts[0] is the function specific context the_contexts[1] is the general execution context }