Application Programming Interface
The Application Programming Interface (API) is intended to give programmers the capability of developing their own xcom applications.
The Application Programming Interface (API) is intended to give programmers the capability of developing their own
XCOM Data Transportapplications.
XCOM Data TransportAPIs
XCOM Data TransportAPIs, as follows:
- XcomAPIThe XcomAPI routine uses C structures that are defined in the xcomapi.h file to pass information toXCOM Data Transport. TheXCOM Data TransportXcomAPI function call takes a starting state and a parameter block structure as its arguments. For transfers using SNA, before invoking XcomAPI, an SNA session must be active with the desired remote system.xcomapi.h can be at $XCOM_HOME/api/include
- XcomQAPIThe XcomQAPI routine uses C structures that are defined in the xcomapi.h file to return information from theXCOM Data TransportQueue. TheXCOM Data TransportXcomQAPI function call takes a parameter field as its argument, which allows you to delete entries from the queue, suspend a transfer, resume a suspended transfer, display the list of entries in the queue, and display detailed information about the queue entries.For details about XcomQAPI option parameters and return codes, see XcomQAPI.
The XcomAPI provides the ability to submit transfers to
XCOM Data Transport. The XcomQAPI provides the same functionality as the XCOMQM command line, but through an API.
Also, the two utility APIs that work with these two APIs, as follows:
- msgstringThe msgstring API is a utility API. It converts a return code to an appropriate message. TheXCOM Data Transportmsgstring API() function call takes a return code and sense as its arguments. The return code is the return value of XcomAPI or XcomQAPI.Example:Suppose XcomAPI or XcomQAPI returns a code other than zero. This return code is passed to the msgstring API, which returns a message corresponding to the return code.
- XsetSystemPrivXsetSystemPriv is a utility API that allows xcomtcp and xcom62 to return to system privileges (user=root, group=xcomadm) after a transfer has been completed. TheXCOM Data TransportXsetSystemPriv API() function call takes a type of privilege as its argument.This function needs to be called at the end of transfer. Refer to API example to know usage of this function.
The following API is an example of a file transfer. It uses the XcomAPI routine to pass information tofor your platform.)
XCOM Data Transport. This sample API program is the apitest.c file distributed with
XCOM Data Transport. (For the location of this file, see the
XCOM Data TransportInstallation Guide
The API example provided on your distribution media may have been updated for your
XCOM Data Transportsystem and may be different from the example shown below.
- C Language API File Transfer to Remote System File ExampleThe C Language API is distributed as file xcomapi.h in the directory $XCOM_HOME/api/include.
- Queue Request Using XcomQAPI RoutineThe Queue Request API is distributed as file qapitest.c in the directory $XCOM_HOME/api/src.