📄 pim3270.h
字号:
#define NULLPreProc (int(*) ()) 0 /* Null pre-exit routine */
#define NULLPostProc (int(*) ()) 0 /* Null post-exit routine */
#define NULLErrProc (int(*) ()) 0 /* Null error-exit routine */
#define NULLSIGFUNC (sighndl(*) ()) 0 /* Null signal function */
#define NULLVDEVFUN (int(*) ()) 0 /* Null Virtual Device function */
/* macro for calling an application function - follow with (arguments): */
/* NOTE: may yield strange results in nested if/else blocks if not in {}*/
#define APPL_FUNC(p_func) if (p_func != (int(*) ()) 0) (void) (*p_func)
/* Function Identification codes stored in the psFunction field. This
field is set in conjunction with the psStatus field to identify the
function being performed when an error occured (ueERROR message
received from the Device Handler).
*/
#define lcNULL 0 /* no function */
#define lcSTATUS 1 /* function = ueSTATUS from DH */
#define lcPOSTAIDKEY 252 /* function = PostAIDKey() */
#define lcPOSTDEVSTAT 253 /* function = PostDevStat() */
#define lcWRITE 254 /* function = ueWRITE from DH */
#define lcREAD 255 /* function = ueREAD from DH */
#define lcCLOSE3270 256 /* function = Close3270() */
#define lcOPEN3270 257 /* function = Open3270() */
#define lcPOSTSNAEVENT 258 /* function = PostSNAEvent() */
#define lcOPENSP 259 /* function = Open3270() */
#define lcCLOSESP 260 /* function = Close3270() */
#define lcRQSTTAB 261 /* function = RqStTab() */
#define lcLUCONTROL 264 /* function = LUControl() */
#define lcSENDMSG 265 /* function = SendMsg() */
#define lcRECVMSG 266 /* function = piRECVMSG from DH */
#define lcAKLUCNTL 267 /* function = piAKLUCNTL fr. DH */
#define lcRTMSTOP 274 /* function = rtmStop3270() */
/* Status codes stored in psStatus field. The psStatus field is used in
conjunction with the psFunction field in error situations as described
above, and describes the reason a given function was in error.
*/
#define sOK 0 /* Function succeeded (no error) */
#define sBADADDR 102 /* Bad device address */
#define sADCLOS 103 /* Address is closed */
#define sQOVERFLOW 104 /* too many keys pending */
#define sBADSTATE 105 /* Bad state for the action attempted. */
#define sALRDSEL 106 /* device already selected */
#define sBADSUBTYPE 107 /* bad sub-type */
#define sBADETOA 108 /* bad EtoA table requested */
#define sBADSIZE 112 /* Bad buffer size on Open request */
#define sBADTYPE 113 /* Bad device type on Open request */
#define sBADAID 114 /* Bad AID Key received */
#define sBADEVENT 115 /* Bad status or event specified */
#define sNOSSCP 116 /* An SSCP session was not established */
#define sMAXSPEXCD 117 /* maximum status processes exceeded */
#define sDUPOPEN 124 /* multiple opens on same session */
#define sBADCURSOR 129 /* Bad cursor */
#define sRTMSTOP 130 /* tried to stop RTM out of sequence */
#define sMAXUSERS 131 /* exceeded the number of licensed users */
#define sPIMERR 300 /* An internal system or PIM error */
/* Host command type defines which may be found in the psHostCmd field of
the PIM Control Block when messages are receieved from the DH. These
are defined to their actual values as defined by IBM 3270 protocol.
*/
#define cNOHOSTCMD 0x0000 /* no command (initializer) */
#define cWRITE 0x00F1 /* Write command */
#define cERASEWRITE 0x00F5 /* Erase/Write command */
#define cERWRITEALT 0x007E /* Erase/Write Alternate cmd. */
#define cREAD 0x00F2 /* Read Buffer command */
#define cREADMODIFIED 0x00F6 /* Read Modified command */
#define cCOPY 0x00F7 /* Copy command (BSC only) */
#define cERASEALLUNPR 0x006F /* Erase All Unprotected */
#define cRDMODALL 0x006E /* Read Modified All command */
#define cWSF 0x00F3 /* Write Structured Field cmd. */
#define cERESET 0x0003 /* Erase/Reset Field command */
#define cSETREPLYMODE 0x0009 /* Set Reply Mode command */
#define cQUERY 0x0001 /* Query Structured Field */
#define c3270DS 0x0040 /* 3270 Data Stream Struct. Fld.*/
#define cFILETRANSFER 0x00D0 /* File Transfer Structured Fld.*/
/* Definitions for bits of the 3270 Write Control Character (WCC) which
is found in the psWCC field of the PIM Control Block. There are two
sets of bit definitions: (1) those used by Terminal devices; (2) Those
used by Printer devices. All bit settings match those defined by IBM
3270 protocol.
*/
/* Terminal device WCC bit settings: */
#define wccRESETMDT 0x01 /* Reset Modified Data Tag */
#define wccUNLOCK 0x02 /* Restore keyboard */
#define wccALARM 0x04 /* Sound Alarm */
#define wccPRINT 0x08 /* Start printout */
#define wccMSCRESET 0x40 /* (Misc.) Reset Bit */
/* Printer device WCC bit bit settings (format control): */
#define wccFMT132 0x00 /* Unformatted 132-char line */
#define wccFMT40 0x10 /* Formatted 40-character line */
#define wccFMT64 0x20 /* Formatted 64-character line */
#define wccFMT80 0x30 /* Formatted 80-character line */
/* Values for PIM Control Block psState and psOpenState fields which define
the state the emulated device is in (psState contains the device's power
on/off state; psOpenState its open/close state with respect to the DH).
Also in the stStat field of the Status Table data structure (SPStatus)
for those devices receiving status information via the RqStTab() function.
PROGRAMMER'S NOTE: certain states correspond to power on/power off states
of a real 3270 device, while others correspond to this state and the state
of the session the device is using.
*/
#define stUNDEF 0 /* Device state is undefined */
#define stOPNPEND 1 /* Device is pending open: */
/* powered on; waiting for a */
/* session from Gateway */
#define stOPEN 2 /* Device is opened: */
/* powered on with session */
#define stCLOSPEND 3 /* Device is pending close: */
/* powered off; waiting for */
/* session to be deactivated */
/* by host (DACTLU in SNA) */
#define stCLOSED 4 /* Device is closed: */
/* powered off; session deac- */
/* vated and released back to */
/* the Gateway */
#define stONPWRPEND 5 /* power on pending for device */
#define stOFFPWRPEND 6 /* power off pending for device */
/* defines for controller types found in the psController field of the
session's PIM Control Block:
*/
#define CT_NONE -1 /* not connected (not open) */
#define CT_3274 0 /* conntroller type = 3274 */
#define CT_3276 1 /* controller type = 3276 */
/* suspend/resume states, which are found in the psSuspRes field of the
session's PIM Control Block:
*/
#define stPENDSUSPEND 1 /* Suspend pending */
#define stSUSPENDED 2 /* Device is suspended: */
/* results from application */
/* issuing PostDevStat of */
/* dstSUSPEND */
#define stPENDRESUME 3 /* Resume pending */
#define stRESUMED 4 /* Device is resumed: */
/* results from application */
/* issuing PostDevStat of */
/* dstRESUME */
/* Session owner defines - these are values found in the psOwner field of
the PIM Control Block:
*/
#define owUNDEFINED 0 /* Session owner is undefined */
#define owUNOWNED 1 /* Session is unowned */
#define owSSCP 2 /* Session is owned by SSCP */
#define owLU 3 /* Session is owned by LU */
/* Defines for bits of PIM Control Block psStatWord field. These define
various session processing states required for proper device emulation.
Some of these are specific to SNA and are defined by IBM 3270 SNA
protocol.
*/
#define swENDBRACKET 0x0001 /* End Bracket */
#define swUNBIND 0x0002 /* SNA UNBIND command received */
#define swSCS 0x0004 /* device buffer contains SNA */
/* Character String (SCS) data */
/* (for printer - untranslated) */
#define swSTCHAIN 0x0008 /* current data is start of */
/* chain (or only in chain) */
#define swENDCHAIN 0x0010 /* current data is end of chain */
/* (or only in chain) */
#define swDTRESET 0x0020 /* session state = Data Traffic */
/* Reset (DTR) */
#define swNRCV 0x0040 /* session not in receive state */
#define swRCV 0x0080 /* session is in receive state */
#define swCLRSCRN 0x0100 /* screen was cleared */
#define swPR_ONLINE 0x0200 /* "online" protocol received */
#define swPR_OFFLINE 0x0400 /* "offline" protocol received */
#define swONLINE_FLAG 0x0800 /* online flag (set = online) */
#define swSPCMD 0x1000 /* ueSTATUS from SP LU Control */
/* Session processing states as found in the psProcState field of the PIM
Control Block. Note that these values are also encoded as bit settings
in the psStatWord field of the Control Block.
*/
#define prNULL 0 /* no processing state */
#define prDTRESET 1 /* Data Traffic Reset (DTR) */
#define prNRCV 2 /* not in Receive state */
#define prRCV 3 /* in Recieve state */
/* Keyboard mode definitions found or set in the psKbdMode field of the
PIM Control Block:
*/
#define kmUNDEFINED 0xff /* keyboard mode = Undefined */
#define kmOVERTYPE 0x00 /* keyboard mode = Overtype */
#define kmINSERT 0x01 /* keyboard mode = Insert */
/* Keyboard inhibit types as found in the psInhType field of the PIM
Control Block ("!" represents the man symbol in the comments):
*/
#define iUNDEFINED -1 /* inhibit state is undefiend */
#define iCLEAR 0 /* no inhibit condition present */
#define iTIME 1 /* Time required (X clock) */
#define iSYSLOCK 2 /* System Lock (X SYSTEM) */
#define iWHAT 3 /* What? (X ?+) */
#define iMINUSFUNC 4 /* Minus Function (X -f) */
#define iGOELSEWHERE 5 /* Go Elsewhere (X <-!->) */
#define iMORETHAN 6 /* More Than (X !>) */
#define iNUMERIC 7 /* Numeric (X !NUM) */
#define iCOMMCHECK 8 /* Communications Check (X COMM)*/
#define iPROGCHECK 9 /* Program Check (X PROGnnn) */
#define iMACHCHECK 10 /* Machine Check (X MACHnnn) */
#define iMINUSSYMB 11 /* Minus Symbol (X -S) */
#define iFT_INTERNAL 12 /* Internal (X -I) from FT */
#define iAPI_INTERNAL 13 /* Internal (X -I) from API */
/* Determine the host inhibit type (iCLEAR if none) based on the given
host wait and keyboard lock flags. If host wait is on, then an
"X CLOCK" condition exists, otherwise "X SYSTEM" exists if keyboard
lock is on, and no inhibit condition if both are off.
*/
#define HWKBTOINHIBIT(hw, kb) ((hw) ? iTIME : ((kb) ? iSYSLOCK : iCLEAR))
#define HOSTINHIBIT(pCB) HWKBTOINHIBIT((pCB)->psHWLock, (pCB)->psSysLock)
/* defines for keyboard lock and host wait flag values corresponding to given
inhibit conditions:
*/
#define XCLK_HWLOCK TRUE /* "X CLOCK" host wait value */
#define XCLK_KBLOCK TRUE /* "X CLOCK" kbd. lock value */
#define XSYS_HWLOCK FALSE /* "X SYSTEM" host wait value */
#define XSYS_KBLOCK TRUE /* "X SYSTEM" kbd. lock value */
/* Keyboard inhibit sub-types as found in the psInhSubTyp of the PIM Control
Block:
*/
#define isUNDEFINED -1 /* inhibit subtype is undefined */
#define isNOSUBTYPE 0 /* no inhibit sub-type */
#define isPROTECTED 1 /* in a protected field */
#define isONFLDATTR 2 /* on a field attribute byte */
#define isNOTDETECT 3 /* field is not detectable */
#define isCSNOFLDS 4 /* cursor select - no fields */
#define isCSZEROFLD 5 /* cursor select - 0 field len. */
#define isINVDETCHR 6 /* invalid detectable character */
#define isAIDKEY 7 /* inhibited due to AID key */
#define isAIDINRCV 8 /* AID key in receive state */
#define isDTRSTAID 9 /* AID key in DTR state */
#define isKEYWHTIME 10 /* key hit while "Time" inhibit */
#define isCLEAREDTO 11 /* cleared to this condition */
#define isRESETKEY 12 /* caused by RESET key */
#define isAPIDISCON 13 /* caused by API disconnect */
#define isPOWEROFF 14 /* caused by powering off */
#define isERROR 15 /* caused by ueERROR condition */
#define isFTNOTINPROG 16 /* no file transfer in progress */
#define isFTINPROGRESS 17 /* file transfer in progress */
#define isBADOWNER 18 /* bad owner for action */
/* inhibit condition origin (source) definitions: */
#define fKEYSTROKE 0 /* inhibited from keystroke */
#define fHOSTDATA 1 /* inhibited from host data */
#define fAPIPROCESS 2 /* inhibited by an API process */
/* Numeric Field validation types, as found in the psNFldMode field of the
PIM Control Block:
*/ /* In numeric fields, allow... */
#define nfALL 0x00 /* all characters */
#define nf3270NUM 0x01 /* only 3270 numerics */
#define nfNUMUPPER 0x02 /* 3270 numerics & upper alpha */
#define nfNONLOWER 0x03 /* all non lower case alpha. */
#define nfNAMED 0x04 /* all named characters */
#define nfNOTNAMED 0x05 /* all unnamed characters */
/* Workstation Control mode bits set in the "psWSCtrl" field of the PIM
Control Block:
*/
#define wsSUSPRESM 0x0001 /* WS suspend/resume supported */
#define wsLASTUSED 0x0002 /* last sent suspend/resume */
/* Optimization flags set in the "psOptFlags" field of the P
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -