home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / development / clusterdemo.dms / clusterdemo.adf / Modules.lha / modules / txt / Rexx.def < prev    next >
Text File  |  1994-05-25  |  11KB  |  351 lines

  1. |##########|
  2. |#MAGIC   #|CLABLLFI
  3. |#PROJECT #|""
  4. |#PATHS   #|"StdProject"
  5. |#FLAGS   #|xx-x-x--x---x-x-----------------
  6. |#USERSW  #|--------------------------------
  7. |#USERMASK#|--------------------------------
  8. |#SWITCHES#|xx---xxxxx------
  9. |##########|
  10. DEFINITION MODULE Rexx;
  11. (* $A- *)
  12. FROM System    IMPORT BITSET,BPTR,Regs;
  13. FROM Dos       IMPORT DeviceListPtr,DosLibraryPtr,FileHandlePtr,
  14.                       FileLockPtr,StandardPacketPtr;
  15. FROM Exec      IMPORT ExecBasePtr,Library,List,ListPtr,MemReqs,Message,
  16.                       MessagePtr,MsgPort,MsgPortPtr,Node,NodePtr;
  17.  
  18. TYPE
  19.   RexxErrors           = (ok,
  20.                           programNotFound,
  21.                           executionNotHalted,
  22.                           noMemoryAvailable,
  23.                           invalidCharacterInProgram,
  24.                           unmatchedQuote,
  25.                           unterminatedComment,
  26.                           clauseTooLong,
  27.                           unrecognizedToken,
  28.                           symbolOrStringTooLong,
  29.  
  30.                           invalidMessagePacket,
  31.                           commandStringError,
  32.                           errorReturnFromFunction,
  33.                           hostEnvironmentNotFound,
  34.                           requiredLibraryNotFound,
  35.                           functionNotFound,
  36.                           noReturnValue,
  37.                           wrongNumbersOfArguments,
  38.                           invalidArgumentToFunction,
  39.                           invalidProcedure,
  40.  
  41.                           unexpectedThenElse,
  42.                           unexpectedWhenOtherwise,
  43.                           unexpectedLeaveIterate,
  44.                           invalidStatementInSelect,
  45.                           missingThenClauses,
  46.                           missingOtherwise,
  47.                           missingOrUnexpectedEnd,
  48.                           symbolMismatchOnEnd,
  49.                           invalidDoSyntax,
  50.                           incompleteDoIfSelec,
  51.  
  52.                           labelNotFound,
  53.                           symbolExpected,
  54.                           stringOrSymbolExpected,
  55.                           invalidSubKeyword,
  56.                           requiredKeywordMissing,
  57.                           extraneousCharacters,
  58.                           subKeywordConflict,
  59.                           invalidTemplate,
  60.                           invalidTraceRequest,
  61.                           uninitializedVariable,
  62.  
  63.                           invalidVariableName,
  64.                           invalidExpression,
  65.                           unbalancedParentheses,
  66.                           nestingLevelExceeded,
  67.                           invalidExpressionResult,
  68.                           expressionRequired,
  69.                           booleanValueNot0or1,
  70.                           arithmeticConversionError,
  71.                           invalidOperand);
  72.  
  73. CONST
  74.   ReturnOk             = 0;
  75.   ReturnWarn           = 5;
  76.   ReturnError          = 10;
  77.   ReturnFatal          = 20;
  78.  
  79. TYPE
  80.   AttributeFlags       = (keep,string,notNum,number,binary,float,ext,
  81.                           source);
  82.   AttributeFlagSet     = SET OF AttributeFlags;
  83.   NexxStr              = RECORD
  84.                            iValue   : LONGINT;
  85.                            length   : CARDINAL;
  86.                            flags    : AttributeFlagSet;
  87.                            hash     : SHORTCARD;
  88.                            (*buff    : ARRAY OF CHAR;*)
  89.                          END;
  90.   NexxStrPtr           = POINTER TO NexxStr;
  91.  
  92. CONST
  93.   intNum    = AttributeFlagSet:{number,binary,string};
  94.   dpNum     = AttributeFlagSet:{number,float};
  95.   alpha     = AttributeFlagSet:{notNum,string};
  96.   owned     = AttributeFlagSet:{source,ext,keep};
  97.   keepStr   = AttributeFlagSet:{string,source,notNum};
  98.   keepNum   = AttributeFlagSet:{string,source,number,binary};
  99.  
  100. TYPE
  101.   RexxArg     = RECORD
  102.                   size    : LONGINT;
  103.                   length  : CARDINAL;
  104.                   flags   : AttributeFlagSet;
  105.                   hash    : SHORTCARD;
  106.                   (* buff    : ARRAY OF CHAR *)
  107.                 END;
  108.    RexxArgPtr = POINTER TO RexxArg;
  109.  
  110. CONST
  111.   maxRMArg = 15;
  112.  
  113. TYPE
  114.   Command         = (co0,comn,func,close,query,co5,co6,addFH,addLib,remLib,
  115.                      addCon,remCon,tcOpn,tcCls);
  116.  
  117.   ModifierFlags   = (noIO,result,moString,token,nonRet,mo5,mo6,mo7);
  118.   ModifierFlagSet = SET OF ModifierFlags;
  119.  
  120.   ActionRec       = RECORD
  121.                       command   : Command;
  122.                       modifier  : ModifierFlagSet;
  123.                       add       : CARDINAL
  124.                     END;
  125.  
  126.   RexxMsg         = RECORD OF Message
  127.                       taskBlock,
  128.                       libBase     : ANYPTR;
  129.                       action      : ActionRec;
  130.                       result1,
  131.                       result2     : LONGINT;
  132.                       args        : ARRAY [0..maxRMArg] OF ANYPTR;
  133.                       passPort    : MsgPortPtr;
  134.                       commAddr,
  135.                       fileExt     : ANYPTR;
  136.                       stdin,
  137.                       stdout      : FileHandlePtr;
  138.                       avail       : LONGINT
  139.                     END;
  140.   RexxMsgPtr      = POINTER TO RexxMsg;
  141.  
  142.   RexxRsrc        = RECORD OF Node
  143.                       func  : INTEGER;
  144.                       base  : ANYPTR;
  145.                       size,
  146.                       arg1,
  147.                       arg2  : LONGINT
  148.                     END;
  149.   RexxRsrcPtr     = POINTER TO RexxRsrc;
  150.   RsrcNodeType    = (any,lib,port,file,host,clip);
  151.  
  152. CONST
  153.   globalsz   = 200;
  154.  
  155. TYPE
  156.   RexxTaskFlags      = (trace,halt,susp,tcUse,rtf4,rtf5,wait,rtfClose);
  157.   RexxTaskFlagSet    = SET OF RexxTaskFlags;
  158.   RexxTask           = RECORD
  159.                          global    : ARRAY [0..globalsz-1] OF SHORTINT;
  160.                          msgPort   : MsgPort;
  161.                          flags     : RexxTaskFlagSet;
  162.                          sigBit    : SHORTCARD;
  163.                          clientID,
  164.                          msgPkt,
  165.                          taskID,
  166.                          rexxPort,
  167.                          errTrap,
  168.                          stackPtr  : ANYPTR;
  169.                          envList,
  170.                          freeList,
  171.                          memList,
  172.                          fileList,
  173.                          portList  : List
  174.                        END;
  175.   RexxTaskPtr        = POINTER TO RexxTask;
  176.  
  177. CONST
  178.   memQuant   = $10;
  179.   memMask    = $FFFFFFF0;
  180.   memQuick   = public;
  181.  
  182. TYPE
  183.   SrcNodePtr = POINTER TO SrcNode;
  184.   SrcNode    = RECORD
  185.                  succ,
  186.                  pred  : SrcNodePtr;
  187.                  ptr   : ANYPTR;
  188.                  size  : LONGINT
  189.                END;
  190.  
  191. CONST
  192.   rxsdir   = "REXX";
  193.   rxstname = "ARexx";
  194.  
  195. TYPE
  196.   RxsLibPtr  = POINTER TO RxsLib;
  197.   RxsLib     = RECORD OF Library
  198.                  flags      : RexxTaskFlagSet;
  199.                  sysBase    : ExecBasePtr;
  200.                  dosBase    : DosLibraryPtr;
  201.                  ieeeDPBase : ANYPTR;
  202.                  segList    : BPTR;
  203.                  nil        : FileHandlePtr;
  204.                  chunk,
  205.                  maxNest    : LONGINT;
  206.                  null,
  207.                  false,
  208.                  true,
  209.                  rexx,
  210.                  command,
  211.                  stdin,
  212.                  stdout,
  213.                  stderr     : NexxStrPtr;
  214.                  version,
  215.                  taskName   : ANYPTR;
  216.                  taskPri    : LONGINT;
  217.                  taskSeg    : BPTR;
  218.                  stackSize  : LONGINT;
  219.                  rexxDir,
  220.                  cTable     : ANYPTR;
  221.                  notice     : NexxStrPtr;
  222.                  rexxPort   : MsgPort;
  223.                  readLock   : CARDINAL;
  224.                  traceFH    : FileHandlePtr;
  225.                  taskList   : List;
  226.                  numTask    : INTEGER;
  227.                  libList    : List;
  228.                  numLib     : INTEGER;
  229.                  clipList   : List;
  230.                  numClip    : INTEGER;
  231.                  msgList    : List;
  232.                  numMsg     : INTEGER;
  233.                  pgmList    : List;
  234.                  numPgm     : INTEGER;
  235.                  traceCnt   : CARDINAL;
  236.                  avail      : INTEGER
  237.                END;
  238.  
  239.  
  240. CONST
  241.   tcOpen       = rtf4;
  242.   stop         = wait;
  243.   vers         = 34;
  244.   rev          = 9;
  245.   rxsalloc     = $80000000;
  246.   rxschunk     = $00000400;
  247.   rxsnest      = $00000020;
  248.   rxstpri      = $00000000;
  249.   rxsstack     = $00001000;
  250.   rxslisth     = $00000005;
  251.  
  252. TYPE
  253.   CharAttrFlags     = (space,digit,caAlpha,rexxSym,rexxOpr,rexxSpc,upper,
  254.                        lower);
  255.   CharAttrFlagSet   = SET OF CharAttrFlags;
  256.  
  257. CONST
  258.    buffsz  = 204;
  259.  
  260. TYPE
  261.   IoBuff    = RECORD  OF RexxRsrc;
  262.                 rpt   : ANYPTR;
  263.                 rct   : LONGINT;
  264.                 dfh,
  265.                 lock  : FileLockPtr;
  266.                 bct   : LONGINT;
  267.                 area  : ARRAY [0..buffsz-1] OF SHORTINT
  268.               END;
  269.   IoBuffPtr = POINTER TO IoBuff;
  270.  
  271. CONST
  272.   exist   = -1;
  273.   strf    =  0;
  274.   read    =  1;
  275.   write   =  2;
  276.   append  =  3;
  277.  
  278. TYPE
  279.   RexxMsgPort = RECORD OF RexxRsrc;
  280.                   port      : MsgPort;
  281.                   replyList : List
  282.                 END;
  283.  
  284. CONST
  285.   stack  = 2002;
  286.   queue  = 2003;
  287.  
  288.   fail   = -1;
  289.  
  290. VAR
  291.   RexxBase   : RxsLibPtr;
  292.  
  293. LIBRARY RexxBase BY -126
  294.   PROCEDURE CreateArgstring(String IN A0 : ANYPTR;
  295.                             Length IN D0 : LONGINT):ANYPTR;
  296.  
  297. LIBRARY RexxBase BY -132
  298.   PROCEDURE DeleteArgstring(ArgString IN A0 : ANYPTR);
  299.  
  300. LIBRARY RexxBase BY -138
  301.   PROCEDURE LengthArgstring(Arg IN A0 :RexxArgPtr):LONGINT;
  302.  
  303. LIBRARY RexxBase BY -144
  304.   PROCEDURE CreateRexxMsg(ReplyPort IN A0 : MsgPortPtr;
  305.                           Extension IN A1 : ANYPTR;
  306.                           Host      IN D0 : ANYPTR):RexxMsgPtr;
  307.  
  308. LIBRARY RexxBase BY -150
  309.   PROCEDURE DeleteRexxMsg(Message IN A0 : RexxMsgPtr);
  310.  
  311. LIBRARY RexxBase BY -156
  312.   PROCEDURE ClearRexxMsg(MsgPtr  IN A0 : MessagePtr;
  313.                          Count   IN D0 : LONGINT);
  314.  
  315. LIBRARY RexxBase BY -162
  316.   PROCEDURE FillRexxMsg(MsgPtr   IN A0 : RexxMsgPtr;
  317.                         Count    IN D0 : LONGINT;
  318.                         Mask     IN D1 : BITSET):BOOLEAN;
  319.  
  320. LIBRARY RexxBase BY -168
  321.   PROCEDURE IsRexxMsg(MsgPtr IN A0 : MessagePtr):BOOLEAN;
  322.  
  323.  
  324. LIBRARY RexxBase BY -450
  325.   PROCEDURE LockRexxBase(Resource IN D0 : RsrcNodeType);
  326.  
  327. LIBRARY RexxBase BY -456
  328.   PROCEDURE UnlockRexxBase(Resource IN D0 : RsrcNodeType);
  329.  
  330.  
  331. GROUP
  332.   TypeGrp  =  AttributeFlags,AttributeFlagSet,NexxStr,NexxStrPtr,intNum,
  333.               dpNum,alpha,owned,keepStr,keepNum,RexxArg,RexxArgPtr,
  334.               maxRMArg,Command,ModifierFlags,ModifierFlagSet,ActionRec,
  335.               RexxMsg,RexxMsgPtr,RexxRsrc,RexxRsrcPtr,RsrcNodeType,
  336.               globalsz,RexxTaskFlags,RexxTaskFlagSet,RexxTask,RexxTaskPtr,
  337.               memQuant,memMask,memQuick,SrcNodePtr,SrcNode,rxsdir,
  338.               rxstname,RxsLib,tcOpen,stop,vers,rev,rxsalloc,rxschunk,
  339.               rxsnest,rxstpri,rxsstack,rxslisth,CharAttrFlags,
  340.               CharAttrFlagSet,buffsz,IoBuff,IoBuffPtr,exist,strf,read,
  341.               write,append,RexxMsgPort,stack,queue,fail,RexxBase;
  342.  
  343.   ProcGrp  =  CreateArgstring,DeleteArgstring,LengthArgstring,
  344.               CreateRexxMsg,DeleteRexxMsg,
  345.               ClearRexxMsg,FillRexxMsg,IsRexxMsg,
  346.               LockRexxBase,UnlockRexxBase;
  347.  
  348.   All      =  TypeGrp,ProcGrp;
  349.  
  350. END Rexx.
  351.