Application Programming Interface

The Application Programming Interface (API) is intended to give programmers the capability of developing their own xcom applications.
xdtful11601
The Application Programming Interface (API) is intended to give programmers the capability of developing their own
XCOM Data Transport
applications.
XCOM Data Transport
  APIs
The two
XCOM Data Transport
APIs, as follows:
  • XcomAPI
    The XcomAPI routine uses C structures that are defined in the xcomapi.h file to pass information to
    XCOM Data Transport
    . The
    XCOM Data Transport
    XcomAPI 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
  • XcomQAPI
    The XcomQAPI routine uses C structures that are defined in the xcomapi.h file to return information from the
    XCOM Data Transport
    Queue. The
    XCOM Data Transport
    XcomQAPI 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.
Utility APIs
Also, the two utility APIs that work with these two APIs, as follows:
  • msgstring
    The msgstring API is a utility API. It converts a return code to an appropriate message. The
    XCOM Data Transport
    msgstring 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.
  • XsetSystemPriv
    XsetSystemPriv is a utility API that allows xcomtcp and xcom62 to return to system privileges (user=root, group=xcomadm) after a transfer has been completed. The
    XCOM Data Transport
    XsetSystemPriv 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.
API Examples
The following API is an example of a file transfer. It uses the XcomAPI routine to pass information to
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 Transport
Installation Guide
for your platform.)
The API example provided on your distribution media may have been updated for your
XCOM Data Transport
system and may be different from the example shown below.
  • C Language API File Transfer to Remote System File Example
    The C Language API is distributed as file xcomapi.h in the directory $XCOM_HOME/api/include.
  • Queue Request Using XcomQAPI Routine
    The Queue Request API is distributed as file qapitest.c in the directory $XCOM_HOME/api/src.