home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D4.DMS / in.adf / Interfaces / Rexx.mod < prev    next >
Encoding:
Text File  |  1992-12-17  |  22.8 KB  |  499 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Interface Module:                    Date: 02-Nov-92      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Fridtjof Siebert                                            *)
  6. (*                                                                         *)
  7. (*-------------------------------------------------------------------------*)
  8.  
  9. MODULE Rexx;
  10.  
  11. IMPORT e * := Exec,
  12.        d * := Dos,
  13.        sys := SYSTEM;
  14.  
  15. TYPE
  16.  
  17. (* The NexxStr structure is used to maintain the internal strings in REXX.
  18.  * It includes the buffer area for the string and associated attributes.
  19.  * This is actually a variable-length structure; it is allocated for a
  20.  * specific length string, and the length is never modified thereafter
  21.  * (since it's used for recycling).
  22.  *)
  23.  
  24.   NexxStrPtr * = UNTRACED POINTER TO NexxStr;
  25.   NexxStr * = STRUCT
  26.     ivalue * : LONGINT;              (* integer value                 *)
  27.     length * : INTEGER;              (* length in bytes (excl null)   *)
  28.     flags * : SHORTSET;              (* attribute flags               *)
  29.     hash * : SHORTINT;               (* hash code                     *)
  30.     buff * : ARRAY 8 OF CHAR;        (* buffer area for strings       *)
  31.   END;                               (* size: 16 bytes (minimum)      *)
  32.  
  33. CONST
  34.  
  35.   nxAddLen * = 9;                     (* offset plus null byte *)
  36.  
  37. (* String attribute flag bit definitions                                *)
  38.   keep     * = 0;                 (* permanent string?             *)
  39.   string   * = 1;                 (* string form valid?            *)
  40.   notNum   * = 2;                 (* non-numeric?                  *)
  41.   number   * = 3;                 (* a valid number?               *)
  42.   binary   * = 4;                 (* integer value saved?          *)
  43.   float    * = 5;                 (* floating point format?        *)
  44.   ext      * = 6;                 (* an external string?           *)
  45.   source   * = 7;                 (* part of the program source?   *)
  46.  
  47. (* Combinations of flags                                                *)
  48.   intNum   * = {number, binary, string};
  49.   dpNum    * = {number, float};
  50.   alpha    * = {notNum, string};
  51.   owned    * = {source, ext,    keep};
  52.   keepStr  * = {string, source, notNum};
  53.   keepNum  * = {string, source, number, binary};
  54.  
  55. TYPE
  56.  
  57. (* The RexxArg structure is identical to the NexxStr structure, but
  58.  * is allocated from system memory rather than from internal storage.
  59.  * This structure is used for passing arguments to external programs.
  60.  * It is usually passed as an "argstring", a pointer to the string buffer.
  61.  *)
  62.  
  63.   RexxArgPtr * = UNTRACED POINTER TO RexxArg;
  64.   RexxArg * = STRUCT
  65.     size * : LONGINT;                (* total allocated length        *)
  66.     length * : INTEGER;              (* length of string              *)
  67.     flags * : SHORTSET;              (* attribute flags               *)
  68.     hash * : SHORTINT;               (* hash code                     *)
  69.     buff * : ARRAY 8 OF CHAR;        (* buffer area                   *)
  70.   END;                               (* size: 16 bytes (minimum)      *)
  71.  
  72. (* The RexxMsg structure is used for all communications with REXX
  73.  * programs.  It is an EXEC message with a parameter block appended.
  74.  *)
  75.  
  76.   RexxMsgPtr * = UNTRACED POINTER TO RexxMsg;
  77.   RexxMsg * = STRUCT (node * : e.Message) (* EXEC message structure        *)
  78.     taskBlock * : e.APTR;           (* global structure (private)    *)
  79.     libBase * : e.LibraryPtr;       (* library base (private)        *)
  80.     action * : LONGINT;             (* command (action) code *)
  81.     result1 * : e.APTR;             (* primary result (return code)  *)
  82.     result2 * : e.APTR;             (* secondary result              *)
  83.     args * : ARRAY 16 OF e.STRPTR;  (* argument block (ARG0-ARG15)   *)
  84.  
  85.     passPort * : e.MsgPortPtr;      (* forwarding port               *)
  86.     commAddr * : e.STRPTR;          (* host address (port name)      *)
  87.     fileExt * : e.STRPTR;           (* file extension                *)
  88.     stdin * : d.FileHandlePtr;      (* input stream (filehandle)     *)
  89.     stdout * : d.FileHandlePtr;     (* output stream (filehandle)    *)
  90.     avail * : LONGINT;              (* future expansion              *)
  91.   END;                              (* size: 128 bytes               *)
  92.  
  93. CONST
  94.  
  95.   maxRMArg * = 15;                  (* maximum arguments             *)
  96.  
  97. (* Command (action) codes for message packets                           *)
  98.   rxComm     * = 001000000H;           (* a command-level invocation    *)
  99.   rxFunc     * = 002000000H;           (* a function call               *)
  100.   rxClose    * = 003000000H;           (* close the REXX server *)
  101.   rxQuery    * = 004000000H;           (* query for information *)
  102.   rxAddFH    * = 007000000H;           (* add a function host           *)
  103.   rxAddLib   * = 008000000H;           (* add a function library        *)
  104.   rxRemLib   * = 009000000H;           (* remove a function library     *)
  105.   rxAddCon   * = 00A000000H;           (* add/update a ClipList string  *)
  106.   rxRemCon   * = 00B000000H;           (* remove a ClipList string      *)
  107.   rxTCopN    * = 00C000000H;           (* open the trace console        *)
  108.   rxTCCls    * = 00D000000H;           (* close the trace console       *)
  109.  
  110. (* Command modifier flag bits                                           *)
  111.   rxNoIO     * = 000010000H;        (* suppress I/O inheritance?     *)
  112.   rxResult   * = 000020000H;        (* result string expected?       *)
  113.   rxString   * = 000040000H;        (* program is a "string file"?   *)
  114.   rxToken    * = 000080000H;        (* tokenize the command line?    *)
  115.   rxNonRet   * = 000100000H;        (* a "no-return" message?        *)
  116.  
  117.   rxfNoIO    * = 16;                (* suppress I/O inheritance?     *)
  118.   rxfResult  * = 17;                (* result string expected?       *)
  119.   rxfString  * = 18;                (* program is a "string file"?   *)
  120.   rxfToken   * = 19;                (* tokenize the command line?    *)
  121.   rxfNonRet  * = 20;                (* a "no-return" message?        *)
  122.  
  123.   rxCodeMask * = 0FF000000H;
  124.   rxArgMask  * = 00000000FH;
  125.  
  126. PROCEDURE ActionCode * (action: LONGINT): LONGINT;
  127. (*
  128.  * Filter Command code out of RexxMsg.action. Result will be one of rxComm,
  129.  * rxFunc,...
  130.  *)
  131.  
  132. BEGIN
  133.   RETURN action DIV 1000000H * 1000000H;
  134. END ActionCode;
  135.  
  136.  
  137. PROCEDURE ActionFlags * (action: LONGINT): LONGSET;
  138. (*
  139.  * Filter Command modifier flag bit out of RexxMsg.action. Result will be a set of
  140.  * rxfNoIO, rxfResult, ...
  141.  *)
  142.  
  143. BEGIN
  144.   RETURN sys.VAL(LONGSET,action)*LONGSET{16..23};
  145. END ActionFlags;
  146.  
  147.  
  148. PROCEDURE ActionArg * (action: LONGINT): LONGINT;
  149. (*
  150.  * Filter Arg out of RexxMsg.action.
  151.  *)
  152.  
  153. BEGIN
  154.   RETURN action MOD 16;
  155. END ActionArg;
  156.  
  157.  
  158. TYPE
  159.  
  160. (* The RexxRsrc structure is used to manage global resources.  Each node
  161.  * has a name string created as a RexxArg structure, and the total size
  162.  * of the node is saved in the "rr_Size" field.  The REXX systems library
  163.  * provides functions to allocate and release resource nodes.  If special
  164.  * deletion operations are required, an offset and base can be provided in
  165.  * "rr_Func" and "rr_Base", respectively.  This "autodelete" function will
  166.  * be called with the base in register A6 and the node in A0.
  167.  *)
  168.  
  169.   RexxRsrcPtr * = UNTRACED POINTER TO RexxRsrc;
  170.   RexxRsrc * = STRUCT (node * : e.Node)
  171.     func * : INTEGER;                   (* "auto-delete" offset          *)
  172.     base * : e.APTR;                    (* "auto-delete" base            *)
  173.     size * : LONGINT;                   (* total size of node            *)
  174.     arg1 * : e.APTR;                    (* available ...         *)
  175.     arg2 * : e.APTR;                    (* available ...         *)
  176.   END;                                  (* size: 32 bytes                *)
  177.  
  178. CONST
  179.  
  180. (* Resource node types                                                  *)
  181.   any      * = 0;                 (* any node type ...             *)
  182.   lib      * = 1;                 (* a function library            *)
  183.   port     * = 2;                 (* a public port         *)
  184.   file     * = 3;                 (* a file IoBuff         *)
  185.   host     * = 4;                 (* a function host               *)
  186.   clip     * = 5;                 (* a Clip List node              *)
  187.  
  188. (* The RexxTask structure holds the fields used by REXX to communicate with
  189.  * external processes, including the client task.  It includes the global
  190.  * data structure (and the base environment).  The structure is passed to
  191.  * the newly-created task in its "wake-up" message.
  192.  *)
  193.  
  194.   globalSz * = 200;               (* total size of GlobalData      *)
  195.  
  196. TYPE
  197.  
  198.   RexxTaskPtr * = UNTRACED POINTER TO RexxTask;
  199.   RexxTask * = STRUCT
  200.     global * : ARRAY globalSz OF e.BYTE;(* global data structure *)
  201.     msgPort * : e.MsgPort;              (* global message port           *)
  202.     flags * : SHORTSET;                 (* task flag bits                *)
  203.     sigBit * : SHORTINT;                (* signal bit                    *)
  204.  
  205.     clientID * : e.APTR;                (* the client's task ID          *)
  206.     msgPkt * : e.APTR;                  (* the packet being processed    *)
  207.     taskID * : e.APTR;                  (* our task ID                   *)
  208.     rexxPort * : e.APTR;                (* the REXX public port          *)
  209.  
  210.     errTrap * : e.APTR;                 (* Error trap address            *)
  211.     stackPtr * : e.APTR;                (* stack pointer for traps       *)
  212.  
  213.     header1 * : e.List;                 (* Environment list              *)
  214.     header2 * : e.List;                 (* Memory freelist               *)
  215.     header3 * : e.List;                 (* Memory allocation list        *)
  216.     header4 * : e.List;                 (* Files list                    *)
  217.     header5 * : e.List;                 (* Message Ports List            *)
  218.   END;
  219.  
  220. CONST
  221.  
  222. (* Definitions for RexxTask flag bits                                   *)
  223.   trace   * = 0;                 (* external trace flag           *)
  224.   halt    * = 1;                 (* external halt flag            *)
  225.   susp    * = 2;                 (* suspend task?         *)
  226.   tCUse   * = 3;                 (* trace console in use? *)
  227.   wait    * = 6;                 (* waiting for reply?            *)
  228.   close   * = 7;                 (* task completed?               *)
  229.  
  230. (* Definitions for memory allocation constants                          *)
  231.   memQuant * = 16;                  (* quantum of memory space       *)
  232.   memMask  * = 0FFFFFFF0H;          (* mask for rounding the size    *)
  233.  
  234.   memQuick * = LONGSET{0};          (* EXEC flags: MEMF_PUBLIC       *)
  235.   memClear * = LONGSET{16};         (* EXEC flags: MEMF_CLEAR        *)
  236.  
  237. TYPE
  238.  
  239. (* The SrcNode is a temporary structure used to hold values destined for
  240.  * a segment array.  It is also used to maintain the memory freelist.
  241.  *)
  242.  
  243.   SrcNodePtr * = UNTRACED POINTER TO SrcNode;
  244.   SrcNode * = STRUCT
  245.     succ * : SrcNodePtr;            (* next node                     *)
  246.     pred * : SrcNodePtr;            (* previous node                 *)
  247.     ptr * : e.APTR;                 (* pointer value                 *)
  248.     size * : LONGINT;               (* size of object                *)
  249.   END;                              (* size: 16 bytes                *)
  250.  
  251. CONST
  252.   rxBuffSz * = 204;                 (* buffer length         *)
  253.  
  254. TYPE
  255.  
  256. (*
  257.  * The IoBuff is a resource node used to maintain the File List.  Nodes
  258.  * are allocated and linked into the list whenever a file is opened.
  259.  *)
  260.  
  261.   IoBuffPtr * = UNTRACED POINTER TO IoBuff;
  262.   IoBuff * = STRUCT (node * : RexxRsrc) (* structure for files/strings   *)
  263.     rpt * : e.APTR;                     (* read/write pointer            *)
  264.     rct * : LONGINT;                    (* character count               *)
  265.     dFH * : d.FileHandlePtr;            (* DOS filehandle                *)
  266.     lock * : d.FileLockPtr;             (* DOS lock                      *)
  267.     bct * : LONGINT;                    (* buffer length         *)
  268.     area * : ARRAY rxBuffSz OF e.BYTE;  (* buffer area                   *)
  269.   END;                                  (* size: 256 bytes               *)
  270.  
  271. CONST
  272.  
  273. (* Access mode definitions                                              *)
  274.   ioExists  * = -1;                (* an external filehandle        *)
  275.   ioStrF    * = 0;                 (* a "string file"               *)
  276.   ioRead    * = 1;                 (* read-only access              *)
  277.   ioWrite   * = 2;                 (* write mode                    *)
  278.   ioAppend  * = 3;                 (* append mode (existing file)   *)
  279.  
  280. (*
  281.  * Offset anchors for SeekF()
  282.  *)
  283.   ioBegin * = -1;     (* relative to start             *)
  284.   ioCurr  * = 0;      (* relative to current position  *)
  285.   ioEnd   * = 1;      (* relative to end               *)
  286.  
  287. TYPE
  288.  
  289. (*
  290.  * A message port structure, maintained as a resource node.  The ReplyList
  291.  * holds packets that have been received but haven't been replied.
  292.  *)
  293.  
  294.   RexxMsgPortPtr * = UNTRACED POINTER TO RexxMsgPort;
  295.   RexxMsgPort * = STRUCT (node * : RexxRsrc) (* linkage node                  *)
  296.     port * : e.MsgPort;          (* the message port              *)
  297.     replyList * : e.List;       (* messages awaiting reply       *)
  298.   END;
  299.  
  300. CONST
  301.  
  302. (*
  303.  * DOS Device types
  304.  *)
  305.   dtDev * = 0;                  (* a device                      *)
  306.   dtDir * = 1;                  (* an ASSIGNed directory         *)
  307.   dtVol * = 2;                  (* a volume                      *)
  308.  
  309. (*
  310.  * Private DOS packet types
  311.  *)
  312.   actionStack * = 2002;         (* stack a line                  *)
  313.   actionQueue * = 2003;         (* queue a line                  *)
  314.  
  315. (* Errors: *)
  316.  
  317.   errcMsg   * = 0;                (*  error code offset           *)
  318.   err10001 * = errcMsg+1;         (*  program not found           *)
  319.   err10002 * = errcMsg+2;         (*  execution halted            *)
  320.   err10003 * = errcMsg+3;         (*  no memory available         *)
  321.   err10004 * = errcMsg+4;         (*  invalid character in program*)
  322.   err10005 * = errcMsg+5;         (*  unmatched quote             *)
  323.   err10006 * = errcMsg+6;         (*  unterminated comment        *)
  324.   err10007 * = errcMsg+7;         (*  clause too long             *)
  325.   err10008 * = errcMsg+8;         (*  unrecognized token          *)
  326.   err10009 * = errcMsg+9;         (*  symbol or string too long   *)
  327.  
  328.   err10010 * = errcMsg+10;        (*  invalid message packet      *)
  329.   err10011 * = errcMsg+11;        (*  command string error        *)
  330.   err10012 * = errcMsg+12;        (*  error return from function  *)
  331.   err10013 * = errcMsg+13;        (*  host environment not found  *)
  332.   err10014 * = errcMsg+14;        (*  required library not found  *)
  333.   err10015 * = errcMsg+15;        (*  function not found          *)
  334.   err10016 * = errcMsg+16;        (*  no return value             *)
  335.   err10017 * = errcMsg+17;        (*  wrong number of arguments   *)
  336.   err10018 * = errcMsg+18;        (*  invalid argument to function*)
  337.   err10019 * = errcMsg+19;        (*  invalid PROCEDURE           *)
  338.  
  339.   err10020 * = errcMsg+20;        (*  unexpected THEN/ELSE        *)
  340.   err10021 * = errcMsg+21;        (*  unexpected WHEN/OTHERWISE   *)
  341.   err10022 * = errcMsg+22;        (*  unexpected LEAVE or ITERATE *)
  342.   err10023 * = errcMsg+23;        (*  invalid statement in SELECT *)
  343.   err10024 * = errcMsg+24;        (*  missing THEN clauses        *)
  344.   err10025 * = errcMsg+25;        (*  missing OTHERWISE           *)
  345.   err10026 * = errcMsg+26;        (*  missing or unexpected END   *)
  346.   err10027 * = errcMsg+27;        (*  symbol mismatch on END      *)
  347.   err10028 * = errcMsg+28;        (*  invalid DO syntax           *)
  348.   err10029 * = errcMsg+29;        (*  incomplete DO/IF/SELECT     *)
  349.  
  350.   err10030 * = errcMsg+30;        (*  label not found             *)
  351.   err10031 * = errcMsg+31;        (*  symbol expected             *)
  352.   err10032 * = errcMsg+32;        (*  string or symbol expected   *)
  353.   err10033 * = errcMsg+33;        (*  invalid sub-keyword         *)
  354.   err10034 * = errcMsg+34;        (*  required keyword missing    *)
  355.   err10035 * = errcMsg+35;        (*  extraneous characters       *)
  356.   err10036 * = errcMsg+36;        (*  sub-keyword conflict        *)
  357.   err10037 * = errcMsg+37;        (*  invalid template            *)
  358.   err10038 * = errcMsg+38;        (*  invalid TRACE request       *)
  359.   err10039 * = errcMsg+39;        (*  uninitialized variable      *)
  360.  
  361.   err10040 * = errcMsg+40;        (*  invalid variable name       *)
  362.   err10041 * = errcMsg+41;        (*  invalid expression          *)
  363.   err10042 * = errcMsg+42;        (*  unbalanced parentheses      *)
  364.   err10043 * = errcMsg+43;        (*  nesting level exceeded      *)
  365.   err10044 * = errcMsg+44;        (*  invalid expression result   *)
  366.   err10045 * = errcMsg+45;        (*  expression required         *)
  367.   err10046 * = errcMsg+46;        (*  boolean value not 0 or 1    *)
  368.   err10047 * = errcMsg+47;        (*  arithmetic conversion error *)
  369.   err10048 * = errcMsg+48;        (*  invalid operand             *)
  370.  
  371. (*
  372.  * Return Codes for general use
  373.  *)
  374.   ok    * = 0;                   (*  success                     *)
  375.   warn  * = 5;                   (*  warning only        *)
  376.   error * = 10;                  (*  something's wrong           *)
  377.   fatal * = 20;                  (*  complete or severe failure  *)
  378.  
  379.  
  380.   rxsName * = "rexxsyslib.library";
  381.   rxsDir * = "REXX";
  382.   rxsTName * = "ARexx";
  383.  
  384. TYPE
  385.  
  386. (* The REXX systems library structure.  This should be considered as    *)
  387. (* semi-private and read-only, except for documented exceptions.        *)
  388.  
  389.   RxsLibPtr * = UNTRACED POINTER TO RxsLib;
  390.   RxsLib * = STRUCT (node * : e.Library) (* EXEC library node             *)
  391.     flags * : SHORTSET;                  (* global flags                  *)
  392.     shadow * : SHORTSET;                 (* shadow flags                  *)
  393.     sysBase * : e.LibraryPtr;            (* EXEC library base             *)
  394.     dosBase * : d.DosLibraryPtr;         (* DOS library base              *)
  395.     ieeeDPBase * : e.LibraryPtr;         (* IEEE DP math library base     *)
  396.     segList * : e.BPTR;                  (* library seglist               *)
  397.     nil * : d.FileHandlePtr;             (* global NIL: filehandle        *)
  398.     chunk * : LONGINT;                   (* allocation quantum            *)
  399.     maxNest * : LONGINT;                 (* maximum expression nesting    *)
  400.     null * : NexxStrPtr;                 (* static string: NULL           *)
  401.     false * : NexxStrPtr;                (* static string: FALSE          *)
  402.     true * : NexxStrPtr;                 (* static string: TRUE           *)
  403.     rexx * : NexxStrPtr;                 (* static string: REXX           *)
  404.     command * : NexxStrPtr;              (* static string: COMMAND        *)
  405.     stdin * : NexxStrPtr;                (* static string: STDIN          *)
  406.     stdout * : NexxStrPtr;               (* static string: STDOUT *)
  407.     stderr * : NexxStrPtr;               (* static string: STDERR *)
  408.     version * : e.STRPTR;                (* version string                *)
  409.  
  410.     taskName * : e.STRPTR;               (* name string for tasks *)
  411.     taskPri * : LONGINT;                 (* starting priority             *)
  412.     taskSeg * : e.BPTR;                  (* startup seglist               *)
  413.     stackSize * : LONGINT;               (* stack size                    *)
  414.     rexxDir * : e.STRPTR;                (* REXX directory                *)
  415.     cTABLE * : e.STRPTR;                 (* character attribute table     *)
  416.     notice * : e.STRPTR;                 (* copyright notice              *)
  417.  
  418.     rexxPort * : e.MsgPort;              (* REXX public port              *)
  419.     readLock* : INTEGER;                 (* lock count                    *)
  420.     traceFH * : d.FileHandlePtr;         (* global trace console          *)
  421.     taskList * : e.List;                 (* REXX task list                *)
  422.     numTask * : INTEGER;                 (* task count                    *)
  423.     libList * : e.List;                  (* Library List header           *)
  424.     numLib * : INTEGER;                  (* library count         *)
  425.     clipList * : e.List;                 (* ClipList header               *)
  426.     numClip * : INTEGER;                 (* clip node count               *)
  427.     msgList * : e.List;                  (* pending messages              *)
  428.     numMsg * : INTEGER;                  (* pending count         *)
  429.     pgmList * : e.List;                  (* cached programs               *)
  430.     numPgm * : INTEGER;                  (* program count         *)
  431.  
  432.     traceCnt * : INTEGER;                (* usage count for trace console *)
  433.     avail * : INTEGER;
  434.   END;
  435.  
  436. CONST
  437.  
  438. (* Global flag bit definitions for RexxMaster                           *)
  439. (*trace * = trace; *)              (* interactive tracing?          *)
  440. (*halt  * = halt;  *)              (* halt execution?               *)
  441. (*susp  * = susp;  *)              (* suspend execution?            *)
  442.   stop  * = 6;                     (* deny further invocations      *)
  443. (*close * = 7;     *)              (* close the master              *)
  444.  
  445.   rlfMask * = SHORTSET{trace,halt,susp};
  446.  
  447. (* Initialization constants                                             *)
  448.   rxsChunk  * = 1024;        (* allocation quantum            *)
  449.   rxsNest   * = 32;          (* expression nesting limit      *)
  450.   rxsTPri   * = 0;           (* task priority         *)
  451.   rxsStack  * = 4096;        (* stack size                    *)
  452.  
  453. (* Character attribute flag bits used in REXX.                          *)
  454.   ctSpace   * = 0;                  (* white space characters        *)
  455.   ctDigig   * = 1;                  (* decimal digits 0-9            *)
  456.   ctAlpha   * = 2;                  (* alphabetic characters *)
  457.   ctRrxxSym * = 3;                  (* REXX symbol characters        *)
  458.   ctRexxOpr * = 4;                  (* REXX operator characters      *)
  459.   ctRexxSpc * = 5;                  (* REXX special symbols          *)
  460.   ctUpper   * = 6;                  (* UPPERCASE alphabetic          *)
  461.   ctLower   * = 7;                  (* lowercase alphabetic          *)
  462.  
  463.  
  464. PROCEDURE IVALUE * (nsPtr : NexxStrPtr): LONGINT;
  465. BEGIN RETURN nsPtr.ivalue END IVALUE;
  466.  
  467. (* Field definitions                                                    *)
  468.  
  469. PROCEDURE ARG0 * (rmp: RexxMsgPtr): e.APTR; (* start of argblock             *)
  470. BEGIN RETURN rmp.args[0] END ARG0;
  471.  
  472. PROCEDURE ARG1 * (rmp: RexxMsgPtr): e.APTR; (* first argument                *)
  473. BEGIN RETURN rmp.args[1] END ARG1;
  474.  
  475. PROCEDURE ARG2 * (rmp: RexxMsgPtr): e.APTR; (* second argument               *)
  476. BEGIN RETURN rmp.args[2] END ARG2;
  477.  
  478.  
  479.  
  480. (* The Library List contains just plain resource nodes.         *)
  481.  
  482. PROCEDURE LLOFFSET * (rrp: RexxRsrcPtr): LONGINT;  (* "Query" offset     *)
  483. BEGIN RETURN sys.VAL(LONGINT,rrp.arg1) END LLOFFSET;
  484.  
  485. PROCEDURE LLVERS * (rrp: RexxRsrcPtr): LONGINT;    (* library version    *)
  486. BEGIN RETURN sys.VAL(LONGINT,rrp.arg2) END LLVERS;
  487.  
  488. (*
  489.  * The RexxClipNode structure is used to maintain the Clip List.  The value
  490.  * string is stored as an argstring in the rr_Arg1 field.
  491.  *)
  492. PROCEDURE CLVALUE * (rrp: RexxRsrcPtr): e.STRPTR;
  493. BEGIN RETURN rrp.arg1 END CLVALUE;
  494.  
  495.  
  496. END Rexx.
  497.  
  498.  
  499.