ACC Programmer's Reference Guide
154 Chapter4
ZCOM C I/F Library Routines
PTFIND (3X)
This method is used usually when the MUX, PORT, and TERM are
known. An example i s in retrieving a previously accessed physical
terminal table.
Method 2: Retrieve the next terminal whose table has a sequence of
matching bytes.
This method compares the contents of the physical terminal tables
within a group, and locates the one t hat matches a byte sequence. In
addition to the data buffer, table location and number of bytes to be
compared, the caller also specifies a terminal ZLU within the group to be
searched.
Inordertomakeiteasiertohandlemultiplematchesinagroup,the
search starts from the next terminal following the specified ZLU. Hence,
a returned t erminal ZLU may be used in the next ptfind call to locate the
next matching terminal. In this case, the whole group is searched if a
terminal is returned the second time.
Method 3: Retrieve the next terminal whose table has a sequence of
matching bit patterns.
This mode is similar to Method 2 except that the caller also specifies a
mask buffer, which is used to mask some unused bits in the physical
terminal table before comparing with the specified data.
The mask buffer is AND’ed with the table content before comparison.
Hence, the mask buffer should contain zeros for t hose unused bits and
ones for those bits to be compared. The data buffer should have zeros for
those unused bits, 0 or 1 for the bits to be compared.
Similarly, the search starts from the next termina l after the specified
ZLU. (In fact, method 2 may be treated as a special case of this, if the
mask buffer contains all ones.)
The libraries libzcom_c.a and libpthread.a must be linked into thecalling
program by giving the options “-lzcom_c -lpthread” to cc(1) or ld(1).










