home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v5.zip / TOOLKT21 / ASM / OS2INC / REXXSAA.INC < prev    next >
Text File  |  1993-03-12  |  16KB  |  347 lines

  1. ;**********************************************************************
  2. ; Module Name: REXXSAA.H
  3. ;
  4. ; REXX Common Definitions File
  5. ;
  6. ; @Copyright  1989, 1991 IBM Corporation
  7. ; Licensed Materials - Property of IBM
  8. ;
  9. ; *********************************************************************
  10. ;
  11. ;   #define:              To include:
  12. ;
  13. ;   INCL_REXXSAA          Complete Rexx support
  14. ;   INCL_RXSUBCOM         Rexx subcommand handler support
  15. ;   INCL_RXSHV            Rexx shared variable pool support
  16. ;   INCL_RXFUNC           Rexx external function support
  17. ;   INCL_RXSYSEXIT        Rexx system exit support
  18. ;   INCL_RXMACRO          Rexx macro space support
  19. ;   INCL_RXARI            Rexx asynchronous Trace/Halt support
  20. ;
  21. ;********************************************************************  
  22. ifndef REXXSAA_INCLUDED
  23. REXXSAA_INCLUDED    EQU    1
  24.  
  25. ;  XLATON   
  26. ifndef OS2_INCLUDED
  27. INCLUDE os2.INC
  28. endif
  29. ;********************************************************************  
  30. ;                                                                      
  31. ;                             Common                                   
  32. ;                                                                      
  33. ;********************************************************************  
  34. ;  This section defines return codes and constants that are the        
  35. ;  same for both 16-bit and 32-bit REXX calls.                         
  36. ifdef INCL_REXXSAA
  37. INCL_RXSUBCOM    EQU    1
  38.  
  39. INCL_RXSHV    EQU    1
  40.  
  41. INCL_RXFUNC    EQU    1
  42.  
  43. INCL_RXSYSEXIT    EQU    1
  44.  
  45. INCL_RXMACRO    EQU    1
  46.  
  47. INCL_RXARI    EQU    1
  48.  
  49. endif ;  INCL_REXXSAA   
  50. ;***    Structure for external interface string (RXSTRING)   
  51.  
  52. RXSTRING    STRUC
  53. rxstr_strlength    DD    ?           ;    length of string           
  54. rxstr_strptr    DB    SIZE PCH DUP (?)              ;    pointer to string          
  55. RXSTRING    ENDS
  56. RXAUTOBUFLEN    EQU    256 
  57. ;***    Structure for system exit block (RXSYSEXIT) 32-bit   
  58.  
  59. RXSYSEXIT    STRUC
  60. syse_sysexit_name    DB    SIZE PSZ DUP (?)                 ;  subcom enviro for sysexit    
  61. syse_sysexit_code    DD    ?                 ;  sysexit function code        
  62. RXSYSEXIT    ENDS
  63. ;*** Call type codes for use on interpreter startup                    
  64. RXCOMMAND    EQU    0               ;  Program called as Command    
  65. RXSUBROUTINE    EQU    1               ;  Program called as Subroutin  
  66. RXFUNCTION    EQU    2               ;  Program called as Function   
  67. ;***    Subcommand Interface defines  
  68. ifdef INCL_RXSUBCOM
  69. ;***    Drop Authority for RXSUBCOM interface   
  70. RXSUBCOM_DROPPABLE    EQU    00H      ;  handler to be dropped by all  
  71. RXSUBCOM_NONDROP    EQU    01H      ;  process with same PID as the  
  72.                                       ;  registrant may drop environ   
  73. ;***    Return Codes from RXSUBCOM interface   
  74. RXSUBCOM_ISREG    EQU    01H      ;  Subcommand is registered      
  75. RXSUBCOM_ERROR    EQU    01H      ;  Subcommand Ended in Error     
  76. RXSUBCOM_FAILURE    EQU    02H      ;  Subcommand Ended in Failure   
  77. RXSUBCOM_BADENTRY    EQU    1001      ;  Invalid Entry Conditions      
  78. RXSUBCOM_NOEMEM    EQU    1002      ;  Insuff stor to complete req   
  79. RXSUBCOM_BADTYPE    EQU    1003      ;  Bad registration type.        
  80. RXSUBCOM_NOTINIT    EQU    1004      ;  API system not initialized.   
  81. RXSUBCOM_OK    EQU    0        ;  Function Complete             
  82. RXSUBCOM_DUP    EQU    10        ;  Duplicate Environment Name-   
  83.                                       ;  but Registration Completed    
  84. RXSUBCOM_MAXREG    EQU    20        ;  Cannot register more          
  85.                                       ;  handlers                      
  86. RXSUBCOM_NOTREG    EQU    30        ;  Name Not Registered           
  87. RXSUBCOM_NOCANDROP    EQU    40        ;  Name not droppable            
  88. RXSUBCOM_LOADERR    EQU    50        ;  Could not load function       
  89. RXSUBCOM_NOPROC    EQU    127        ;  RXSUBCOM routine - not found  
  90. endif ;  INCL_RXSUBCOM for defines   
  91. ;***    Shared Variable Pool Interface defines   
  92. ifdef INCL_RXSHV
  93. ;***    Function Codes for Variable Pool Interface (shvcode)   
  94. RXSHV_SET    EQU    00H        ;  Set var from given value      
  95. RXSHV_FETCH    EQU    01H        ;  Copy value of var to buffer   
  96. RXSHV_DROPV    EQU    02H        ;  Drop variable                 
  97. RXSHV_SYSET    EQU    03H        ;  Symbolic name Set variable    
  98. RXSHV_SYFET    EQU    04H        ;  Symbolic name Fetch variable  
  99. RXSHV_SYDRO    EQU    05H        ;  Symbolic name Drop variable   
  100. RXSHV_NEXTV    EQU    06H        ;  Fetch "next" variable         
  101. RXSHV_PRIV    EQU    07H        ;  Fetch private information     
  102. RXSHV_EXIT    EQU    08H        ;  Set function exit value       
  103. ;***    Return Codes for Variable Pool Interface   
  104. RXSHV_NOAVL    EQU    144        ;  Interface not available       
  105. ;***    Return Code Flags for Variable Pool Interface (shvret)   
  106. RXSHV_OK    EQU    00H        ;  Execution was OK              
  107. RXSHV_NEWV    EQU    01H        ;  Variable did not exist        
  108. RXSHV_LVAR    EQU    02H        ;  Last var trans via SHVNEXTV   
  109. RXSHV_TRUNC    EQU    04H        ;  Truncation occurred-Fetch     
  110. RXSHV_BADN    EQU    08H        ;  Invalid variable name         
  111. RXSHV_MEMFL    EQU    10H        ;  Out of memory failure         
  112. RXSHV_BADF    EQU    80H        ;  Invalid funct code (shvcode)  
  113. ;***    Structure of Shared Variable Request Block (SHVBLOCK)   
  114.  
  115. SHVBLOCK    STRUC
  116. shvb_shvnext    DW    ?       ;  pointer to the next block     
  117. shvb_shvname    DB    SIZE RXSTRING DUP (?)       ;  Pointer to the name buffer    
  118. shvb_shvvalue    DB    SIZE RXSTRING DUP (?)      ;  Pointer to the value buffer   
  119. shvb_shvnamelen    DD    ?    ;  Length of the name value      
  120. shvb_shvvaluelen    DD    ?   ;  Length of the fetch value     
  121. shvb_shvcode    DB    ?       ;  Function code for this block  
  122. shvb_shvret    DB    ?        ;  Individual Return Code Flags  
  123. SHVBLOCK    ENDS
  124. endif ;  INCL_RXSHV for defines   
  125. ;***    External Function Interface   
  126. ifdef INCL_RXFUNC
  127. ;***    Registration Type Identifiers for Available Function Table   
  128. RXFUNC_DYNALINK    EQU    1         ;  Function Available in DLL    
  129. RXFUNC_CALLENTRY    EQU    2         ;  Registered as mem entry pt.  
  130. ;***    Return Codes from RxFunction interface   
  131. RXFUNC_OK    EQU    0         ;  REXX-API Call Successful     
  132. RXFUNC_DEFINED    EQU    10         ;  Function Defined in AFT      
  133. RXFUNC_NOMEM    EQU    20         ;  Not Enough Mem to Add        
  134. RXFUNC_NOTREG    EQU    30         ;  Funct Not Registered in AFT  
  135. RXFUNC_MODNOTFND    EQU    40         ;  Funct Dll Module Not Found   
  136. RXFUNC_ENTNOTFND    EQU    50         ;  Funct Entry Point Not Found  
  137. RXFUNC_NOTINIT    EQU    60         ;  API not initialized          
  138. RXFUNC_BADTYPE    EQU    70         ;  Bad function type            
  139. endif ;  INCL_RXFUNC for defines   
  140. ;***   System Exits defines   
  141. ifdef INCL_RXSYSEXIT
  142. ;***    Drop Authority for Rexx Exit interface   
  143. RXEXIT_DROPPABLE    EQU    00H      ;  handler to be dropped by all  
  144. RXEXIT_NONDROP    EQU    01H      ;  process with same PID as the  
  145.                                       ;  registrant may drop environ   
  146. ;***    Exit return actions   
  147. RXEXIT_HANDLED    EQU    0         ;  Exit handled exit event       
  148. RXEXIT_NOT_HANDLED    EQU    1         ;  Exit passes on exit event     
  149. RXEXIT_RAISE_ERROR    EQU    (-1 )     ;  Exit handler error occurred   
  150. ;***    Return Codes from RXEXIT interface   
  151. RXEXIT_ISREG    EQU    01H      ;  Exit is registered            
  152. RXEXIT_ERROR    EQU    01H      ;  Exit Ended in Error           
  153. RXEXIT_FAILURE    EQU    02H      ;  Exit Ended in Failure         
  154. RXEXIT_BADENTRY    EQU    1001      ;  Invalid Entry Conditions      
  155. RXEXIT_NOEMEM    EQU    1002      ;  Insuff stor to complete req   
  156. RXEXIT_BADTYPE    EQU    1003      ;  Bad registration type.        
  157. RXEXIT_NOTINIT    EQU    1004      ;  API system not initialized.   
  158. RXEXIT_OK    EQU    0        ;  Function Complete             
  159. RXEXIT_DUP    EQU    10        ;  Duplicate Exit Name-          
  160.                                       ;  but Registration Completed    
  161. RXEXIT_MAXREG    EQU    20        ;  Cannot register more          
  162.                                       ;  handlers                      
  163. RXEXIT_NOTREG    EQU    30        ;  Name Not Registered           
  164. RXEXIT_NOCANDROP    EQU    40        ;  Name not droppable            
  165. RXEXIT_LOADERR    EQU    50        ;  Could not load function       
  166. RXEXIT_NOPROC    EQU    127        ;  RXEXIT routine - not found    
  167. ;  System Exit function and sub-function definitions   
  168. RXENDLST    EQU    0                  ;  End of exit list.             
  169. RXFNC    EQU    2                     ;  Process external functions.   
  170. RXFNCCAL    EQU    1                  ;  subcode value.                
  171. RXCMD    EQU    3                     ;  Process host commands.        
  172. RXCMDHST    EQU    1                  ;  subcode value.                
  173. RXMSQ    EQU    4                     ;  Manipulate queue.             
  174. RXMSQPLL    EQU    1                  ;  Pull a line from queue        
  175. RXMSQPSH    EQU    2                  ;  Place a line on queue         
  176. RXMSQSIZ    EQU    3                  ;  Return num of lines on queue  
  177. RXMSQNAM    EQU    20                 ;  Set active queue name         
  178. RXSIO    EQU    5                     ;  Session I/O.                  
  179. RXSIOSAY    EQU    1                  ;  SAY a line to STDOUT          
  180. RXSIOTRC    EQU    2                  ;  Trace output                  
  181. RXSIOTRD    EQU    3                  ;  Read from char stream         
  182. RXSIODTR    EQU    4                  ;  DEBUG read from char stream   
  183. RXSIOTLL    EQU    5                  ;  Return linelength(N/A OS/2)   
  184. RXHLT    EQU    7                     ;  Halt processing.              
  185. RXHLTCLR    EQU    1                  ;  Clear HALT indicator          
  186. RXHLTTST    EQU    2                  ;  Test HALT indicator           
  187. RXTRC    EQU    8                     ;  Test ext trace indicator.     
  188. RXTRCTST    EQU    1                  ;  subcode value.                
  189. RXINI    EQU    9                     ;  Initialization processing.    
  190. RXINIEXT    EQU    1                  ;  subcode value.                
  191. RXTER    EQU    10                     ;  Termination processing.       
  192. RXTEREXT    EQU    1                  ;  subcode value.                
  193. RXNOOFEXITS    EQU    11                 ;  1 + largest exit number.      
  194. endif ;  INCL_RXSYSEXIT for defines   
  195. ;***    Asynchronous Request Interface defines   
  196. ifdef INCL_RXARI
  197. ;***    Return Codes from Asynchronous Request interface   
  198. RXARI_OK    EQU    0   ;  Interface completed           
  199. RXARI_NOT_FOUND    EQU    1   ;  Target program not found      
  200. RXARI_PROCESSING_ERROR    EQU    2   ;  Error processing request      
  201. endif ;  INCL_RXARI for defines   
  202. ;***    Macro Space Interface defines   
  203. ifdef INCL_RXMACRO
  204. ;***    Registration Search Order Flags   
  205. RXMACRO_SEARCH_BEFORE    EQU    1   ;  Beginning of search order    
  206. RXMACRO_SEARCH_AFTER    EQU    2   ;  End of search order          
  207. ;***    Return Codes from RxMacroSpace interface   
  208. RXMACRO_OK    EQU    0   ;  Macro interface completed     
  209. RXMACRO_NO_STORAGE    EQU    1   ;  Not Enough Storage Available  
  210. RXMACRO_NOT_FOUND    EQU    2   ;  Requested function not found  
  211. RXMACRO_EXTENSION_REQUIRED    EQU    3   ;  File ext required for save    
  212. RXMACRO_ALREADY_EXISTS    EQU    4   ;  Macro functions exist         
  213. RXMACRO_FILE_ERROR    EQU    5   ;  File I/O error in save/load   
  214. RXMACRO_SIGNATURE_ERROR    EQU    6   ;  Incorrect format for load     
  215. RXMACRO_SOURCE_NOT_FOUND    EQU    7   ;  Requested cannot be found     
  216. RXMACRO_INVALID_POSITION    EQU    8   ;  Invalid search order pos      
  217. RXMACRO_NOT_INIT    EQU    9   ;  API not initialized           
  218. endif ;  INCL_RXMACRO for defines   
  219. ;********************************************************************  
  220. ;                                                                      
  221. ;                             32-bit                                   
  222. ;                                                                      
  223. ;********************************************************************  
  224. ;***    Subcommand Interface   
  225. ifdef INCL_RXSUBCOM
  226. endif ;  INCL_RXSUBCOM   
  227. ;***    Shared Variable Pool Interface   
  228. ifdef INCL_RXSHV
  229. endif ;  INCL_RXSHV   
  230. ;***    External Function Interface   
  231. ifdef INCL_RXFUNC
  232. endif ;  INCL_RXFUNC   
  233. ;***   System Exits   
  234. ifdef INCL_RXSYSEXIT
  235. ;***    Subfunction RXFNCCAL - External Function Calls   
  236.  
  237. RXFNC_FLAGS    STRUC
  238.     fl_fs    DB  ?
  239. RXFNC_FLAGS    ENDS
  240. fl_rxfferr    EQU    01h
  241. fl_rxffnfnd    EQU    02h
  242. fl_rxffsub    EQU    04h
  243.  
  244. RXFNCCAL_PARM    STRUC
  245. fnc_rxfnc_flags    DB    SIZE RXFNC_FLAGS DUP (?)     ;  function flags               
  246. fnc_rxfnc_name    DB    SIZE PUCHAR DUP (?)       ;  Pointer to function name.    
  247. fnc_rxfnc_namel    DW    ?      ;  Length of function name.     
  248. fnc_rxfnc_que    DB    SIZE PUCHAR DUP (?)        ;  Current queue name.          
  249. fnc_rxfnc_quel    DW    ?       ;  Length of queue name.        
  250. fnc_rxfnc_argc    DW    ?       ;  Number of args in list.      
  251. fnc_rxfnc_argv    DW    ?       ;  Pointer to argument list.    
  252. fnc_rxfnc_retc    DB    SIZE RXSTRING DUP (?)       ;  Return value.                
  253. RXFNCCAL_PARM    ENDS
  254. ;***    Subfunction RXCMDHST -- Process Host Commands       
  255.  
  256. RXCMD_FLAGS    STRUC
  257.     fl_fs    DB  ?
  258. RXCMD_FLAGS    ENDS
  259. fl_rxfcfail    EQU    01h
  260. fl_rxfcerr    EQU    02h
  261.  
  262. RXCMDHST_PARM    STRUC
  263. rx_rxcmd_flags    DB    SIZE RXCMD_FLAGS DUP (?)      ;  error/failure flags          
  264. rx_rxcmd_address    DB    SIZE PUCHAR DUP (?)    ;  Pointer to address name.     
  265. rx_rxcmd_addressl    DW    ?   ;  Length of address name.      
  266. rx_rxcmd_dll    DB    SIZE PUCHAR DUP (?)        ;  dll name for command.        
  267. rx_rxcmd_dll_len    DW    ?    ;  Length of dll name.          
  268. rx_rxcmd_command    DB    SIZE RXSTRING DUP (?)    ;  The command string.          
  269. rx_rxcmd_retc    DB    SIZE RXSTRING DUP (?)       ;  Pointer to return buffer     
  270. RXCMDHST_PARM    ENDS
  271. ;***     Subfunction RXMSQPLL -- Pull Entry from Queue   
  272.  
  273. RXMSQPLL_PARM    STRUC
  274. pll_rxmsq_retc    DB    SIZE RXSTRING DUP (?)       ;  Pointer to dequeued entry    
  275.                                        ;  buffer.  User allocated.     
  276. RXMSQPLL_PARM    ENDS
  277. ;***    Subfunction RXMSQPSH -- Push Entry on Queue   
  278.  
  279. RXMSQ_FLAGS    STRUC
  280.     fl_fs    DB  ?
  281. RXMSQ_FLAGS    ENDS
  282. fl_rxfmlifo    EQU    01h
  283.  
  284. RXMSQPSH_PARM    STRUC
  285. psh_rxmsq_flags    DB    SIZE RXMSQ_FLAGS DUP (?)      ;  LIFO/FIFO flag               
  286. psh_rxmsq_value    DB    SIZE RXSTRING DUP (?)      ;  The entry to be pushed.      
  287. RXMSQPSH_PARM    ENDS
  288. ;***    Subfunction RXMSQSIZ -- Return the Current Queue Size   
  289.  
  290. RXMSQSIZ_PARM    STRUC
  291. siz_rxmsq_size    DD    ?       ;  Number of Lines in Queue     
  292. RXMSQSIZ_PARM    ENDS
  293. ;***    Subfunction RXMSQNAM -- Set Current Queue Name   
  294.  
  295. RXMSQNAM_PARM    STRUC
  296. nam_rxmsq_name    DB    SIZE RXSTRING DUP (?)       ;  RXSTRING containing          
  297.                                        ;  queue name.                  
  298. RXMSQNAM_PARM    ENDS
  299. ;***    Subfunction RXSIOSAY -- Perform SAY Clause   
  300.  
  301. RXSIOSAY_PARM    STRUC
  302. say_rxsio_string    DB    SIZE RXSTRING DUP (?)     ;  String to display.           
  303. RXSIOSAY_PARM    ENDS
  304. ;***    Subfunction RXSIOTRC -- Write Trace Output   
  305.  
  306. RXSIOTRC_PARM    STRUC
  307. trcparm_rxsio_string    DB    SIZE RXSTRING DUP (?)     ;  Trace line to display.       
  308. RXSIOTRC_PARM    ENDS
  309. ;***    Subfunction RXSIOTRD -- Read Input from the Terminal   
  310.  
  311. RXSIOTRD_PARM    STRUC
  312. trd_rxsiotrd_retc    DB    SIZE RXSTRING DUP (?)    ;  RXSTRING for output.         
  313. RXSIOTRD_PARM    ENDS
  314. ;***    Subfunction RXSIODTR -- Read Debug Input from the Terminal   
  315.  
  316. RXSIODTR_PARM    STRUC
  317. dtr_rxsiodtr_retc    DB    SIZE RXSTRING DUP (?)    ;  RXSTRING for output.         
  318. RXSIODTR_PARM    ENDS
  319. ;***    Subfunction RXHSTTST -- Test for HALT Condition   
  320.  
  321. RXHLT_FLAGS    STRUC
  322.     fl_fs    DW  ?
  323. RXHLT_FLAGS    ENDS
  324. fl_rxfhhalt    EQU    01h
  325.  
  326. RXHLTTST_PARM    STRUC
  327. tst_rxhlt_flags    DB    SIZE RXHLT_FLAGS DUP (?)            ;  Set if HALT occurred         
  328. RXHLTTST_PARM    ENDS
  329. ;***    Subfunction RXTRCTST -- Test for TRACE Condition   
  330.  
  331. RXTRC_FLAGS    STRUC
  332.     fl_fs    DW  ?
  333. RXTRC_FLAGS    ENDS
  334. fl_rxftrace    EQU    01h
  335.  
  336. RXTRCTST_PARM    STRUC
  337. tst_rxtrc_flags    DB    SIZE RXTRC_FLAGS DUP (?)            ;  Set to run external trace    
  338. RXTRCTST_PARM    ENDS
  339. endif ;  INCL_RXSYSEXIT   
  340. ;***    Asynchronous Request Interface   
  341. ifdef INCL_RXARI
  342. endif ;  INCL_RXARI   
  343. ;***    Macro Space Interface   
  344. ifdef INCL_RXMACRO
  345. endif ;  INCL_RXMACRO   
  346. endif ;  REXXSAA_INCLUDED   
  347.