Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
ACC Programmer's Reference Guide > Chapter 4 ZCOM C I/F Library Routines

Introduction

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The ZCOM C interface library routines provide an application program interface to the ZCOM subsystem. These enable the application programmer to access to the ZCOM subsystem, transfer data, configure the system, check on the state of the ZCOM subsystem, etc.

Applications should link in the archive library libzcom_c.a or the shared library libzcom_c.sl with their program to use these functions. Two sets of libraries are provided: the 32-bit libraries support 32-bit programs, portable across both PA-RISC 1.1 and PA-RISC 2.0 hardware platforms, while the 64-bit libraries only support 64-bit programs running only on PA-RISC 2.0 64-bit hardware (wide mode). The 32/64-bit libraries have the same name, but the location is different; /opt/acc/lib for the 32-bit library, and /opt/acc/lib/pa20_64 for the 64-bit library. The library location can be specified by preceding the -l option to cc or ld with “-L<dir>”.

Note that the HP-UX 11.0 (or later) operating system supports cross platform development. Regardless of the hardware model, the compiler option +DA1.1 (or +DAportable) will generate a 32-bit program, while the option +DD64 (or +DA2.0W) will generate a 64-bit program.

All the ZCOM library routines are thread-safe and can be called from multi-threaded applications. They are implemented using the POSIX (1003.1c) kernel threads API package, therefore it is necessary to include the thread library libpthread.a after the ZCOM library. Refer to the man page pthread(3T) for more details on POSIX threads.

The following are the suggested compiler and linker options for ACC application program using the ZCOM C library:

32-bit program: +DA1.1 -L/opt/acc/lib -lzcom_c -lpthread

64-bit program: +DD64 -L/opt/acc/lib/pa20_64 -lzcom_c -lpthread
NOTE: All “Include” files formerly under /usr/include/zcom have been relocated to /opt/acc/include/zcom. Users should add "-I/opt/acc/include" to their “make” files, to direct the preprocessor to also include any files in the directory specified.

The following is a list of ZCOM C interface library routines:

Initialization call

zinit

-ZCOM library access initialization

Interface configuration call

zport

-Datacomm port configuration

zconfig

-Dynamic system configuration

ZLU configuration calls

zclos

-Delete program input ZLU

zmapr

-Set up ZLU mapping configuration

zopen

-Create ZLU program input queue

zluopen

-Open a ZLU for file system access

zset_rcvr

-Set up a program ZLU as receiver for a terminal ZLU

zevent_rcvr

-Set up a program ZLU as receiver for system event messages

zsetql

-Set buffer queue limit

ztimr

-Enable/disable ZLU timer

Data storage allocation calls

zltqueue

-Logical data queue allocation

zltstore

-Logical data storage allocation

ZLU data transfer calls

ltqdget

-Read data buffer in terminal data queue

ltqdput

-Store data buffer in terminal data queue

zcntl

-Send control message to ZLU

zpeek

-Read data without disturbing queue

zqmve

-Move message from one ZLU to another

zread

-Read from ZLU

zsend

-Send data buffer to ZLU

ZLU information calls

ltfind

-Find specific logical terminal in a group

ptfind

-Find specific physical terminal in a group

zinfo

-Get ZCOM table information

zname

-Find ZLU number from ZLU name

zqsze

-Read ZLU input queue size

zget_shrcvr_list

-Retreive a list of all the current shared receivers

Utility routines

getdevice

-Return ZCOM device definitions

makezluname

-Make a ZLU name with tty name suffix

zcomerror

-Return a formatted ZCOM error message

zcomlname

-Set up originator name for log messages

zcomlog

-Add a message to the ZCOM error log file

zcomstatus

-Return a formatted ZCOM status or error message

zltmg

-Move logical terminals between groups

zltup

-Update logical terminal table

zptup

-Update physical terminal table

zrntimer

-Set ZCOM remote node access timeout

ZLU Definition

The zlu field of a <zaddr_type> parameter specifies the ZLU address. The checksum field of a <zaddr_type> parameter is a checksum used to verify the address of the message. All routine calls that specify '(with checksum)' in the ZLU definition must have both fields defined correctly for successful processing.

The checksum minimizes the possibility of messages being accidentally misdirected. The checksum is calculated based on the type and name of the ZLU, hence the checksum does not change even when the system is restarted. If the program that opened the ZLU is killed, it may reopen the same ZLU by referencing it by ZLU name and the same checksum will be generated. This allows any other message sources to deliver data to a restarted ZLU without any impact.

The node field of a <zaddr_type> parameter must contain a valid node number or zero if it is an input parameter. However, if it is a return parameter, such as in the zopen call, then the node number returned is the local node as defined in the "configuration file". Note that specifying a node number of zero is the same as specifying the local node number. If a remote node is specified, it must be defined in the Node-Definition section of the TTGEN configuration file. Refer to the ACC Utilities Guide for more information about the TTGEN configuration or the ttgen(1) man page file.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2000 Hewlett-Packard Development Company, L.P.