ZCOM C I/F Library Routines

ZSET_RCVR (3X)

 

ZSET_RCVR (3X)

NAME

zset_rcvr – Set up program ZLU as message receiver for a terminal ZLU

SYNOPSIS

#include

<zcom/zcomsys.h>

#include

<zcom/zcomcall.h> /* if compiled with ANSI C (recommended) */

int32 zset_rcvr (action, zap, mode, rzap)

intaction;

zaddr_type *zap;

uint32 mode;

zaddr_type *rzap;

DESCRIPTION The zset_rcvr() routine is used to establish where incoming data from a terminal ZLU is to be queued. When zset_rcvr() is called, the rzap parameter is used to supply the program ZLU to queue the data on. (Note: An application’s program ZLU is returned by the zopen() routine.)

The type of data queued is selected using the mode parameter. You may choose to receive data/status messages, and/or control messages. The location (Virtual Circuit/device/terminal/etc) from which you want to receive the data is specified by the zap parameter. An action parameter value of ZcADD_PRIMARY sets the primary receiver.

Once you have called zset_rcvr(), the application program can issue zread() requests to retrieve any data that may have arrived from the selected terminal ZLU.

An application program that issues a zset_rcvr() call, as described above, is the primary receiver of the specified messages. Another application program can take over being the primary receiver by issuing a zset_rcvr() request, using the same mode and rzap parameters, with the action code also set to ZcADD_PRIMARY. In this situation, data is no longer queued to the original application.

The zset_rcvr() routine can also be used to allow messages to be received by more than one application program at a time. This feature is selected by using an action parameter value of ZcADD_SHARED. When ZcADD_SHARED is used, it specifies that the program does not want to take over being the primary receiver, but simply added as an additional

Chapter 4

321