ISETBUF(3)
HP-UX
NAME
isetbuf − Set the size and the action of SICL’s formatted I/O buffers
SYNOPSIS
#include <sicl.h>
int isetbuf (INST id, int mask, int size);
DESCRIPTION
The isetbuf routine is used to specify the new size and the action of the read and/or the write buffers for SICL’s formatted I/O routines.
The values for mask can be OR’ed together. The following are legal values for the mask parameter:
I_BUF_READ - Discard the read buffer and (if data was
present in the read buffer) read from the device until an END
indicator is read (causes the loss of data).
I_BUF_WRITE - Flush the write buffer by writing all
buffered data to the device.
The size parameter not only determines the size of the buffer(s), but also determines the action.
Specifying a size of zero causes buffering to be disabled. For write, the characters are sent directly to the device as they are generated. For read, the charcters are read from the device one character at a time. Note that for some formatting conversions a one character pushback read buffer may still be required.
Specifying a size greater than zero causes a buffer of that size to be created. For write the buffer is flushed (written to the device) anytime the buffer fills, or when a newline character is found in the format string. For read the buffer is flushed (characters are thrown away) only by explicite calls to iflush. This is the default behavior for both the read and the write buffers.
Specifying a size less than zero causes a buffer of the absolute value of size to be created. The flushing of the buffer is done exactly the same as in the case when the size specified is greater than 0, except that the buffer is also flushed at the end of iprintf, iscanf, and ipromptf.
RETURN VALUE
isetbuf returns (0) if successful, or non-zero if an error was encountered.
ERRORS
isetbuf fail under the following circumstances, and returns one of the following values:
[I_ERR_NOINTF] Interface is not active
[I_ERR_NODEV] Device is not active
[I_ERR_BADID] The INST id is invalid
SEE ALSO
iprintf(3), iscanf(3), iflush(3)
AUTHOR
isetbuf was developed by HP.
Hewlett-Packard Company — May 05, 1994