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 X.25 Protocol User's Guide > Chapter 4 X.25 Application Programming

X25STAT (3X)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

NAME

x25stat - Return a formatted X.25 status or ZCOM error message

SYNOPSIS

#include  <zcom/zcomsys.h>
#include <zcom/zcomcall.h> /* if compiled with ANSI C (recommended) */

char *x25stat (req, stat)
int32 req;
int32 stat;

DESCRIPTION

Routine x25stat returns a character string which gives an explanation of the X.25 and ZCOM status codes. It can be used as a replacement for zcomstatus where the X.25 protocol is being used. Routine x25stat may be called to format error messages describing the reason for the error in a terminal request. The returned character string can be up to 31 bytes in length (maximum), plus a terminating zero.

The libraries libzx25.a, libzcom_c.a and libpthread.a must be linked into the calling program by giving the "-lzx25 -lzcom_c -lpthread" options to cc(1) or ld(1).

Threads Considerations

This routine may be called from a multi-threaded application using the POSIX (1003.1c) kernel threads API package. It has the following characteristics when called by multi-threaded applications:

not a cancellation point

Thread cancellation will not occur when a thread is calling this routine.

async-cancel unsafe

The calling thread's cancelability type must be PTHREAD_CANCEL_DEFERRED if cancellation is enabled.

async-signal unsafe

It cannot be called from a signal handler.

fork unsafe

It cannot be called by a child process after fork(2) but before exec(2).

PARAMETERS:

req

The request code associated with the terminal operation. This will be returned either with a zread call for a type 6 (ZCOM_MSTYPE_RSLT) or 14 (ZCOM_MSTYPE_RSRT) message (zmhd.mrq.mrqcode), or will be known from the call context for a mode 8 zsend, zcntl, or zport call.

stat

Status code (ZCOM error code if < 0).

NOTES

This routine reads a message file for the status message text. It uses the file zstatmsg.msg in /opt/acc/msg (ZCOM_MESSAGE_PATH). If not found, it uses the default message file default.msg.

RETURN VALUE

Routine x25stat returns a null-terminated character string, which consists of either a ZCOM error or X.25 status message.

EXAMPLE

#include <zcom/zcomsys.h>
#include <zcom/zcomcall.h>

char *message; /* Returned message string */
int32 req;
int32 stat;
message = x25stat (req, stat);

FILES

/opt/acc/include/zcom/zcomsys.h

ZCOM subsystem general include file, containing data types, data structures, constants, error codes, masks, etc. Note that this must be the first include file before any other ZCOM include files.

/opt/acc/include/zcom/zcomcall.h

ZCOM routine function prototypes (requires ANSI C compilation).

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