ISETUBUF(3)
HP-UX
NAME
isetubuf − used to supply the buffer that formatted I/O uses
SYNOPSIS
#include <sicl.h>
int isetubuf (INST id, int mask, int size, char *buf);
DESCRIPTION
The “isetubuf” function is used to supply the buffer(s) used for formatted I/O. With this function the user can specify the size and the location of the formatted I/O buffer.
This function is used to set the size and actions of the read and/or write buffers of formatted I/O. The “mask” may be one, but NOT both of the following flags:
*“I_BUF_READ” specifies the read buffer.
*“I_BUF_WRITE” specifies the write buffer.
Setting a “size” greater than zero creates a buffer of the specified
size.
Setting a size less than zero creates a buffer of the absolute value of
the specified size. For write buffers, the buffer flushes (writes to
the device) whenever the buffer fills up, for each newline character in
the format string, or at the completion of every “iprintf” call. For
read buffer, the buffer flushes (erases its contents) at the end of
every “iscanf” (or “ipromptf”) function.
Note:
Calling “isetubuf” flushes the buffer specified in the “mask”
parameter.
Warning:
Once a buffer is allocated to “isetubuf”, do not use the buffer for
any other use. In addition, once a buffer is allocated to “isetubuf”
(either for a read or write buffer), don’t use the same buffer for any
other session or for the opposite type of buffer on the same session
(write or read respectively).
If you use “isetbuf” after this function, the “isetbuf” will
deallocate the current buffer and allocate a buffer.
RETURN VALUE
isetubuf returns (0) if successful, or a non-zero error code if an error was encountered.
ERRORS
isetubuf fails under the following circumstances, and sets the return value to one of the following:
[I_ERR_NORSRC] Out of system resources
[I_ERR_NOINTF] Interface is not active
[I_ERR_NODEV] Device is not active
[I_ERR_BADID] The INST id is invalid
[I_ERR_BADADDR] Invalid address (device/interface doesn’t exist)
SEE ALSO
AUTHOR
isetubuf was developed by HP.
Hewlett-Packard Company — September 29, 1999