gawk: Accessing Parameters
1
1 16.4.9 Accessing and Updating Parameters
1 ----------------------------------------
1
1 Two functions give you access to the arguments (parameters) passed to
1 your extension function. They are:
1
1 'awk_bool_t get_argument(size_t count,'
1 ' awk_valtype_t wanted,'
1 ' awk_value_t *result);'
1 Fill in the 'awk_value_t' structure pointed to by 'result' with the
1 'count'th argument. Return true if the actual type matches
1 'wanted', and false otherwise. In the latter case,
11 'result->val_type' indicates the actual type (⇒(gawk))). Counts are zero-based--the first
1 argument is numbered zero, the second one, and so on. 'wanted'
1 indicates the type of value expected.
1
1 'awk_bool_t set_argument(size_t count, awk_array_t array);'
1 Convert a parameter that was undefined into an array; this provides
1 call by reference for arrays. Return false if 'count' is too big,
11 or if the argument's type is not undefined. ⇒Array
Manipulation for more information on creating arrays.
1