ZCOM C I/F Library Routines

 

 

LTQDGET (3X)

PARAMETERS

 

 

zap

ZCOM address of a terminal from which to get

 

the data.

queue

Terminal data queue number (specifies which

 

data queue is to be used).

 

0

- Sub-packet holding queue (reserved)

 

1

- Data holding queue A

 

2

- Data holding queue B

 

3

- Data holding queue C

 

4

- Data holding queue D

ibuf (Return Param)

On a successful return, the data is placed into

 

this buffer.

len

Length in bytes of ibuf.

rlenp (Return

Actual number of bytes returned in ibuf.

Param)

 

 

NOTES

Normally, the data queue number used should be allocated by ZMON

 

(see the zltqueue man page for how to get a data queue number). There is

 

no queue ownership validation within this routine; it is up to the user to

 

make sure that the queue usage is valid and consistent.

RETURN VALUE

Routine ltqdget returns 0 if successful. Otherwise, a non-zeroerror code

 

is returned. See /opt/acc/include/zcom/zcomsys.h for the list of ZCOM

 

error codes and their meanings.

 

If the specified queue is empty, then the ZENODATA error (-24) is

 

returned and ibuf contains invalid data.

EXAMPLE

#include

<zcom/zcomsys.h>

 

#include

<zcom/zcomcall.h>

 

int32

ierr;

 

zaddr_type

zaddr;

 

uint32

queue;

 

char

ibuf[size]; /*Where size is user-determined; must be

 

>= len */

 

 

int32

len;

 

int32

rlen;

if (ierr = ltqdget (&zaddr, queue, ibuf, len, &rlen)) {

Chapter 4

153