Qp0zSetTerminalMode()--Set Modes for a Generic Terminal


  Syntax
  #include <qp0ztrml.h>
  int Qp0zSetTerminalMode( unsigned char mode, unsigned char type,  
                          unsigned char *reserved );;
  Service Program Name: QP0ZTRMLC

  Default Public Authority: *USE

  Threadsafe: Yes

The Qp0zSetTerminalMode() function allows a program to control the input mode and wrap mode of the terminal window to which it is connected. See Generic Terminal Concepts for details about using a terminal.

Qp0zSetTerminalMode() supports setting the following modes:

QP0Z_TERMINAL_INPUT_MODE (0x01)
Set the input mode for the terminal window. When type is QP0Z_TERMINAL_HIDDEN (0xBD), any input entered by the user is not visible on the terminal window and is not echoed to the output area. When type is QP0Z_TERMINAL_NORMAL (0xBE), any input entered by the user is visible on the terminal window and is echoed to the output area. When type is QP0Z_TERMINAL_PREVIOUS (0x49), the input mode is set to its previous value.

QP0Z_TERMINAL_WRAP_MODE (0x02)
Set the wrap mode for the terminal window. When type is QP0Z_TERMINAL_TRUNCATE (0x3E), for lines longer than the width of the terminal window, only the data that fits in the output area is displayed. When type is QP0Z_TERMINAL_WRAP (0x3D), for lines longer than the width of the terminal window, the data is wrapped to the next line in the output area. When type is QP0Z_TERMINAL_PREVIOUS (0x49), the wrap mode is set to its previous value.

Parameters

mode
(Input)

Mode to set for the terminal window. The valid values are QP0Z_TERMINAL_INPUT_MODE and QP0Z_TERMINAL_WRAP_MODE.

type
(Input)

Type associated with the mode. The valid values for QP0Z_TERMINAL_INPUT_MODE are QP0Z_TERMINAL_HIDDEN, QP0Z_TERMINAL_NORMAL, and QP0Z_TERMINAL_PREVIOUS. The valid values for QP0Z_TERMINAL_WRAP_MODE are QP0Z_TERMINAL_TRUNCATE, QP0Z_TERMINAL_WRAP, and QP0Z_TERMINAL_PREVIOUS.

reserved
(Output)

Reserved parameter that must be set to NULL.


Authorities and Locks

None.


Return Value

0 Qp0zSetTerminalMode() was successful.
value Qp0zSetTerminalMode() was not successful. The value returned is an errno indicating the failure.


Error Conditions

If Qp0zSetTerminalMode() is not successful, the return value usually indicates one of the following errors. Under some conditions, the return value could indicate an error other than those listed here.

[EBADF]

Descriptor not valid.

A file descriptor argument was out of range, referred to a file that was not open, or a read or write request was made to a file that is not open for that operation.

[EFAULT]

The address used for an argument was not correct.

In attempting to use an argument in a call, the system detected an address that was not valid.

Correct the argument in error.

[EINVAL]

The value specified for the argument is not correct.

A function was passed incorrect argument values or an operation was attempted on an object and the operation specified is not supported for that type of object.

Correct the argument in error and try your request again.

[EIO]

Input/output error.

A physical I/O error occurred.

See the previous message in the job log. Correct any errors indicated there and try your operation again.

[ENOTTY]

Inappropriate I/O control operation.

[EUNKNOWN]

Unknown system state.

The operation failed due to an unknown system state. See any messages in the job log and correct any errors that may be indicated and then retry the operation.


Usage Notes

  1. Before calling Qp0zSetTerminalMode(), a program should check to see if descriptor 0 is connected to a terminal by calling Qp0zIsATerminal().

  2. There is no way for the Generic Terminal to prevent multiple programs calling Qp0zSetTerminalMode() to control the terminal. A program must provide appropriate synchronization between calls to Qp0zSetTerminalMode() to avoid confusing the user of the terminal.

Related Information


API introduced: V5R1
Top | UNIX-Type APIs | APIs by category