home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / M2V11-1.LHA / modula / amiga / Rexx.def < prev    next >
Encoding:
Text File  |  1993-11-10  |  19.6 KB  |  480 lines

  1. DEFINITION FOR LIBRARY MODULE Rexx ;
  2.  
  3. FROM SYSTEM    IMPORT ADDRESS, BADDRESS, SHORTSET, STRING, LONGSET ;
  4. FROM Dos    IMPORT FileHandlePtr, FileLockPtr, DosLibraryPtr ;
  5. FROM Exec    IMPORT Node, List, Message, MsgPort, MsgPortPtr, Library ,
  6.                ExecBasePtr ;
  7.  
  8. (* Definitions for ARexx error codes *)
  9.  
  10. CONST
  11.   ERRC_MSG  = 0 ;        (*  error code offset           *)
  12.   ERR10_001 = ERRC_MSG+1 ;    (*  program not found           *)
  13.   ERR10_002 = ERRC_MSG+2 ;    (*  execution halted            *)
  14.   ERR10_003 = ERRC_MSG+3 ;    (*  no memory available         *)
  15.   ERR10_004 = ERRC_MSG+4 ;    (*  invalid character in program*)
  16.   ERR10_005 = ERRC_MSG+5 ;    (*  unmatched quote             *)
  17.   ERR10_006 = ERRC_MSG+6 ;    (*  unterminated comment        *)
  18.   ERR10_007 = ERRC_MSG+7 ;    (*  clause too long             *)
  19.   ERR10_008 = ERRC_MSG+8 ;    (*  unrecognized token          *)
  20.   ERR10_009 = ERRC_MSG+9 ;    (*  symbol or string too long   *)
  21.  
  22.   ERR10_010 = ERRC_MSG+10 ;    (*  invalid message packet      *)
  23.   ERR10_011 = ERRC_MSG+11 ;    (*  command string error        *)
  24.   ERR10_012 = ERRC_MSG+12 ;    (*  error return from function  *)
  25.   ERR10_013 = ERRC_MSG+13 ;    (*  host environment not found  *)
  26.   ERR10_014 = ERRC_MSG+14 ;    (*  required library not found  *)
  27.   ERR10_015 = ERRC_MSG+15 ;    (*  function not found          *)
  28.   ERR10_016 = ERRC_MSG+16 ;    (*  no return value             *)
  29.   ERR10_017 = ERRC_MSG+17 ;    (*  wrong number of arguments   *)
  30.   ERR10_018 = ERRC_MSG+18 ;    (*  invalid argument to function*)
  31.   ERR10_019 = ERRC_MSG+19 ;    (*  invalid PROCEDURE           *)
  32.  
  33.   ERR10_020 = ERRC_MSG+20 ;    (*  unexpected THEN/ELSE        *)
  34.   ERR10_021 = ERRC_MSG+21 ;    (*  unexpected WHEN/OTHERWISE   *)
  35.   ERR10_022 = ERRC_MSG+22 ;    (*  unexpected LEAVE or ITERATE *)
  36.   ERR10_023 = ERRC_MSG+23 ;    (*  invalid statement in SELECT *)
  37.   ERR10_024 = ERRC_MSG+24 ;    (*  missing THEN clauses        *)
  38.   ERR10_025 = ERRC_MSG+25 ;    (*  missing OTHERWISE           *)
  39.   ERR10_026 = ERRC_MSG+26 ;    (*  missing or unexpected END   *)
  40.   ERR10_027 = ERRC_MSG+27 ;    (*  symbol mismatch on END      *)
  41.   ERR10_028 = ERRC_MSG+28 ;    (*  invalid DO syntax           *)
  42.   ERR10_029 = ERRC_MSG+29 ;    (*  incomplete DO/IF/SELECT     *)
  43.  
  44.   ERR10_030 = ERRC_MSG+30 ;    (*  label not found             *)
  45.   ERR10_031 = ERRC_MSG+31 ;    (*  symbol expected             *)
  46.   ERR10_032 = ERRC_MSG+32 ;    (*  string or symbol expected   *)
  47.   ERR10_033 = ERRC_MSG+33 ;    (*  invalid sub-keyword         *)
  48.   ERR10_034 = ERRC_MSG+34 ;    (*  required keyword missing    *)
  49.   ERR10_035 = ERRC_MSG+35 ;    (*  extraneous characters       *)
  50.   ERR10_036 = ERRC_MSG+36 ;    (*  sub-keyword conflict        *)
  51.   ERR10_037 = ERRC_MSG+37 ;    (*  invalid template            *)
  52.   ERR10_038 = ERRC_MSG+38 ;    (*  invalid TRACE request       *)
  53.   ERR10_039 = ERRC_MSG+39 ;    (*  uninitialized variable      *)
  54.  
  55.   ERR10_040 = ERRC_MSG+40 ;    (*  invalid variable name       *)
  56.   ERR10_041 = ERRC_MSG+41 ;    (*  invalid expression          *)
  57.   ERR10_042 = ERRC_MSG+42 ;    (*  unbalanced parentheses      *)
  58.   ERR10_043 = ERRC_MSG+43 ;    (*  nesting level exceeded      *)
  59.   ERR10_044 = ERRC_MSG+44 ;    (*  invalid expression result   *)
  60.   ERR10_045 = ERRC_MSG+45 ;    (*  expression required         *)
  61.   ERR10_046 = ERRC_MSG+46 ;    (*  boolean value not 0 or 1    *)
  62.   ERR10_047 = ERRC_MSG+47 ;    (*  arithmetic conversion error *)
  63.   ERR10_048 = ERRC_MSG+48 ;    (*  invalid operand             *)
  64.  
  65. (* Return Codes for general use *)
  66.  
  67.   RC_OK       = 0  ;        (*  success                     *)
  68.   RC_WARN  = 5  ;        (*  warning only                *)
  69.   RC_ERROR = 10 ;        (*  something's wrong           *)
  70.   RC_FATAL = 20 ;        (*  complete or severe failure  *)
  71.  
  72. (* The NexxStr structure is used to maintain the internal strings in REXX. *)
  73. (* It includes the buffer area for the string and associated attributes.   *)
  74. (* This is actually a variable-length structure; it is allocated for a     *)
  75. (* specific length string, and the length is never modified thereafter       *)
  76. (* (since it's used for recycling).                       *)
  77.  
  78. TYPE
  79.   NexxStrPtr = POINTER TO NexxStr ;
  80.   NexxStr = RECORD
  81.     ns_Ivalue    : LONGINT;    (* integer value                 *)
  82.     ns_Length    : CARDINAL ;    (* length in bytes (excl null)   *)
  83.     ns_Flags    : SHORTSET;    (* attribute flags               *)
  84.     ns_Hash    : SHORTCARD ;    (* hash code                     *)
  85.     ns_Buff    : ARRAY [0..7] OF CHAR ;
  86.                 (* buffer area for strings       *)
  87.  END ; (* size: 16 bytes (minimum) *)
  88.  
  89.  PROCEDURE IVALUE( nsPtr : NexxStrPtr ) : LONGINT ; (* nsPtr->ns_Ivalue *)
  90.  
  91. CONST
  92.   NXADDLEN    = 9 ;    (* offset plus null byte         *)
  93.  
  94. (* String attribute flag bit definitions *)
  95.  
  96.   NSB_KEEP    = 0 ;    (* permanent string?             *)
  97.   NSB_STRING    = 1 ;    (* string form valid?            *)
  98.   NSB_NOTNUM    = 2 ;    (* non-numeric?                  *)
  99.   NSB_NUMBER    = 3 ;    (* a valid number?               *)
  100.   NSB_BINARY    = 4 ;     (* integer value saved?          *)
  101.   NSB_FLOAT    = 5 ;    (* floating point format?        *)
  102.   NSB_EXT    = 6 ;    (* an external string?           *)
  103.   NSB_SOURCE    = 7 ;    (* part of the program source?   *)
  104.  
  105. (* The flag form of the string attributes *)
  106.  
  107.   NSF_KEEP    = {0} ;
  108.   NSF_STRING    = {1} ;
  109.   NSF_NOTNUM    = {2} ;
  110.   NSF_NUMBER    = {3} ;
  111.   NSF_BINARY    = {4} ;
  112.   NSF_FLOAT    = {5} ;
  113.   NSF_EXT    = {6} ;
  114.   NSF_SOURCE    = {7} ;
  115.  
  116. (* Combinations of flags *)
  117.  
  118.   NSF_INTNUM    = NSF_NUMBER + NSF_BINARY + NSF_STRING ;
  119.   NSF_DPNUM    = NSF_NUMBER + NSF_FLOAT ;
  120.   NSF_ALPHA    = NSF_NOTNUM + NSF_STRING ;
  121.   NSF_OWNED    = NSF_SOURCE + NSF_EXT + NSF_KEEP ;
  122.   KEEPSTR    = NSF_STRING + NSF_SOURCE + NSF_NOTNUM ;
  123.   KEEPNUM    = NSF_STRING + NSF_SOURCE + NSF_NUMBER + NSF_BINARY ;
  124.  
  125. (* The RexxArg structure is identical to the NexxStr structure, but       *)
  126. (* is allocated from system memory rather than from internal storage.       *)
  127. (* This structure is used for passing arguments to external programs.       *)
  128. (* It is usually passed as an "argstring", a pointer to the string buffer. *)
  129.  
  130. TYPE
  131.   RexxArgPtr = POINTER TO RexxArg ;
  132.   RexxArg = RECORD
  133.     ra_Size    : LONGINT ;    (* total allocated length        *)
  134.     ra_Length    : CARDINAL ;    (* length of string              *)
  135.     ra_Flags    : SHORTSET ;    (* attribute flags               *)
  136.     ra_Hash    : SHORTCARD ;    (* hash code                     *)
  137.     ra_Buff    : ARRAY [0..7] OF CHAR ;
  138.                 (* buffer area                   *)
  139.   END ;                (* size: 16 bytes (minimum)      *)
  140.  
  141. (* The RexxMsg structure is used for all communications with REXX    *)
  142. (* programs.  It is an EXEC message with a parameter block appended. *)
  143.  
  144.   RexxMsgPtr = POINTER TO RexxMsg ;
  145.   RexxMsg = RECORD
  146.     rm_Node    : Message ;    (* EXEC message structure        *)
  147.     rm_TaskBlock: ADDRESS ;    (* global structure (private)    *)
  148.     rm_LibBase    : ADDRESS ;    (* library base (private)        *)
  149.     rm_Action    : LONGINT ;    (* command (action) code         *)
  150.     rm_Result1    : LONGINT ;    (* primary result (return code)  *)
  151.     rm_Result2    : LONGINT ;    (* secondary result              *)
  152.     rm_Args    : ARRAY [0..15] OF STRING ;
  153.                 (* argument block (ARG0-ARG15)   *)
  154.  
  155.     rm_PassPort    : MsgPortPtr;    (* forwarding port               *)
  156.     rm_CommAddr    : STRING ;    (* host address (port name)      *)
  157.     rm_FileExt    : STRING ;    (* file extension                *)
  158.     rm_Stdin    : FileHandlePtr;(* input stream (filehandle)     *)
  159.     rm_Stdout    : FileHandlePtr;(* output stream (filehandle)    *)
  160.     rm_avail    : LONGINT;    (* future expansion              *)
  161.   END ;    (* size: 128 bytes *)
  162.  
  163. (* Field definitions macros *)
  164.   PROCEDURE ARG0( rmp : RexxMsgPtr ) : STRING ; (* start of argblock    *)
  165.   PROCEDURE ARG1( rmp : RexxMsgPtr ) : STRING ; (* first argument    *)
  166.   PROCEDURE ARG2( rmp : RexxMsgPtr ) : STRING ; (* second argument    *)
  167.  
  168. CONST
  169.  
  170.   MAXRMARG = 15 ; (* maximum arguments *)
  171.  
  172. (* Command (action) codes for message packets *)
  173.  
  174.   RXCOMM    = 01000000H ;    (* a command-level invocation    *)
  175.   RXFUNC    = 02000000H ;    (* a function call               *)
  176.   RXCLOSE    = 03000000H ;    (* close the REXX server         *)
  177.   RXQUERY    = 04000000H ;    (* query for information         *)
  178.   RXADDFH    = 07000000H ;    (* add a function host           *)
  179.   RXADDLIB    = 08000000H ;    (* add a function library        *)
  180.   RXREMLIB    = 09000000H ;    (* remove a function library     *)
  181.   RXADDCON    = 0A000000H ;    (* add/update a ClipList string  *)
  182.   RXREMCON    = 0B000000H ;    (* remove a ClipList string      *)
  183.   RXTCOPN    = 0C000000H ;    (* open the trace console        *)
  184.   RXTCCLS    = 0D000000H ;    (* close the trace console       *)
  185.  
  186. (* Command modifier flag bits *)
  187.  
  188.   RXFB_NOIO     = 16 ;    (* suppress I/O inheritance?     *)
  189.   RXFB_RESULT     = 17 ;    (* result string expected?       *)
  190.   RXFB_STRING     = 18 ;    (* program is a "string file"?   *)
  191.   RXFB_TOKEN     = 19 ;    (* tokenize the command line?    *)
  192.   RXFB_NONRET     = 20 ;    (* a "no-return" message?        *)
  193.  
  194. (* The flag form of the command modifiers *)
  195.  
  196.   RXFF_NOIO     = 00010000H ;
  197.   RXFF_RESULT     = 00020000H ;
  198.   RXFF_STRING     = 00040000H ;
  199.   RXFF_TOKEN     = 00080000H ;
  200.   RXFF_NONRET     = 00100000H ;
  201.  
  202.   RXCODEMASK     = 0FF000000H ;
  203.   RXARGMASK     = 00000000FH ;
  204.  
  205. (* The RexxRsrc structure is used to manage global resources.  Each node   *)
  206. (* has a name string created as a RexxArg structure, and the total size    *)
  207. (* of the node is saved in the "rr_Size" field.  The REXX systems library  *)
  208. (* provides functions to allocate and release resource nodes.  If special  *)
  209. (* deletion operations are required, an offset and base can be provided in *)
  210. (* "rr_Func" and "rr_Base", respectively.  This "autodelete" function will *)
  211. (* be called with the base in register A6 and the node in A0.           *)
  212.  
  213. TYPE
  214.   RexxRsrcPtr = POINTER TO RexxRsrc ;
  215.   RexxRsrc = RECORD
  216.     rr_Node : Node ;
  217.     rr_Func : INTEGER ; (* "auto-delete" offset          *)
  218.     rr_Base : ADDRESS ; (* "auto-delete" base            *)
  219.     rr_Size : LONGINT ; (* total size of node            *)
  220.     rr_Arg1 : LONGINT ; (* available ...                 *)
  221.     rr_Arg2 : LONGINT ; (* available ...                 *)
  222.   END ;    (* size: 32 bytes *)
  223.  
  224. CONST
  225. (* Resource node types *)
  226.  
  227.   RRT_ANY   = 0 ; (* any node type ...             *)
  228.   RRT_LIB   = 1 ; (* a function library            *)
  229.   RRT_PORT  = 2 ; (* a public port                 *)
  230.   RRT_FILE  = 3 ; (* a file IoBuff                 *)
  231.   RRT_HOST  = 4 ; (* a function host               *)
  232.   RRT_CLIP  = 5 ; (* a Clip List node              *)
  233.  
  234. (* The RexxTask structure holds the fields used by REXX to communicate with *)
  235. (* external processes, including the client task.  It includes the global   *)
  236. (* data structure (and the base environment).  The structure is passed to   *)
  237. (* the newly-created task in its "wake-up" message.                *)
  238.  
  239.   GLOBALSZ = 200 ; (* total size of GlobalData *)
  240.  
  241. TYPE
  242.   RexxTaskPtr = POINTER TO RexxTask ;
  243.   RexxTask = RECORD
  244.     rt_Global    : ARRAY [0..GLOBALSZ-1] OF SHORTINT ;
  245.                 (* global data structure         *)
  246.     rt_MsgPort    : MsgPort  ;    (* global message port           *)
  247.     rt_Flags    : SHORTSET ;    (* task flag bits                *)
  248.     rt_SigBit    : SHORTINT ;    (* signal bit                    *)
  249.  
  250.     rt_ClientID    : ADDRESS ;     (* the client's task ID          *)
  251.     rt_MsgPkt    : ADDRESS ;    (* the packet being processed    *)
  252.     rt_TaskID    : ADDRESS ;    (* our task ID                   *)
  253.     rt_RexxPort    : ADDRESS ;    (* the REXX public port          *)
  254.  
  255.     rt_ErrTrap    : ADDRESS ;    (* Error trap address            *)
  256.     rt_StackPtr    : ADDRESS ;    (* stack pointer for traps       *)
  257.  
  258.     rt_Header1    : List ;    (* Environment list              *)
  259.     rt_Header2    : List ;    (* Memory freelist               *)
  260.     rt_Header3    : List ;    (* Memory allocation list        *)
  261.     rt_Header4    : List ;    (* Files list                    *)
  262.     rt_Header5    : List ;    (* Message Ports List            *)
  263.   END ;
  264.  
  265. CONST
  266. (* Definitions for RexxTask flag bits *)
  267.  
  268.   RTFB_TRACE     = 0 ;     (* external trace flag           *)
  269.   RTFB_HALT     = 1 ;     (* external halt flag            *)
  270.   RTFB_SUSP     = 2 ;     (* suspend task?                 *)
  271.   RTFB_TCUSE     = 3 ;     (* trace console in use?         *)
  272.   RTFB_WAIT     = 6 ;     (* waiting for reply?            *)
  273.   RTFB_CLOSE     = 7 ;     (* task completed?               *)
  274.  
  275. (* Definitions for memory allocation constants *)
  276.  
  277.   MEMQUANT     = 16 ;        (* quantum of memory space       *)
  278.   MEMMASK     = 0FFFFFFF0H ;    (* mask for rounding the size    *)
  279.  
  280.   MEMQUICK     = 1 ;        (* EXEC flags: MEMF_PUBLIC       *)
  281.   MEMCLEAR     = 00010000H ;    (* EXEC flags: MEMF_CLEAR        *)
  282.  
  283. (* The SrcNode is a temporary structure used to hold values destined for *)
  284. (* a segment array.  It is also used to maintain the memory freelist.     *)
  285.  
  286. TYPE
  287.   SrcNodePtr = POINTER TO SrcNode ;
  288.   SrcNode = RECORD
  289.     sn_Succ : SrcNodePtr ; (* next node      *)
  290.     sn_Pred : SrcNodePtr ; (* previous node  *)
  291.     sn_Ptr  : ADDRESS    ; (* pointer value  *)
  292.     sn_Size : LONGINT    ; (* size of object *)
  293.   END ; (* size: 16 bytes *)
  294.  
  295. (* ARexx Input/Output related structures *)
  296.  
  297. CONST
  298.   RXBUFFSZ    = 204; (* buffer length *)
  299.  
  300. (* The IoBuff is a resource node used to maintain the File List.  Nodes *)
  301. (* are allocated and linked into the list whenever a file is opened.    *)
  302.  
  303. TYPE
  304.   IoBuffPtr = POINTER TO IoBuff ;
  305.   IoBuff = RECORD
  306.     iobNode     : RexxRsrc;     (* structure for files/strings   *)
  307.     iobRpt     : ADDRESS;     (* read/write pointer            *)
  308.     iobRct     : LONGINT;     (* character count               *)
  309.     iobDFH     : FileHandlePtr;(* DOS filehandle                *)
  310.     iobLock     : FileLockPtr;     (* DOS lock                      *)
  311.     iobBct     : LONGINT;     (* buffer length                 *)
  312.     iobArea     : ARRAY [0..RXBUFFSZ-1] OF SHORTINT ;
  313.                  (* buffer area                   *)
  314.   END ; (* size: 256 bytes *)
  315.  
  316. CONST
  317.  
  318. (* Access mode definitions *)
  319.  
  320.   RXIO_EXIST     = -1 ;     (* an external filehandle        *)
  321.   RXIO_STRF     =  0 ;     (* a "string file"               *)
  322.   RXIO_READ     =  1 ;     (* read-only access              *)
  323.   RXIO_WRITE     =  2 ;     (* write mode                    *)
  324.   RXIO_APPEND     =  3 ;     (* append mode (existing file)   *)
  325.  
  326. (* Offset anchors for SeekF() *)
  327.  
  328.   RXIO_BEGIN     = -1 ;     (* relative to start             *)
  329.   RXIO_CURR     =  0 ;     (* relative to current position  *)
  330.   RXIO_END     =  1 ;     (* relative to end               *)
  331.  
  332.  
  333. (* A message port structure, maintained as a resource node.  The ReplyList *)
  334. (* holds packets that have been received but haven't been replied.       *)
  335.  
  336. TYPE
  337.   RexxMsgPortPtr = POINTER TO RexxMsgPort ;
  338.   RexxMsgPort = RECORD
  339.     rmp_Node      : RexxRsrc ;    (* linkage node                  *)
  340.     rmp_Port      : MsgPort ;    (* the message port              *)
  341.     rmp_ReplyList : List ;    (* messages awaiting reply       *)
  342.   END ;
  343.  
  344. (* The Library List contains just plain resource nodes.    *)
  345.  
  346.   PROCEDURE LLOFFSET( rrp : RexxRsrcPtr ) : LONGINT ; (* "Query" offset     *)
  347.   PROCEDURE LLVERS( rrp : RexxRsrcPtr ) : LONGINT ;   (* library version *)
  348.  
  349. (* The RexxClipNode structure is used to maintain the Clip List.  The value *)
  350. (* string is stored as an argstring in the rr_Arg1 field.            *)
  351.  
  352.   PROCEDURE CLVALUE( rrp : RexxRsrcPtr ) : STRING ;
  353.  
  354. CONST
  355.  
  356. (* DOS Device types *)
  357.  
  358.   DT_DEV = 0 ;    (* a device                      *)
  359.   DT_DIR = 1 ;    (* an ASSIGNed directory         *)
  360.   DT_VOL = 2 ;    (* a volume                      *)
  361.  
  362. (* Private DOS packet types *)
  363.  
  364.   ACTION_STACK    = 2002 ; (* stack a line *)
  365.   ACTION_QUEUE    = 2003 ; (* queue a line *)
  366.  
  367. CONST
  368.   RXSNAME  = "rexxsyslib.library" ;
  369.   RXSDIR   = "REXX" ;
  370.   RXSTNAME = "ARexx" ;
  371.  
  372. TYPE
  373.   RxsLibPtr = POINTER TO RxsLib ;
  374.  
  375. VAR
  376.   RexxSysBase : RxsLibPtr ;
  377.  
  378. (* The REXX systems library structure.  This should be considered as    *)
  379. (* semi-private and read-only, except for documented exceptions.        *)
  380.  
  381. TYPE
  382.   RxsLib = RECORD
  383.     rl_Node        : Library ;    (* EXEC library node             *)
  384.     rl_Flags        : SHORTSET ;    (* global flags                  *)
  385.     rl_pad        : SHORTCARD ;
  386.     rl_SysBase        : ExecBasePtr ;    (* EXEC library base             *)
  387.     rl_DOSBase        : DosLibraryPtr;(* DOS library base              *)
  388.     rl_IeeeDPBase    : ADDRESS ;    (* IEEE DP math library base     *)
  389.     rl_SegList        : BADDRESS ;    (* library seglist               *)
  390.     rl_NIL        : FileHandlePtr;(* global NIL: filehandle        *)
  391.     rl_Chunk        : LONGINT ;    (* allocation quantum            *)
  392.     rl_MaxNest        : LONGINT ;    (* maximum expression nesting    *)
  393.     rl_NULL        : NexxStrPtr ;    (* static string: NULL           *)
  394.     rl_FALSE        : NexxStrPtr ;    (* static string: FALSE          *)
  395.     rl_TRUE        : NexxStrPtr ;    (* static string: TRUE           *)
  396.     rl_REXX        : NexxStrPtr ;    (* static string: REXX           *)
  397.     rl_COMMAND        : NexxStrPtr ;    (* static string: COMMAND        *)
  398.     rl_STDIN        : NexxStrPtr ;    (* static string: STDIN          *)
  399.     rl_STDOUT        : NexxStrPtr ;    (* static string: STDOUT         *)
  400.     rl_STDERR        : NexxStrPtr ;    (* static string: STDERR         *)
  401.     rl_Version        : STRING ;    (* version/configuration string  *)
  402.  
  403.     rl_TaskName        : STRING ;    (* name string for tasks         *)
  404.     rl_TaskPri        : LONGINT ;    (* starting priority             *)
  405.     rl_TaskSeg        : ADDRESS ;    (* startup seglist               *)
  406.     rl_StackSize    : LONGINT ;    (* stack size                    *)
  407.     rl_RexxDir        : STRING ;    (* REXX directory                *)
  408.     rl_CTABLE        : STRING ;    (* character attribute table     *)
  409.     rl_Notice        : NexxStrPtr;    (* copyright notice              *)
  410.  
  411.     rl_RexxPort        : MsgPort ;    (* REXX public port              *)
  412.     rl_ReadLock        : CARDINAL ;    (* lock count                    *)
  413.     rl_TraceFH        : ADDRESS ;    (* global trace console          *)
  414.     rl_TaskList        : List ;     (* REXX task list                *)
  415.     rl_NumTask        : INTEGER ;    (* task count                    *)
  416.     rl_LibList        : List ;    (* Library List header           *)
  417.     rl_NumLib        : INTEGER ;    (* library count                 *)
  418.     rl_ClipList        : List ;    (* ClipList header               *)
  419.     rl_NumClip        : INTEGER;    (* clip node count               *)
  420.     rl_MsgList        : List ;    (* pending messages              *)
  421.     rl_NumMsg        : INTEGER ;    (* pending count                 *)
  422.     rl_PgmList        : List ;    (* cached programs               *)
  423.     rl_NumPgm        : INTEGER ;    (* program count                 *)
  424.  
  425.     rl_TraceCnt        : CARDINAL ;    (* usage count for trace console *)
  426.     rl_avail        : INTEGER ;
  427.   END ;
  428.  
  429. CONST
  430.  
  431. (* Global flag bit definitions for RexxMaster *)
  432.   RLFB_TRACE    = RTFB_TRACE ;    (* interactive tracing?          *)
  433.   RLFB_HALT    = RTFB_HALT ;    (* halt execution?               *)
  434.   RLFB_SUSP    = RTFB_SUSP ;    (* suspend execution?            *)
  435.   RLFB_STOP    = 6 ;        (* deny further invocations      *)
  436.   RLFB_CLOSE    = 7 ;        (* close the master              *)
  437.  
  438.  
  439.   RLFMASK    = {RLFB_TRACE,RLFB_HALT,RLFB_SUSP} ;
  440.  
  441. (* Initialization constants *)
  442.  
  443.   RXSCHUNK    = 1024 ;    (* allocation quantum            *)
  444.   RXSNEST    = 32 ;        (* expression nesting limit      *)
  445.   RXSTPRI    = 0 ;        (* task priority                 *)
  446.   RXSSTACK    = 4096 ;    (* stack size                    *)
  447.  
  448. (* Character attribute flags & bits used in REXX. *)
  449.  
  450.   CTB_SPACE    = 0 ;  CTF_SPACE    = {0} ;    (* white space characters     *)
  451.   CTB_DIGIT    = 1 ;  CTF_DIGIT    = {1} ;    (* decimal digits 0-9         *)
  452.   CTB_ALPHA    = 2 ;  CTF_ALPHA    = {2} ;    (* alphabetic characters      *)
  453.   CTB_REXXSYM    = 3 ;  CTF_REXXSYM    = {3} ;    (* REXX symbol characters     *)
  454.   CTB_REXXOPR    = 4 ;  CTF_REXXOPR    = {4} ;    (* REXX operator characters   *)
  455.   CTB_REXXSPC    = 5 ;  CTF_REXXSPC    = {5} ;    (* REXX special symbols       *)
  456.   CTB_UPPER    = 6 ;  CTF_UPPER    = {6} ;    (* UPPERCASE alphabetic       *)
  457.   CTB_LOWER    = 7 ;  CTF_LOWER    = {7} ;    (* lowercase alphabetic       *)
  458.  
  459. PROCEDURE CreateArgstring( str : STRING ; length : LONGINT ) : STRING ;
  460. PROCEDURE DeleteArgstring( argstr : STRING ) ;
  461. PROCEDURE LengthArgstring( argstring : STRING ) : LONGINT ;
  462.  
  463. PROCEDURE CreateRexxMsg( port : MsgPortPtr ;
  464.              extension : STRING ;
  465.              host : STRING ) : RexxMsgPtr ;
  466.  
  467. PROCEDURE DeleteRexxMsg( packet : RexxMsgPtr );
  468.  
  469. PROCEDURE ClearRexxMsg( msgptr : RexxMsgPtr ; count : LONGINT ) ;
  470.  
  471. PROCEDURE FillRexxMsg( msgptr : RexxMsgPtr ;
  472.                count  : LONGINT ;
  473.                mask   : LONGSET ) : BOOLEAN ;
  474.  
  475. PROCEDURE IsRexxMsg( msgptr : RexxMsgPtr ) : BOOLEAN ;
  476. PROCEDURE LockRexxBase( resource : LONGINT ) ;
  477. PROCEDURE UnlockRexxBase( resource : LONGINT ) ;
  478.  
  479. END Rexx.
  480.