API parameters can be used for input or output. Some parameters
contain both input and output fields; these are identified as input/output
(I/O) parameters in the API parameter tables.
Input parameters and fields are not changed by the API. They have the same
value on the return from the API call as they do before the API call. In contrast,
output parameters and fields are changed. Any information that an API caller
(either an application program or an interactive entry on the display) places
in an output parameter or output field before the call will be lost on the
return from the call.
Parameters can be classified into the following general categories:
- Input parameters: These parameters must be set to a value before
calling the API because they pass needed information to the API to enable
it to perform its function. For example, if the API is to perform a function
on an object, one of the parameters would be the name and library of that
object. Input parameters are not changed by the API.
- Output parameters: These parameters do not need to be set before
calling the API because the API returns information to the application in
these parameters. When a return to the application is successful and no errors
have occurred, the application then accesses the information returned in output
parameters.
- Input/Output parameters: These are parameters that are identified
as structures that contain fields. The fields within the structure can be
either input, output, or both. For example, the bytes provided field in the
error code parameter is an input field. The rest of the fields that make up
this parameter are output fields. The rules for input parameters and output
parameters apply to the individual fields in the structure.