Contains associated API symbol definitions and data structures.
The /usr/include/g32_api.h file provides data definitions and structures for use with HCON C language subroutines. Each module that uses the HCON API must include the g32_api.h file.
The constants in the g32_api file are:
#define H3270DEV 0 #define SS1 0x19 /* * Range for logical path ID's. */ #define MIN_LPID 0 #define MAX_LPID 25 #define NUM_LPS 26 /* * maximum sessions allowed for single user */ #define G32OK 0 #define G32ERROR -1 #define NO_SESSION 0 #define MODE_3270 1 #define MODE_API 2 #define MODE_API_T 4 #define PEND_DEALLOC 8
struct g32_api { /* information and parameter structure */ int lpid; /* logical path id */ int errcode; /* error code indicator */ int xerrinfo; /* extra error information */ int row; /* row number */ int column; /* column number */ int length; /* length for patterns */ int eventf; /* message queue ID/file descriptor */ int maxbuf; /* maximum buffer size */ int timeout; /* timeout of host response */ }; /* * This structure * directly corresponded to a Pascal stringptr * (which equals a char * and int). */ struct g32_str { char *g_strval; int g_strlength; }; extern int errno; /* * Error codes used by the API routines */ #define G32_SESS_EXIST -1 /* A session exists on the logical */ /*path */ #define G32_NO_LA -2 /* There are no free link addresses */ #define G32_NO_LOG -5 /* An error occurred while attempting*/ /* log onto the host */ #define G32_NO_LP -6 /* No logical path was available */ #define G32_NO_SESS -7 /* No session exists for application */ #define G32_EEMU -8 /* Error starting emulator */ #define G32_EMALLOC -9 /* Unable to malloc memory */ #define G32_EFORK -10 /* fork failed */ #define G32_ENDSESS -12 /* The host application wishes to */ /* end the session */ #define G32_INV_MODE -13 /* The AIX application is not in */ /* API/API or API/API_T mode */ #define G32_PARMERR -15 /* No host application name was */ /* specified for an API or API_T mode*/ /*application */ #define G32_LINK_CTL -16 /* The api was unable to get control */ /* or the specified logical path */ #define G32_EREAD -17 /* An error occurred on a 'read' */ /* system call */ #define G32_EWRITE -18 /* An error occurred on a 'write' */ /* system call */ #define G32_ELENGTH -19 /* The message is more than 32000 */ /* bytes long, or negative */ #define G32_INV_POSITION -20 /* The row or column specification */ /* was invalid */ #define G32_INV_PATTERN -21 /* The pattern presented to a */ /* G32_search was invalid */ #define G32_SEARCH_FAIL -23 /* The string was not found in the */ /* presentation space */ #define G32_EMSGSND -24 /* The API was not able to send a msg*/ /* to the emulator */ #define G32_EMSGRCV -25 /* The API was not able to receive a */ /* msg from the emulator */ #define G32_EIOCTL -30 /* The ioctl call to driver failed */ #define G32_NOTACK -32 /* The synchronization problem, is */ /* missing g32write function in */ /* the host application */ #define G32_TIMEOUT -33 /* Timeout occurred waiting for host */ #define G32_NOATTACH -34 /* data. API could not allocate or */ /* attach to shared buffers */ #define G32_OVERRUN -35 /* Host application overran buffer */ #define G32_CONN_FAIL -36 /* Daemon call connect link failed */ /* Probably means the session name is*/ /* already in use */ #define G32_ATTN -37 /* The host application was inter- */ /* rupted with either a SYSREQ or an */ /*ATTN key. */ /* The AIX application should clean */ /*up and exit. */ /* * Codes returned by g32_get_status */ #define G32_NO_ERROR 0 #define G32_COMM_CHK -1 #define G32_PROG_CHK -2 #define G32_MACH_CHK -3 #define G32_FATAL_ERROR -4 #define G32_COMM_REM -5 /* * constants used in g32_openx */ #define ASCII_1 061 #define ASCII_9 071 /* * length of header */ #define HEADER_LENGTH 12 /* * values for emulator quit message */ #define QUIT_BYTE1 0x03 #define QUIT_BYTE2 0x01 #define QUIT_BYTE3 0x00 /* * values used in g_sea_xlate */ #define HEXa0 0xa0 #define HEXb4 0xb4 #define HEXb5 0xb5 #define HEXc0 0xc0 #define HEXe6 0xe6 /* * values used in g32_alloc and g32_write */ #define MAX_BUF_DIV_256 7 #define MAX_BUF_MOD_256 8
The g32_api.h file is part of the Host Connection Program (HCON).
This file requires the use of a C compiler.
List of HCON Programming References in 3270 Host Connection Program 2.1 and 1.3.3 for AIX: Guide and Reference.