Reference Guide
ZCOM C I/F Library Routines
ZREAD (3X)
Chapter 4 301
5. The type of message received is returned in mhp->mid.mstype. Its
values are as follows (defined in /opt/acc/include/zcom/zcomsys.h):
#define ZCOM_MSTYPE_REMOTE 0x08 /* Mask for remote message bit */
#define ZCOM_MSTYPE____0 0 /* Undefined type */
#define ZCOM_MSTYPE_MSLT 1 /* From local terminal */
#define ZCOM_MSTYPE_LPLP 2 /* Local program to program */
#define ZCOM_MSTYPE_TOLZ 3 /* Timer message for local ZLU */
#define ZCOM_MSTYPE_LPLT 4 /* Local program to terminal */
#define ZCOM_MSTYPE_LSEM 5 /* Local system event message */
#define ZCOM_MSTYPE_RSLT 6 /* Response from local terminal */
#define ZCOM_MSTYPE_RSLP 7 /* Response from local program */
#define ZCOM_MSTYPE____8 8 /* Undefined type */
#define ZCOM_MSTYPE_MSRT 9 /* Remote terminal message */
#define ZCOM_MSTYPE_RPLP 10 /* Remote program to program */
#define ZCOM_MSTYPE_TORZ 11 /* Timer message for remote ZLU */
#define ZCOM_MSTYPE_RPLT 12 /* Remote program to terminal */
#define ZCOM_MSTYPE_RSEM 13 /* Remote system event message */
#define ZCOM_MSTYPE_RSRT 14 /* Response from remote terminal */
#define ZCOM_MSTYPE_RSRP 15 /* Response from remote program */
RETURN VALUE Routine zread returns 0 if the call is successful. In addition, for a
response message, a non-zero return status rstat indicates there was a
problem with the previous zsend(3X) call. A non-zero return status with
a terminal message or response indicates there was a problem with the
terminal. For other message types, the return status is always 0.
If the zread call itself failed, a non-zero error code is returned, and the
other return parameters do not contain valid values. See
/opt/acc/include/zcom/zcomsys.h for the list of ZCOM error codes and
their meanings.
EXAMPLE
#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>
int32 ierr;
zaddr_type zaddr;
uint32 mode;
zmhd_type zmhd;
char ibuf[size]; /* where size is user-determined; must be >= len */
int32 len;
int32 rlen;
int32 rstat;
if (ierr = zread(&zaddr, mode, &zmhd, ibuf, len, &rlen, &rstat)) {