g32_get_status Function

Purpose

Returns status information of the logical path.

Libraries

HCON Library
C (libg3270.a)
Pascal (libg3270p.a)
FORTRAN (libg3270f.a)

C Syntax

#include <g32_api.h>

g32_get_status ( as)

struct g32_api *as;

Pascal Syntax

function g32stat (var  as: g32_api) : integer; external;

FORTRAN Syntax

EXTERNAL G32GETSTATUS
INTEGER AS(9),G32GETSTATUS

RC = G32GETSTATUS( AS)

Description

The g32_get_status function obtains status information about the communication path. The function is called after an API application determines that an error has occurred while reading from or writing to the communication path or after a time out. The HCON session profile specifies the communication path.

The g32_get_status function can only be used in API/API, API/API_T, and API/3270 modes.

HCON application programs using the Pascal language interface must include and link both the C and Pascal libraries. Application programs using the FORTRAN language for the HCON API must include and link both the C and FORTRAN libraries.

The g32_get_status function is part of the Host Connection Program (HCON).

The g32_get_status function requires one or more adapters used to connect to a host.

C Parameters

Item Description
as Specifies a pointer to a g32_api structure; status is returned in this structure.

Pascal Parameters

Item Description
as Specifies the g32_api structure.

FORTRAN Parameters

Item Description
AS Specifies a g32_api equivalent structure as an array of integers.
Note: This function is used to determine the condition or status of the link. It should not be used to determine whether the previous I/O operation was successful or unsuccessful (the return code will provide this information).

Return Values

Item Description
0 Indicates successful completion.

Error Codes

The values of errcode are as follows:

Error Code Description
G32_NO_ERROR 0, indicates no error has occurred.
G32_COMM_CHK -1, indicates a communications check has occurred.
G32_PROG_CHK -2, indicates a program check has occurred within the emulator.
G32_MACH_CHK -3, indicates a machine check has occurred.
G32_FATAL_ERROR -4, indicates a fatal error has occurred within the emulator.
G32_COMM_REM -5, indicates a communications check reminder has occurred.

If errcode is anything other than G32_NO_ERROR, then xerrinfo contains an emulator program error code.

Value Description
-1 Indicates an error has occurred.
  • The errcode field in the g32_api structure is set to the error code identifying the error.
  • The xerrinfo field can be set to give more information about the error.

Examples

The following example fragment illustrates the use of the g32_get_status function in C language:

#include <g32_api.h>      /* API include file */
main()
{
struct g32_api *as;      /* g32 structure */
int return;
return = g32_write(as, mssg, length);
            /* see if unsuccessful */
if (return < 0) {
   return = g32_get_status(as);
   printf("Return from g32_get_status = %d \n",return);
   printf("errcode = %d  xerrinfor = %d \n",
      as -> errcode , as -> xerrinfo);
.
.
.

Implementation Specifics