-- Em3270CmdProcessDefs.mesa:    3270 Command Process Description 

-- Revised for Star 3.3h by Lui:	 7-May-84 13:10:49 
-- Owner:  Lui 

-- Overview: 
--   Em3270CmdProcessDefs provides two main functions: 
--    1) Syntax and address validation of the input stream from the IBM Host.
--    2) Execute incoming commands and orders from the IBM Host.
--   Note: The charater constants for Orders, Commands and SpecialCharacter defined is valid regardless of whether the host
--           Ebcdic(USA), Ebcdic(German), or etc...But it is different for Ascii.  


DIRECTORY
  Em3270PrivDefs USING [BaseOISToEFile, LptBufferData, LptBufOfChar, LptCmdData],
  Environment USING [Byte],
  SchemaDefs USING [Lschema];
   
Em3270CmdProcessDefs: DEFINITIONS = 
BEGIN OPEN Em3270PrivDefs;
-- =======================
--     Constants
-- =======================
 
-- =======================
--     Public Types 
-- =======================
     
Binary: TYPE = Environment.Byte[0..63];

-- Orders that are currently supported
Order: TYPE = CHARACTER;
  eraseUnprotectedToAddress: Order = 22C;
  startField: Order = 35C;
  setBufferAddress: Order = 21C;
  programTab: Order = 5C;
  insertCursor: Order = 23C;
  repeatToAddress: Order = 74C;
  
-- 3270 Commands  
Command: TYPE = CHARACTER;
  eraseAllUnprotected: Command = 157C;
  eraseWrite: Command = 365C;
  write: Command = 361C;
  eraseWriteAlternate: Command = 176C;
  readModified: Command = 366C;
  readModifiedAll: Command = 156C; 
  readBuffer: Command = 362C;
   
SpecialCharacter: TYPE = CHARACTER; 
  nullChar: SpecialCharacter = 0C;     
  CommandSeparator: SpecialCharacter = 47C;   -- EBCDIC.ESC (hex 27) seperates two commands in the command stream.
  AddressMask: SpecialCharacter = 77C;     -- mask with EBCDIC displayable character to get buffer address.

-- Control Characters.   (not supported. will be treated as data)
ControlChar: TYPE = CHARACTER; 
  ge: ControlChar = 10C;
  ff: ControlChar = 14C;
  cr: ControlChar = 15C;
  nl: ControlChar = 25C;
  em: ControlChar = 31C;
  dup: ControlChar = 34C;
  fm: ControlChar = 36C;
    
SyntaxError: PUBLIC ERROR;     -- the host command stream contains syntax errors or features that are not currently implemented 


CheckSyntax: PUBLIC PROC[my: LptCmdData, lptGetBuf: LptBufOfChar, totalBytePlusOne: CARDINAL];
-- performs syntax and address validation on host command stream. SyntaxError is raised if any error is detected

ProcessCommands: PUBLIC PROC[my: LptCmdData, lptGetBuf: LptBufOfChar, totalBytePlusOne: CARDINAL, bvChain: BOOLEAN];
-- executes host commands 

CreateCmd: PUBLIC PROC[lptBufferData: LptBufferData, lschemaWn: SchemaDefs.Lschema, lptToTransFile: BaseOISToEFile] RETURNS[cmdHandle: LptCmdData];
-- allocates spaces for Command Processor's instance data, and associates a buffer manager with the Command Processor.

DestroyCmd: PUBLIC PROC[cmdHandle: LptCmdData];
-- Deallocate Command processor's instance data.
  


END.
LOG
14-Jan-82 15:37:53     -- Lui             - Created
18-Jan-82 17:06:22     -- Lui             - added ProcessCommands
29-Jan-82 13:43:02     -- Lui             - added ControlChar
10-Feb-82 17:06:29     -- Lui             - added lptData to ProcessCommands
13-Feb-82 16:13:15     -- Lui             - added DestroyCmd, CreateCmd
18-Feb-82 15:13:09     -- Lui             - added Em3270PrivDefs 
25-Aug-82 13:07:40     -- Lui             - added lang to CreateCmd 
10-Sep-82  9:12:44     -- Lui             - changed lang in CreateCmd to lptToTransFile
29-Jun-83 13:16:44     -- Lui             - support for Read Modified.
 7-May-84 13:11:00     -- Lui             - added readModifiedAll