ZCOM C I/F Library Routines

ZCNTL (3X)

EXAMPLE

#include

<zcom/zcomsys.h>

#include

<zcom/zcomcall.h>

int32

ierr;

zaddr_type

zaddr;

uint32

mode;

uint32

rcode;

zmhd_type

zmhd;

char

ibuf[size]; /* where size is user-determined; must be >= len */

int32

len;

int32

waitstat;

if (ierr = zcntl (&zaddr, mode, rcode, &zmhd, ibuf, len, &waitstat)) { /* error return code */

}

else {

/* good return code */

}

/* For request ZCOM_MRQCODE_TERM for i960 card (e.g. Z7300A) */ ztrq2_type ztrq2;

charspec_cfg[6];

ztrq2.tmreqt = 0x80;

/* ... setup other ztrq2 fields and spec_cfg[], max 6 bytes */ memcpy(ibuf, &ztrq2, sizeof(ztrq2));

memcpy(ibuf + sizeof(ztrq2), spec_cfg, 6); rcode = ZCOM_MRQCODE_TERM;

len = sizeof(ztrq2) + 6;

if (ierr = zcntl (&zaddr, mode, rcode, &zmhd, ibuf, len, &waitstat)) { /* error return code */

}

else {

/* good return code */

}

FILES

/opt/acc/include/zcom/zcomsys.h ZCOM system general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files.

176

Chapter 4