home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / OS2API / OS2-REXX.ADS < prev    next >
Text File  |  1995-02-10  |  29KB  |  605 lines

  1.  
  2. -- ╔═══════════════════════════════════════════════════════════════════╗
  3. -- ║       D E S I G N   E N G I N E R I N G              ║D║S║        ║
  4. -- ║            S O F T W A R E                           ╚═╩═╝        ║
  5. -- ║                                                                   ║
  6. -- ║        Package     Os2.Rexx                                       ║
  7. -- ║                                                                   ║
  8. -- ║        Author :  Leonid Dulman     1995                           ║
  9. -- ║                                                                   ║
  10. -- ║             GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS            ║
  11. -- ║                                                                   ║
  12. -- ║                 REXX  support                                     ║
  13. -- ║                                                                   ║
  14. -- ╚═══════════════════════════════════════════════════════════════════╝
  15.  
  16. with Interfaces.C;         use Interfaces.C;
  17. with Interfaces.C.Strings; use Interfaces.C.Strings;
  18.  
  19. package Os2.Rexx is
  20. pragma Preelaborate (Rexx);
  21.  
  22. --  ╔═══════════════════════════════════════════════════════════════════╗
  23. --  ║                                                                   ║
  24. --  ║   #define:              To include:                               ║
  25. --  ║                                                                   ║
  26. --  ║   INCL_REXXSAA          Complete Rexx support                     ║
  27. --  ║   INCL_RXSUBCOM         Rexx subcommand handler support           ║
  28. --  ║   INCL_RXSHV            Rexx shared variable pool support         ║
  29. --  ║   INCL_RXFUNC           Rexx external function support            ║
  30. --  ║   INCL_RXSYSEXIT        Rexx system exit support                  ║
  31. --  ║   INCL_RXMACRO          Rexx macro space support                  ║
  32. --  ║   INCL_RXARI            Rexx asynchronous Trace/Halt support      ║
  33. --  ║                                                                   ║
  34. --  ╚═══════════════════════════════════════════════════════════════════╝
  35.  
  36.     --                            Common
  37.     -- This section defines return codes and constants that are the
  38.     -- same for both 16-bit and 32-bit REXX calls.
  39.  
  40.     --**    Structure for external interface string (RXSTRING)
  41.  
  42. type  RXSTRING is record          -- rxstr
  43.   strlength         :ULONG  ;           --   length of string
  44.   strptr            :PCH    ;           --   pointer to string
  45. end record; --  RXSTRING;
  46.  
  47. type PRXSTRING     is access all RXSTRING;       -- pointer to a RXSTRING
  48.  
  49. --  #define RXAUTOBUFLEN         256L
  50.  
  51.     --**    Structure for system exit block (RXSYSEXIT) 32-bit
  52.  
  53. type  RXSYSEXIT is record            -- syse
  54. sysexit_name      :PSZ   ;                 -- subcom enviro for sysexit
  55. sysexit_code      :LONG  ;                 -- sysexit function code
  56. end record; --  RXSYSEXIT;
  57.  
  58. type PRXSYSEXIT is access all RXSYSEXIT;         -- pointer to a RXSYSEXIT
  59.  
  60.  
  61.     -- XLATOFF
  62.     --**    Macros for RXSTRING manipulation
  63.  
  64. --  #define RXNULLSTRING(r)      (!(r).strptr)
  65. --  #define RXZEROLENSTRING(r)   ((r).strptr && !(r).strlength)
  66. --  #define RXVALIDSTRING(r)     ((r).strptr && (r).strlength)
  67. --  #define RXSTRLEN(r)          (RXNULLSTRING(r)?0L:(r).strlength)
  68. --  #define RXSTRPTR(r)          (r).strptr
  69. --  #define MAKERXSTRING(r,p,l)  is record(r).strptr=(PCH)p;(r).strlength=(ULONG)l;}
  70.  
  71.     -- XLATON
  72.  
  73.     --** Call type codes for use on interpreter startup
  74. --  #define RXCOMMAND       0              -- Program called as Command
  75. --  #define RXSUBROUTINE    1              -- Program called as Subroutin
  76. --  #define RXFUNCTION      2              -- Program called as Function
  77.  
  78.     --**    Subcommand Interface defines
  79.     --**    Drop Authority for RXSUBCOM interface
  80.  
  81. --  #define RXSUBCOM_DROPPABLE   0x00--   -- handler to be dropped by all
  82. --  #define RXSUBCOM_NONDROP     0x01     -- process with same PID as the
  83. --                                        -- registrant may drop environ
  84. --
  85. --  --**    Return Codes from RXSUBCOM interface
  86. --
  87. --  #define RXSUBCOM_ISREG       0x01     -- Subcommand is registered
  88. --  #define RXSUBCOM_ERROR       0x01     -- Subcommand Ended in Error
  89. --  #define RXSUBCOM_FAILURE     0x02     -- Subcommand Ended in Failure
  90. --  #define RXSUBCOM_BADENTRY    1001     -- Invalid Entry Conditions
  91. --  #define RXSUBCOM_NOEMEM      1002     -- Insuff stor to complete req
  92. --  #define RXSUBCOM_BADTYPE     1003     -- Bad registration type.
  93. --  #define RXSUBCOM_NOTINIT     1004     -- API system not initialized.
  94. --  #define RXSUBCOM_OK           0       -- Function Complete
  95. --  #define RXSUBCOM_DUP         10       -- Duplicate Environment Name-
  96. --                                        -- but Registration Completed
  97. --  #define RXSUBCOM_MAXREG      20       -- Cannot register more
  98. --                                        -- handlers
  99. --  #define RXSUBCOM_NOTREG      30       -- Name Not Registered
  100. --  #define RXSUBCOM_NOCANDROP   40--     -- Name not droppable
  101. --  #define RXSUBCOM_LOADERR     50       -- Could not load function
  102. --  #define RXSUBCOM_NOPROC     127       -- RXSUBCOM routine - not found
  103. --
  104. --  #endif -- INCL_RXSUBCOM for defines
  105. --
  106. --  --**    Shared Variable Pool Interface defines
  107. --  #ifdef INCL_RXSHV
  108. --
  109. --  --**    Function Codes for Variable Pool Interface (shvcode)
  110. --
  111. --  #define RXSHV_SET          0x00       -- Set var from given value
  112. --  #define RXSHV_FETCH        0x01       -- Copy value of var to buffer
  113. --  #define RXSHV_DROPV        0x02       -- Drop variable
  114. --  #define RXSHV_SYSET        0x03       -- Symbolic name Set variable
  115. --  #define RXSHV_SYFET        0x04       -- Symbolic name Fetch variable
  116. --  #define RXSHV_SYDRO        0x05       -- Symbolic name Drop variable
  117. --  #define RXSHV_NEXTV        0x06       -- Fetch "next" variable
  118. --  #define RXSHV_PRIV         0x07       -- Fetch private information
  119. --  #define RXSHV_EXIT--       0x08       -- Set function exit value
  120. --
  121. --  --**    Return Codes for Variable Pool Interface
  122. --
  123. --  #define RXSHV_NOAVL         144       -- Interface not available
  124. --
  125. --  --**    Return Code Flags for Variable Pool Interface (shvret)
  126. --
  127. --  #define RXSHV_OK--         0x00       -- Execution was OK
  128. --  #define RXSHV_NEWV         0x01       -- Variable did not exist
  129. --  #define RXSHV_LVAR         0x02       -- Last var trans via SHVNEXTV
  130. --  #define RXSHV_TRUN         0x04       -- Truncation occurred-Fetch
  131. --  #define RXSHV_BADN         0x08       -- Invalid variable name
  132. --  #define RXSHV_MEMFL        0x10       -- Out of memory failure
  133. --  #define RXSHV_BADF         0x80       -- Invalid funct code (shvcode)
  134.  
  135.  
  136.     --**    Structure of Shared Variable Request Block (SHVBLOCK)
  137. type SHVBLOCK ;
  138. type PSHVBLOCK is access SHVBLOCK;
  139.  
  140. type  SHVBLOCK is record            -- shvb
  141.  pshvnext        :PSHVBLOCK ;       -- pointer to the next block
  142.  shvname         :RXSTRING  ;       -- Pointer to the name buffer
  143.  shvvalue        :RXSTRING  ;       -- Pointer to the value buffer
  144.  shvnamelen      :ULONG     ;       -- Length of the name value
  145.  shvvaluelen     :ULONG     ;       -- Length of the fetch value
  146.  shvcode         :UCHAR     ;       -- Function code for this block
  147.  shvret          :UCHAR     ;       -- Individual Return Code Flags
  148. end record; --   SHVBLOCK;
  149.  
  150.     --**    External Function Interface
  151.     --**    Registration Type Identifiers for Available Function Table
  152.  
  153. --  #define RXFUNC_DYNALINK       1        -- Function Available in DLL
  154. --  #define RXFUNC_CALLENTRY      2        -- Registered as mem entry pt.
  155.  
  156.     --**    Return Codes from RxFunction interface
  157.  
  158. --  #define RXFUNC_OK             0        -- REXX-API Call Successful
  159. --  #define RXFUNC_DEFINED       10        -- Function Defined in AFT
  160. --  #define RXFUNC_NOMEM         20        -- Not Enough Mem to Add
  161. --  #define RXFUNC_NOTREG        30        -- Funct Not Registered in AFT
  162. --  #define RXFUNC_MODNOTFND     40        -- Funct Dll Module Not Found
  163. --  #define RXFUNC_ENTNOTFND     50        -- Funct Entry Point Not Found
  164. --  #define RXFUNC_NOTINIT       60        -- API not initialized
  165. --  #define RXFUNC_BADTYPE       70        -- Bad function type
  166.  
  167.     --**   System Exits defines
  168.     --**    Drop Authority for Rexx Exit interface
  169.  
  170. --  #define RXEXIT_DROPPABLE     0x00     -- handler to be dropped by all
  171. --  #define RXEXIT_NONDROP       0x01     -- process with same PID as the
  172.                                           -- registrant may drop environ
  173.     --**    Exit return actions
  174.  
  175. --  #define RXEXIT_HANDLED       0        -- Exit handled exit event
  176. --  #define RXEXIT_NOT_HANDLED   1        -- Exit passes on exit event
  177. --  #define RXEXIT_RAISE_ERROR   (-1)     -- Exit handler error occurred
  178. --
  179. --  --**    Return Codes from RXEXIT interface
  180. --
  181. --  #define RXEXIT_ISREG         0x01     -- Exit is registered
  182. --  #define RXEXIT_ERROR         0x01     -- Exit Ended in Error
  183. --  #define RXEXIT_FAILURE       0x02     -- Exit Ended in Failure
  184. --  #define RXEXIT_BADENTRY      1001     -- Invalid Entry Conditions
  185. --  #define RXEXIT_NOEMEM        1002     -- Insuff stor to complete req
  186. --  #define RXEXIT_BADTYPE       1003     -- Bad registration type.
  187. --  #define RXEXIT_NOTINIT       1004     -- API system not initialized.
  188. --  #define RXEXIT_OK             0       -- Function Complete
  189. --  #define RXEXIT_DUP           10       -- Duplicate Exit Name-
  190. --                                        -- but Registration Completed
  191. --  #define RXEXIT_MAXREG        20       -- Cannot register more
  192. --                                        -- handlers
  193. --  #define RXEXIT_NOTREG        30       -- Name Not Registered
  194. --  #define RXEXIT_NOCANDROP     40       -- Name not droppable
  195. --  #define RXEXIT_LOADERR       50       -- Could not load function
  196. --  #define RXEXIT_NOPROC       127       -- RXEXIT routine - not found
  197. --
  198. --
  199. --
  200. --  -- System Exit function and sub-function definitions
  201. --
  202. --  #define RXENDLST    0                 -- End of exit list.
  203. --  #define RXFNC    2                    -- Process external functions.
  204. --  #define    RXFNCCAL 1                 -- subcode value.
  205. --  #define RXCMD    3                    -- Process host commands.
  206. --  #define    RXCMDHST 1                 -- subcode value.
  207. --  #define RXMSQ    4                    -- Manipulate queue.
  208. --  #define    RXMSQPLL 1                 -- Pull a line from queue
  209. --  #define    RXMSQPSH 2                 -- Place a line on queue
  210. --  #define    RXMSQSIZ 3                 -- Return num of lines on queue
  211. --  #define    RXMSQNAM 20                -- Set active queue name
  212. --  #define RXSIO    5                    -- Session I/O.
  213. --  #define    RXSIOSAY 1                 -- SAY a line to STDOUT
  214. --  #define    RXSIOTRC 2                 -- Trace output
  215. --  #define    RXSIOTRD 3                 -- Read from char stream
  216. --  #define    RXSIODTR 4                 -- DEBUG read from char stream
  217. --  #define    RXSIOTLL 5                 -- Return linelength(N/A OS/2)
  218. --  #define RXHLT    7                    -- Halt processing.
  219. --  #define    RXHLTCLR 1                 -- Clear HALT indicator
  220. --  #define    RXHLTTST 2                 -- Test HALT indicator
  221. --  #define RXTRC    8                    -- Test ext trace indicator.
  222. --  #define    RXTRCTST 1                 -- subcode value.
  223. --  #define RXINI    9                    -- Initialization processing.
  224. --  #define    RXINIEXT 1                 -- subcode value.
  225. --  #define RXTER   10                    -- Termination processing.
  226. --  #define    RXTEREXT 1                 -- subcode value.
  227. --  #define RXNOOFEXITS 11                -- 1 + largest exit number.
  228.  
  229. subtype  PEXIT is PUCHAR;                 -- ptr to exit parameter block
  230.  
  231.     --**    Asynchronous Request Interface defines
  232.     --**    Return Codes from Asynchronous Request interface
  233.  
  234. --  #define RXARI_OK                   0  -- Interface completed
  235. --  #define RXARI_NOT_FOUND            1  -- Target program not found
  236. --  #define RXARI_PROCESSING_ERROR     2  -- Error processing request
  237. --  #endif -- INCL_RXARI for defines
  238. --
  239. --  --**    Macro Space Interface defines
  240. --  #ifdef INCL_RXMACRO
  241. --
  242. --  --**    Registration Search Order Flags
  243. --
  244. --  #define RXMACRO_SEARCH_BEFORE       1  -- Beginning of search order
  245. --  #define RXMACRO_SEARCH_AFTER        2  -- End of search order
  246. --
  247. --
  248. --  --**    Return Codes from RxMacroSpace interface
  249. --
  250. --  #define RXMACRO_OK                 0  -- Macro interface completed
  251. --  #define RXMACRO_NO_STORAGE         1  -- Not Enough Storage Available
  252. --  #define RXMACRO_NOT_FOUND          2  -- Requested function not found
  253. --  #define RXMACRO_EXTENSION_REQUIRED 3  -- File ext required for save
  254. --  #define RXMACRO_ALREADY_EXISTS     4  -- Macro functions exist
  255. --  #define RXMACRO_FILE_ERROR         5  -- File I/O error in save/load
  256. --  #define RXMACRO_SIGNATURE_ERROR    6  -- Incorrect format for load
  257. --  #define RXMACRO_SOURCE_NOT_FOUND   7  -- Requested cannot be found
  258. --  #define RXMACRO_INVALID_POSITION   8  -- Invalid search order pos
  259. --  #define RXMACRO_NOT_INIT           9  -- API not initialized
  260. --  #endif -- INCL_RXMACRO for defines
  261. --
  262.     --                            32-bit
  263.     --
  264.  
  265.     --**    Main Entry Point to the REXXSAA Interpreter
  266.  
  267.  function RexxStart (
  268.    name     :LONG ;                        -- Num of args passed to rexx
  269.   pargs     :PRXSTRING;                    -- Array of args passed to rex
  270.   ppath     :PSZ;                          -- [d:][path] filename[.ext]
  271.   ploc      :PRXSTRING;                    -- Loc of rexx proc in memory
  272.   penv      :PSZ;                          -- ASCIIZ initial environment.
  273.   tip       :LONG ;                        -- type (command;subrtn;funct)
  274.   pexit     :PRXSYSEXIT;                   -- SysExit env. names &  codes
  275.   pret      :PUSHORT;                      -- Ret code from if numeric
  276.   pretn     :PRXSTRING ) return LONG;                  -- Retvalue from the rexx proc
  277. pragma Import(c,RexxStart, Link_name=>"RexxStart");
  278.  
  279.     --**    Subcommand Interface
  280.     -- XLATOFF
  281.  
  282.     -- This typedef simplifies coding of a Subcommand handler.
  283. --  #pragma linkage(RexxSubcomHandler;system)
  284. type RexxSubcomHandler is access function (pstr:PRXSTRING;
  285.                                            push:PUSHORT;
  286.                                            prs :PRXSTRING) return ULONG;
  287.  
  288.     --**   RexxRegisterSubcomDll -- Register a DLL entry point
  289.     --**   as a Subcommand handler
  290.  
  291. function RexxRegisterSubcomDll (
  292.  pname      :PSZ;                          -- Name of subcom handler
  293.  pndll      :PSZ;                          -- Name of DLL
  294.  pprocndll  :PSZ;                          -- Name of procedure in DLL
  295.  parea      :PUCHAR;                       -- User area
  296.  pdrop      :ULONG  ) return APIRET;                   -- Drop authority.
  297. pragma Import(c,RexxRegisterSubcomDll, Link_name=>"RexxRegisterSubcomDll");
  298.  
  299.     --**   RexxRegisterSubcomExe -- Register an EXE entry point
  300.     --**   as a Subcommand handler
  301.  
  302. function RexxRegisterSubcomExe (
  303.       pname :PSZ;                          -- Name of subcom handler
  304.       pexe  :PSZ;                          -- address of handler in EXE
  305.       parea :PUCHAR) return APIRET;                    -- User area
  306. pragma Import(c,RexxRegisterSubcomExe, Link_name=>"RexxRegisterSubcomExe");
  307.  
  308.     --**    RexxQuerySubcom - Query an environment for Existance
  309.  
  310. function RexxQuerySubcom(
  311. penv        :PSZ;                          -- Name of the Environment
  312. pdll        :PSZ;                          -- DLL Module Name
  313. pstor       :PUSHORT;                      -- Stor for existance code
  314. parea       :PUCHAR ) return APIRET;                   -- Stor for user word
  315. pragma Import(c,RexxQuerySubcom, Link_name=>"RexxQuerySubcom");
  316.  
  317.     --**    RexxDeregisterSubcom - Drop registration of a Subcommand
  318.     --**    environment
  319.  
  320. function RexxDeregisterSubcom(
  321. penv        :PSZ;                          -- Name of the Environment
  322. pdll        :PSZ ) return APIRET;                         -- DLL Module Name
  323. pragma Import(c,RexxDeregisterSubcom, Link_name=>"RexxDeregisterSubcom");
  324.  
  325.     --**    Shared Variable Pool Interface
  326.     --**    RexxVariablePool - Request Variable Pool Service
  327.  
  328. function RexxVariablePool(plist:PSHVBLOCK) return APIRET; -- Pointer to list of SHVBLOCKs
  329. pragma Import(c,RexxVariablePool, Link_name=>"RexxVariablePool");
  330.  
  331.     -- This typedef simplifies coding of an External Function.
  332. type RexxFunctionHandler is access function(p1:PUCHAR;
  333.                                      p2:ULONG;
  334.                                      p3: PRXSTRING;
  335.                                      p4:PSZ;
  336.                                      p5: PRXSTRING) return ULONG;
  337.  
  338.     --**    RexxRegisterFunctionDll - Register a function in the AFT
  339.  
  340. function RexxRegisterFunctionDll (
  341.   pname    :PSZ;                           -- Name of function to add
  342.   pdllfn   :PSZ;                           -- Dll file name (if in dll)
  343.   pdll     :PSZ) return APIRET;                          -- Entry in dll
  344. pragma Import(c,RexxRegisterFunctionDll, Link_name=>"RexxRegisterFunctionDll");
  345.  
  346.     --**    RexxRegisterFunctionExe - Register a function in the AFT
  347.  
  348. function RexxRegisterFunctionExe (
  349.     pnadd  :PSZ;                           -- Name of function to add
  350.     pentr  :PSZ) return APIRET;                          -- Entry point in EXE
  351. pragma Import(c,RexxRegisterFunctionExe, Link_name=>"RexxRegisterFunctionExe");
  352.  
  353.     --**    RexxDeregisterFunction - Delete a function from the AFT
  354.  
  355. function RexxDeregisterFunction (pname:PSZ ) return APIRET; -- Name of function to remove
  356. pragma Import(c,RexxDeregisterFunction, Link_name=>"RexxDeregisterFunction");
  357.  
  358.     --**    RexxQueryFunction - Scan the AFT for a function
  359.  
  360. function RexxQueryFunction (pname :PSZ ) return APIRET; -- Name of function to find
  361. pragma Import(c,RexxQueryFunction, Link_name=>"RexxQueryFunction");
  362.  
  363.     --**   System Exits
  364.     --**    Subfunction RXFNCCAL - External Function Calls
  365.  
  366. --type   RXFNC_FLAGS is record          -- fl
  367. --       unsigned rxfferr  : 1;              -- Invalid call to routine.
  368. --       unsigned rxffnfnd : 1;              -- Function not found.
  369. --       unsigned rxffsub  : 1;              -- Called as a subroutine
  370. --end record; --  RXFNC_FLAGS ;
  371. subtype RXFNC_FLAGS is BYTE;
  372.  
  373. type   RXFNCCAL_PARM is record        -- fnc
  374.    rxfnc_fl      : RXFNC_FLAGS       ;     -- function flags
  375.    rxfnc_name    : PUCHAR            ;       -- Pointer to function name.
  376.    rxfnc_namel   : USHORT            ;      -- Length of function name.
  377.    rxfnc_que     : PUCHAR            ;        -- Current queue name.
  378.    rxfnc_quel    : USHORT            ;       -- Length of queue name.
  379.    rxfnc_argc    : USHORT            ;       -- Number of args in list.
  380.    rxfnc_argv    : PRXSTRING         ;       -- Pointer to argument list.
  381.    rxfnc_retc    : RXSTRING          ;       -- Return value.
  382. end record; --  RXFNCCAL_PARM;
  383. type PRXFNCCAL_PARM is access all  RXFNCCAL_PARM ;
  384.  
  385.     --**    Subfunction RXCMDHST -- Process Host Commands
  386.  
  387. --type Packed  RXCMD_FLAGS is record          -- fl
  388. --       unsigned rxfcfail : 1;              -- Command failed.
  389. --       unsigned rxfcerr  : 1;              -- Command ERROR occurred.
  390. --end record; --  RXCMD_FLAGS;
  391. subtype RXCMD_FLAGS is BYTE;
  392.  
  393. type  RXCMDHST_PARM is record        -- rx
  394.   rxcmd_fl           :RXCMD_FLAGS      ;      -- error/failure flags
  395.   rxcmd_address      :PUCHAR           ;    -- Pointer to address name.
  396.   rxcmd_addressl     :USHORT           ;   -- Length of address name.
  397.   rxcmd_dll          :PUCHAR           ;        -- dll name for command.
  398.   rxcmd_dll_len      :USHORT           ;    -- Length of dll name.
  399.   rxcmd_command      :RXSTRING         ;    -- The command string.
  400.   rxcmd_retc         :RXSTRING         ;       -- Pointer to return buffer
  401. end record; --  RXCMDHST_PARM;
  402. type PRXCMDHST_PARM is access all RXCMDHST_PARM;
  403.  
  404.     --**     Subfunction RXMSQPLL -- Pull Entry from Queue
  405.  
  406. type  RXMSQPLL_PARM is record        -- pll
  407.   rxmsq_retc    :RXSTRING          ;       -- Pointer to dequeued entry
  408.                                            -- buffer.  User allocated.
  409. end record; -- RXMSQPLL_PARM;
  410.  
  411.  
  412.     --**    Subfunction RXMSQPSH -- Push Entry on Queue
  413.  
  414. -- type Packed  RXMSQ_FLAGS is record          -- fl
  415. --        unsigned rxfmlifo : 1;              -- Stack entry LIFO if set
  416. -- end record; --  RXMSQ_FLAGS;
  417. subtype RXMSQ_FLAGS  is byte;
  418.  
  419. type  RXMSQPSH_PARM is record        -- psh
  420.    rxmsq_fl      :RXMSQ_FLAGS       ;      -- LIFO/FIFO flag
  421.    rxmsq_value   :RXSTRING          ;      -- The entry to be pushed.
  422. end record; --  RXMSQPSH_PARM;
  423. type PRXMSQPSH_PARM is access all  RXMSQPSH_PARM;
  424.  
  425.     --**    Subfunction RXMSQSIZ -- Return the Current Queue Size
  426.  
  427. type  RXMSQSIZ_PARM is record        -- siz
  428.    rxmsq_size   :ULONG             ;       -- Number of Lines in Queue
  429. end record; --  RXMSQSIZ_PARM;
  430. type PRXMSQSIZ_PARM is access all RXMSQSIZ_PARM;
  431.  
  432.     --**    Subfunction RXMSQNAM -- Set Current Queue Name
  433.  
  434. type  RXMSQNAM_PARM is record        -- nam
  435.    rxmsq_name :  RXSTRING          ;       -- RXSTRING containing
  436.                                            -- queue name.
  437. end record; --  RXMSQNAM_PARM;
  438. type PRXMSQNAM_PARM is access all RXMSQNAM_PARM;
  439.  
  440.     --**    Subfunction RXSIOSAY -- Perform SAY Clause
  441.  
  442. type  RXSIOSAY_PARM is record        -- say
  443.   rxsio_string    :RXSTRING          ;     -- String to display.
  444. end record; --  RXSIOSAY_PARM;
  445. type PRXSIOSAY_PARM is access all RXSIOSAY_PARM;
  446.  
  447.     --**    Subfunction RXSIOTRC -- Write Trace Output
  448.  
  449. type  RXSIOTRC_PARM is record -- trcparm
  450.   rxsio_string   : RXSTRING          ;     -- Trace line to display.
  451. end record; --  RXSIOTRC_PARM;
  452. type PRXSIOTRC_PARM is access all  RXSIOTRC_PARM;
  453.  
  454.     --**    Subfunction RXSIOTRD -- Read Input from the Terminal
  455.  
  456. type  RXSIOTRD_PARM is record        -- trd
  457.   rxsiotrd_retc  :  RXSTRING          ;    -- RXSTRING for output.
  458. end record; --  RXSIOTRD_PARM;
  459. type PRXSIOTRD_PARM is access all RXSIOTRD_PARM;
  460.  
  461.     --**    Subfunction RXSIODTR -- Read Debug Input from the Terminal
  462.  
  463. type  RXSIODTR_PARM is record        -- dtr
  464.   rxsiodtr_retc   : RXSTRING          ;    -- RXSTRING for output.
  465. end record; --  RXSIODTR_PARM;
  466. type PRXSIODTR_PARM is access all  RXSIODTR_PARM;
  467.  
  468.     --**    Subfunction RXHSTTST -- Test for HALT Condition
  469.  
  470. -- type  RXHLT_FLAGS is record          -- fl Halt flag
  471. --       unsigned rxfhhalt : 1;              -- Set if HALT occurred.
  472. --end record; --  RXHLT_FLAGS;
  473. subtype RXHLT_FLAGS is  BYTE;
  474.  
  475. type  RXHLTTST_PARM is record        -- tst
  476.   rxhlt_fl      : RXHLT_FLAGS ;            -- Set if HALT occurred
  477. end record; --  RXHLTTST_PARM;
  478. type PRXHLTTST_PARM is access all    RXHLTTST_PARM;
  479.  
  480.     --**    Subfunction RXTRCTST -- Test for TRACE Condition
  481.  
  482. -- type  RXTRC_FLAGS is record          -- fl Trace flags
  483. --        unsigned rxftrace : 1;              -- Set to run external trace.
  484. -- end record; --  RXTRC_FLAGS;
  485. subtype RXTRC_FLAGS is BYTE;
  486.  
  487. type  RXTRCTST_PARM is record        -- tst
  488.   rxtrc_fl      : RXTRC_FLAGS ;            -- Set to run external trace
  489. end record; --  RXTRCTST_PARM;
  490. type PRXTRCTST_PARM is access all RXTRCTST_PARM;
  491.  
  492.     -- XLATOFF
  493.  
  494.     -- This typedef simplifies coding of an Exit handler.
  495. type RexxExitHandler is access function (p1:LONG;
  496.                                          p2:LONG;
  497.                                          p3:PEXIT) return APIRET;
  498.  
  499.     --**      RexxRegisterExitDll - Register a system exit.
  500.  
  501. function RexxRegisterExitDll (
  502.           nh:PSZ;                          -- Name of the exit handler
  503.         ndll:PSZ;                          -- Name of the DLL
  504.          np :PSZ;                          -- Name of the procedure
  505.        area :PUCHAR;                       -- User area
  506.        drop :ULONG ) return APIRET;                      -- Drop authority
  507. pragma Import(c,RexxRegisterExitDll, Link_name=>"RexxRegisterExitDll");
  508.  
  509.     --**      RexxRegisterExitExe - Register a system exit.
  510.  
  511. function RexxRegisterExitExe (
  512.           nh:PSZ;                          -- Name of the exit handler
  513.          pnh:PSZ;                          -- Address of exit handler
  514.        parea:PUCHAR) return APIRET;                      -- User area
  515. pragma Import(c,RexxRegisterExitExe, Link_name=>"RexxRegisterExitExe");
  516.  
  517.     --**    RexxDeregisterExit - Drop registration of a system exit.
  518.  
  519. function RexxDeregisterExit (
  520.   exitn     :PSZ;                          -- Exit name
  521.   ndll      :PSZ ) return APIRET;                       -- DLL module name
  522. pragma Import(c,RexxDeregisterExit, Link_name=>"RexxDeregisterExit");
  523.  
  524.     --**    RexxQueryExit - Query an exit for existance.
  525.  
  526. function RexxQueryExit (
  527.           p1:PSZ;                          -- Exit name
  528.           p2:PSZ;                          -- DLL Module name.
  529.           p3:PUSHORT;                      -- Existance flag.
  530.           p4:PUCHAR ) return APIRET;                     -- User data.
  531. pragma Import(c,RexxQueryExit, Link_name=>"RexxQueryExit");
  532.  
  533.     --**    Asynchronous Request Interface
  534.     --**    RexxSetHalt - Request Program Halt
  535.  
  536. function RexxSetHalt(
  537.          p1: PID;                         -- Process Id
  538.          p2: TID) return APIRET;                        -- Thread Id
  539. pragma Import(c,RexxSetHalt, Link_name=>"RexxSetHalt");
  540.  
  541.     --**    RexxSetTrace - Request Program Trace
  542.  
  543. function RexxSetTrace(
  544.           p1:PID;                         -- Process Id
  545.           p2:TID) return APIRET;                        -- Thread Id
  546. pragma Import(c,RexxSetTrace, Link_name=>"RexxSetTrace");
  547.  
  548.     --**    RexxResetTrace - Turn Off Program Trace
  549.  
  550. function RexxResetTrace(
  551.          p1: PID;                         -- Process Id
  552.          p2: TID) return APIRET;                        -- Thread Id
  553. pragma Import(c,RexxResetTrace, Link_name=>"RexxResetTrace");
  554.  
  555.     --**    RexxAddMacro - Register a function in the Macro Space
  556.  
  557. function RexxAddMacro (
  558.          p1 :PSZ;                         -- Function to add or change
  559.          p2 :PSZ;                         -- Name of file to get function
  560.          p3 :ULONG  ) return APIRET;                    -- Flag indicating search pos
  561. pragma Import(c,RexxAddMacro, Link_name=>"RexxAddMacro");
  562.  
  563.     --**    RexxDropMacro - Remove a function from the Macro Space
  564.  
  565. function RexxDropMacro (
  566.           p :PSZ ) return APIRET;                        -- Name of function to remove
  567. pragma Import(c,RexxDropMacro, Link_name=>"RexxDropMacro");
  568.  
  569.     --**    RexxSaveMacroSpace - Save Macro Space functions to a file
  570.  
  571. function RexxSaveMacroSpace (
  572.           p1:ULONG ;                      -- Argument count (0==save all)
  573.           p2:PSZ  ;                       -- List of funct names to save
  574.           p3:PSZ) return APIRET;                        -- File to save functions in
  575. pragma Import(c,RexxSaveMacroSpace, Link_name=>"RexxSaveMacroSpace");
  576.  
  577.     --**    RexxLoadMacroSpace - Load Macro Space functions from a file
  578.  
  579. function RexxLoadMacroSpace (
  580.          p1 :ULONG ;                      -- Argument count (0==load all)
  581.          p2 :PSZ  ;                       -- List of funct names to load
  582.          p3 :PSZ) return APIRET;                        -- File to load functions from
  583. pragma Import(c,RexxLoadMacroSpace, Link_name=>"RexxLoadMacroSpace");
  584.  
  585.     --**    RexxQueryMacro - Find a function's search-order position
  586.  
  587. function RexxQueryMacro (
  588.           p1:PSZ;                         -- Function to search for
  589.           p2:PUSHORT ) return APIRET;                   -- Ptr for position flag return
  590. pragma Import(c,RexxQueryMacro, Link_name=>"RexxQueryMacro");
  591.  
  592.     --**    RexxReorderMacro - Change a function's search-order
  593.     --**                            position
  594.  
  595. function RexxReorderMacro(
  596.          p1 :PSZ;                         -- Name of funct change order
  597.          p2 :ULONG  ) return APIRET;                    -- New position for function
  598. pragma Import(c,RexxReorderMacro, Link_name=>"RexxReorderMacro");
  599.  
  600.     --**    RexxClearMacroSpace - Remove all functions from a MacroSpace
  601.  
  602. function RexxClearMacroSpace return APIRET;  -- No Arguments.
  603. pragma Import(c,RexxClearMacroSpace, Link_name=>"RexxClearMacroSpace");
  604. end Os2.Rexx;
  605.