ZCOM C I/F Library Routines
PTFIND (3X)
This method is used usually when the MUX, PORT, and TERM are known. An example is 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 that 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.
In order to make it easier to handle multiple matches in a group, the search starts from the next terminal following the specified ZLU. Hence, a returned terminal 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 those 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 terminal 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 the calling program by giving the options
154 | Chapter 4 |