HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
b
blmode(3C) blmode(3C)
(TO BE OBSOLETED)
NAME
blopen(), blclose(), blread(), blget(), blset() - terminal block-mode library interface
SYNOPSIS
#include <sys/blmodeio.h>
int blopen(int fildes);
int blclose(int bfdes);
int blread(int bfdes, char *buf, size_t nbyte);
int blget(int bfdes, struct blmodeio *arg);
int blset(int bfdes, const struct blmodeio *arg);
DESCRIPTION
This terminal library interface allows support of block-mode transfers with HP terminals. Block mode only
affects input processing. Therefore, data is written with the standard write() interface (see write(2)).
In character mode, the terminal sends each character to the system as it is typed. However, in block mode,
data is buffered and possibly edited locally in the terminal memory as it is typed, then sent as a block of
data when the [Enter] key is pressed on the terminal. During block-mode data transmissions, the incom-
ing data is not echoed by the interface and no special character processing is performed, other than recog-
nizing a data block terminator character. For subsequent character mode transmissions, the existing ter-
mio state (see termio(7)) continues to determine echo and character processing.
Block-mode protocol has two component parts: block-mode handshake and block-mode transmission.
Block-Mode Handshake
At the beginning of a read, a trigger character is sent to the terminal to notify it that the system wants a
block of data (the trigger character, if defined, is sent at the beginning of all reads, whether in character- or
block-mode. It is necessary for block-mode reads to work correctly).
After receiving the trigger character, and when the user has typed all the data into the terminal’s memory
and pressed the [Enter] key, the terminal sends an alert character to the system to notify it that the ter-
minal has a block of data to send.
The system might then send user-definable cursor-positioning or other data sequences to the terminal, such
as for cursor-home or lock-keyboard.
The system then sends a second trigger character to the terminal. In response, the terminal transmits the
data block as described in the Block-Mode Transmission section.
Block-Mode Transmission
The second part of the block-mode protocol is the block-mode transmission. After the block-mode
handshake has successfully completed, the terminal transmits the data block to the system. During this
transmission of data, the incoming data is not echoed by the system and no special character processing is
performed, other than recognizing the data block termination character. It is possible to bypass the block-
mode handshake and have the block-mode transmission occur after only the first trigger character is sent,
see CB_BMTRANS below.
It is possible to intermix both character-mode and block-mode data transmissions. If
CB_BMTRANS (see
below) is set, all transfers are block-mode transfers. When
CB_BMTRANS is not set, character mode
transmissions are processed as described in termio(7). In this case, if an alert character is received any-
where in the input data, the transmission mode is automatically switched to block mode for a single
transmission. Any data received before the alert is discarded. The alert character can be escaped with a
backslash (
\) character.
XON/XOFF Flow Control
To prevent data loss, XON/XOFF flow control should be used between the system and the terminal. The
IXOFF bit (see termio(7)) should be set and the terminal strapped appropriately. If flow control is not used,
it is possible for incoming data to overflow and be lost. (Note: some older terminals do not support
XON/XOFF flow control.)
Read Requests
Read requests that receive data from block-mode transmissions do not return until the transmission is com-
plete (the terminal has transmitted all characters). If the read is satisfied by byte count or if a data
Section 3−−42 − 1 − HP-UX Release 11i: December 2000
___
___