Write to Stdout (QtmhWrStout) API
The QtmhWrStout() API provides the ability for CGI programs that are written in languages other than ILE C to write to stdout.
Required Parameter Group: | |||
1 | Data variable | Input | Char(*) |
2 | Length of data variable | Input | Binary(4) |
3 | Error Code | I/O | Char(*) |
Required parameter group
- Data variable
- Input:CHAR(*)
The input variable containing the data to write to stdout.
- Length of data variable
- INPUT:BINARY(4)
The input variable contains the length of the data written to stdout. The length of the data must be larger than 0.
- Error Code
- I/O:CHAR(*)
The structure in which to return error information. For the format of the structure and for details on how to process API errors, see the API error reporting topic in the IBM® i Information Center.
Error messages
- CPF24B4 E
- Severe Error while addressing parameter list.
- CPF3C17 E
- Error occurred with input data parameter.
- CPF3CF1 E
- Error code parameter not valid.
Note: CGI programs written in the ILE C language do not require a
special API to write data to stdout. The following example shows how
a CGI program might write to stdout:
fwrite(buffer,1,sizeof(buffer),stdout);
CGI
programs are expected to produce data in the stdout that is formatted
according to the CGI interface specification. The QtmhWrStout() API
provides no line formatting; the user of the API must perform prescribed
formatting which includes the requirement for text line characters
(such as new line). Errors are not indicated for data that is not
formatted per CGI requirements.