Returns status information of the logical path.
HCON Library
C (libg3270.a)
Pascal (libg3270p.a)
FORTRAN (libg3270f.a)
#include <g32_api.h>
g32_get_status (as)
struct g32_api *as;
function g32stat (var as: g32_api) : integer; external;
EXTERNAL G32GETSTATUS
INTEGER AS(9),G32GETSTATUS
RC = G32GETSTATUS(AS)
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.
as | Specifies a pointer to a g32_api structure; status is returned in this structure. |
as | Specifies the g32_api structure. |
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).
0 | Indicates successful completion. |
The values of errcode are as follows:
G32_NO_ERROR | 0, indicates no error has occurred. |
If errcode is anything other than G32_NO_ERROR, then xerrinfo contains an emulator program error code.
-1 | Indicates an error has occurred. |
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); . . .
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.
/usr/include/g32_api.h | Contains data structures and associated symbol definitions. |
/usr/include/g32const.inc | Defines Pascal API constants. |
/usr/include/g32hfile.inc | Defines Pascal API external definitions. |
/usr/include/g32types.inc | Defines Pascal API data types. |