gawk: Requesting Values
1
1 16.4.8 Requesting Values
1 ------------------------
1
1 All of the functions that return values from 'gawk' work in the same
1 way. You pass in an 'awk_valtype_t' value to indicate what kind of
1 value you expect. If the actual value matches what you requested, the
1 function returns true and fills in the 'awk_value_t' result. Otherwise,
1 the function returns false, and the 'val_type' member indicates the type
1 of the actual value. You may then print an error message or reissue the
1 request for the actual value type, as appropriate. This behavior is
1 summarized in ⇒Table 16.1 table-value-types-returned.
1
1 Type of Actual Value
1 --------------------------------------------------------------------------
1 String Strnum Number Regex Array Undefined
1 -------------------------------------------------------------------------------
1 String String String String String false false
1 Strnum false Strnum Strnum false false false
1 Number Number Number Number false false false
1 Type Regex false false false Regex false false
1 Requested Array false false false false Array false
1 Scalar Scalar Scalar Scalar Scalar false false
1 Undefined String Strnum Number Regex Array Undefined
1 Value false false false false false false
1 cookie
1
1 Table 16.1: API value types returned
1