manpagez: man pages & more
info gawk
Home | html | info | man

gawk: Accessing Parameters

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