home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / borhead.zip / REXXSAA.H < prev    next >
C/C++ Source or Header  |  1994-11-09  |  31KB  |  820 lines

  1. /*********************************************************************\
  2. *
  3. * Module Name: REXXSAA.H
  4. *
  5. * REXX Common Definitions File
  6. *
  7. * @Copyright  1989, 1991 IBM Corporation
  8. * Licensed Materials - Property of IBM
  9. *
  10. * *********************************************************************
  11. *
  12. *   #define:              To include:
  13. *
  14. *   INCL_REXXSAA          Complete Rexx support
  15. *   INCL_RXSUBCOM         Rexx subcommand handler support
  16. *   INCL_RXSHV            Rexx shared variable pool support
  17. *   INCL_RXFUNC           Rexx external function support
  18. *   INCL_RXSYSEXIT        Rexx system exit support
  19. *   INCL_RXMACRO          Rexx macro space support
  20. *   INCL_RXARI            Rexx asynchronous Trace/Halt support
  21. *
  22. \*********************************************************************/
  23.  
  24. #if defined(__IBMC__)
  25. #pragma info( none )
  26.    #ifndef __CHKHDR__
  27.       #pragma info( none )
  28.    #endif
  29. #pragma info( restore )
  30. #endif    /* __IBMC__ */
  31.  
  32. #ifdef __cplusplus
  33.       extern "C" {
  34. #endif
  35.  
  36. #ifndef REXXSAA_INCLUDED
  37. #define REXXSAA_INCLUDED
  38.  
  39. /* XLATON */
  40.  
  41. #ifndef OS2_INCLUDED
  42. #include <os2.h>
  43. #endif
  44.  
  45. /*********************************************************************/
  46. /*                                                                   */
  47. /*                            Common                                 */
  48. /*                                                                   */
  49. /*********************************************************************/
  50.  
  51. /* This section defines return codes and constants that are the      */
  52. /* same for both 16-bit and 32-bit REXX calls.                       */
  53.  
  54. #ifdef INCL_REXXSAA
  55. #define INCL_RXSUBCOM
  56. #define INCL_RXSHV
  57. #define INCL_RXFUNC
  58. #define INCL_RXSYSEXIT
  59. #define INCL_RXMACRO
  60. #define INCL_RXARI
  61. #endif /* INCL_REXXSAA */
  62.  
  63.  
  64. /***    Structure for external interface string (RXSTRING) */
  65.  
  66. typedef struct _RXSTRING {          /* rxstr */
  67.         ULONG  strlength;           /*   length of string         */
  68.         PCH    strptr;              /*   pointer to string        */
  69. }  RXSTRING;
  70.  
  71. typedef RXSTRING     *PRXSTRING;       /* pointer to a RXSTRING      */
  72.  
  73. #define RXAUTOBUFLEN         256L
  74.  
  75.  
  76. /***    Structure for system exit block (RXSYSEXIT) 32-bit */
  77.  
  78. typedef struct _RXSYSEXIT {            /* syse */
  79.    PSZ   sysexit_name;                 /* subcom enviro for sysexit  */
  80.    LONG  sysexit_code;                 /* sysexit function code      */
  81. }  RXSYSEXIT;
  82.  
  83. typedef RXSYSEXIT *PRXSYSEXIT;         /* pointer to a RXSYSEXIT     */
  84.  
  85.  
  86. /* XLATOFF */
  87. /***    Macros for RXSTRING manipulation                   */
  88.  
  89. #define RXNULLSTRING(r)      (!(r).strptr)
  90. #define RXZEROLENSTRING(r)   ((r).strptr && !(r).strlength)
  91. #define RXVALIDSTRING(r)     ((r).strptr && (r).strlength)
  92. #define RXSTRLEN(r)          (RXNULLSTRING(r)?0L:(r).strlength)
  93. #define RXSTRPTR(r)          (r).strptr
  94. #define MAKERXSTRING(r,p,l)  {(r).strptr=(PCH)p;(r).strlength=(ULONG)l;}
  95.  
  96. /* XLATON */
  97.  
  98. /*** Call type codes for use on interpreter startup                  */
  99. #define RXCOMMAND       0              /* Program called as Command  */
  100. #define RXSUBROUTINE    1              /* Program called as Subroutin*/
  101. #define RXFUNCTION      2              /* Program called as Function */
  102.  
  103. /***    Subcommand Interface defines*/
  104. #ifdef INCL_RXSUBCOM
  105.  
  106.  
  107. /***    Drop Authority for RXSUBCOM interface */
  108.  
  109. #define RXSUBCOM_DROPPABLE   0x00     /* handler to be dropped by all*/
  110. #define RXSUBCOM_NONDROP     0x01     /* process with same PID as the*/
  111.                                       /* registrant may drop environ */
  112.  
  113. /***    Return Codes from RXSUBCOM interface */
  114.  
  115. #define RXSUBCOM_ISREG       0x01     /* Subcommand is registered    */
  116. #define RXSUBCOM_ERROR       0x01     /* Subcommand Ended in Error   */
  117. #define RXSUBCOM_FAILURE     0x02     /* Subcommand Ended in Failure */
  118. #define RXSUBCOM_BADENTRY    1001     /* Invalid Entry Conditions    */
  119. #define RXSUBCOM_NOEMEM      1002     /* Insuff stor to complete req */
  120. #define RXSUBCOM_BADTYPE     1003     /* Bad registration type.      */
  121. #define RXSUBCOM_NOTINIT     1004     /* API system not initialized. */
  122. #define RXSUBCOM_OK           0       /* Function Complete           */
  123. #define RXSUBCOM_DUP         10       /* Duplicate Environment Name- */
  124.                                       /* but Registration Completed  */
  125. #define RXSUBCOM_MAXREG      20       /* Cannot register more        */
  126.                                       /* handlers                    */
  127. #define RXSUBCOM_NOTREG      30       /* Name Not Registered         */
  128. #define RXSUBCOM_NOCANDROP   40       /* Name not droppable          */
  129. #define RXSUBCOM_LOADERR     50       /* Could not load function     */
  130. #define RXSUBCOM_NOPROC     127       /* RXSUBCOM routine - not found*/
  131.  
  132. #endif /* INCL_RXSUBCOM for defines */
  133.  
  134. /***    Shared Variable Pool Interface defines */
  135. #ifdef INCL_RXSHV
  136.  
  137. /***    Function Codes for Variable Pool Interface (shvcode) */
  138.  
  139. #define RXSHV_SET          0x00       /* Set var from given value    */
  140. #define RXSHV_FETCH        0x01       /* Copy value of var to buffer */
  141. #define RXSHV_DROPV        0x02       /* Drop variable               */
  142. #define RXSHV_SYSET        0x03       /* Symbolic name Set variable  */
  143. #define RXSHV_SYFET        0x04       /* Symbolic name Fetch variable*/
  144. #define RXSHV_SYDRO        0x05       /* Symbolic name Drop variable */
  145. #define RXSHV_NEXTV        0x06       /* Fetch "next" variable       */
  146. #define RXSHV_PRIV         0x07       /* Fetch private information   */
  147. #define RXSHV_EXIT         0x08       /* Set function exit value     */
  148.  
  149. /***    Return Codes for Variable Pool Interface */
  150.  
  151. #define RXSHV_NOAVL         144       /* Interface not available     */
  152.  
  153. /***    Return Code Flags for Variable Pool Interface (shvret) */
  154.  
  155. #define RXSHV_OK           0x00       /* Execution was OK            */
  156. #define RXSHV_NEWV         0x01       /* Variable did not exist      */
  157. #define RXSHV_LVAR         0x02       /* Last var trans via SHVNEXTV */
  158. #define RXSHV_TRUNC        0x04       /* Truncation occurred-Fetch   */
  159. #define RXSHV_BADN         0x08       /* Invalid variable name       */
  160. #define RXSHV_MEMFL        0x10       /* Out of memory failure       */
  161. #define RXSHV_BADF         0x80       /* Invalid funct code (shvcode)*/
  162.  
  163.  
  164. /***    Structure of Shared Variable Request Block (SHVBLOCK) */
  165.  
  166. typedef struct _SHVBLOCK {            /* shvb */
  167.     struct _SHVBLOCK  *shvnext;       /* pointer to the next block   */
  168.     RXSTRING           shvname;       /* Pointer to the name buffer  */
  169.     RXSTRING           shvvalue;      /* Pointer to the value buffer */
  170.     ULONG              shvnamelen;    /* Length of the name value    */
  171.     ULONG              shvvaluelen;   /* Length of the fetch value   */
  172.     UCHAR              shvcode;       /* Function code for this block*/
  173.     UCHAR              shvret;        /* Individual Return Code Flags*/
  174. }   SHVBLOCK;
  175.  
  176. typedef SHVBLOCK *PSHVBLOCK;
  177.  
  178. #endif /* INCL_RXSHV for defines */
  179.  
  180. /***    External Function Interface */
  181. #ifdef INCL_RXFUNC
  182.  
  183. /***    Registration Type Identifiers for Available Function Table */
  184.  
  185. #define RXFUNC_DYNALINK       1        /* Function Available in DLL  */
  186. #define RXFUNC_CALLENTRY      2        /* Registered as mem entry pt.*/
  187.  
  188.  
  189. /***    Return Codes from RxFunction interface */
  190.  
  191.  
  192. #define RXFUNC_OK             0        /* REXX-API Call Successful   */
  193. #define RXFUNC_DEFINED       10        /* Function Defined in AFT    */
  194. #define RXFUNC_NOMEM         20        /* Not Enough Mem to Add      */
  195. #define RXFUNC_NOTREG        30        /* Funct Not Registered in AFT*/
  196. #define RXFUNC_MODNOTFND     40        /* Funct Dll Module Not Found */
  197. #define RXFUNC_ENTNOTFND     50        /* Funct Entry Point Not Found*/
  198. #define RXFUNC_NOTINIT       60        /* API not initialized        */
  199. #define RXFUNC_BADTYPE       70        /* Bad function type          */
  200. #endif /* INCL_RXFUNC for defines */
  201.  
  202. /***   System Exits defines */
  203. #ifdef INCL_RXSYSEXIT
  204.  
  205. /***    Drop Authority for Rexx Exit interface */
  206.  
  207. #define RXEXIT_DROPPABLE     0x00     /* handler to be dropped by all*/
  208. #define RXEXIT_NONDROP       0x01     /* process with same PID as the*/
  209.                                       /* registrant may drop environ */
  210.  
  211.  
  212. /***    Exit return actions */
  213.  
  214. #define RXEXIT_HANDLED       0        /* Exit handled exit event     */
  215. #define RXEXIT_NOT_HANDLED   1        /* Exit passes on exit event   */
  216. #define RXEXIT_RAISE_ERROR   (-1)     /* Exit handler error occurred */
  217.  
  218. /***    Return Codes from RXEXIT interface */
  219.  
  220. #define RXEXIT_ISREG         0x01     /* Exit is registered          */
  221. #define RXEXIT_ERROR         0x01     /* Exit Ended in Error         */
  222. #define RXEXIT_FAILURE       0x02     /* Exit Ended in Failure       */
  223. #define RXEXIT_BADENTRY      1001     /* Invalid Entry Conditions    */
  224. #define RXEXIT_NOEMEM        1002     /* Insuff stor to complete req */
  225. #define RXEXIT_BADTYPE       1003     /* Bad registration type.      */
  226. #define RXEXIT_NOTINIT       1004     /* API system not initialized. */
  227. #define RXEXIT_OK             0       /* Function Complete           */
  228. #define RXEXIT_DUP           10       /* Duplicate Exit Name-        */
  229.                                       /* but Registration Completed  */
  230. #define RXEXIT_MAXREG        20       /* Cannot register more        */
  231.                                       /* handlers                    */
  232. #define RXEXIT_NOTREG        30       /* Name Not Registered         */
  233. #define RXEXIT_NOCANDROP     40       /* Name not droppable          */
  234. #define RXEXIT_LOADERR       50       /* Could not load function     */
  235. #define RXEXIT_NOPROC       127       /* RXEXIT routine - not found  */
  236.  
  237.  
  238.  
  239. /* System Exit function and sub-function definitions */
  240.  
  241. #define RXENDLST    0                 /* End of exit list.           */
  242. #define RXFNC    2                    /* Process external functions. */
  243. #define    RXFNCCAL 1                 /* subcode value.              */
  244. #define RXCMD    3                    /* Process host commands.      */
  245. #define    RXCMDHST 1                 /* subcode value.              */
  246. #define RXMSQ    4                    /* Manipulate queue.           */
  247. #define    RXMSQPLL 1                 /* Pull a line from queue      */
  248. #define    RXMSQPSH 2                 /* Place a line on queue       */
  249. #define    RXMSQSIZ 3                 /* Return num of lines on queue*/
  250. #define    RXMSQNAM 20                /* Set active queue name       */
  251. #define RXSIO    5                    /* Session I/O.                */
  252. #define    RXSIOSAY 1                 /* SAY a line to STDOUT        */
  253. #define    RXSIOTRC 2                 /* Trace output                */
  254. #define    RXSIOTRD 3                 /* Read from char stream       */
  255. #define    RXSIODTR 4                 /* DEBUG read from char stream */
  256. #define    RXSIOTLL 5                 /* Return linelength(N/A OS/2) */
  257. #define RXHLT    7                    /* Halt processing.            */
  258. #define    RXHLTCLR 1                 /* Clear HALT indicator        */
  259. #define    RXHLTTST 2                 /* Test HALT indicator         */
  260. #define RXTRC    8                    /* Test ext trace indicator.   */
  261. #define    RXTRCTST 1                 /* subcode value.              */
  262. #define RXINI    9                    /* Initialization processing.  */
  263. #define    RXINIEXT 1                 /* subcode value.              */
  264. #define RXTER   10                    /* Termination processing.     */
  265. #define    RXTEREXT 1                 /* subcode value.              */
  266. #define RXNOOFEXITS 11                /* 1 + largest exit number.    */
  267.  
  268. typedef PUCHAR PEXIT;                 /* ptr to exit parameter block */
  269. #endif /* INCL_RXSYSEXIT for defines */
  270.  
  271. /***    Asynchronous Request Interface defines */
  272. #ifdef INCL_RXARI
  273.  
  274. /***    Return Codes from Asynchronous Request interface */
  275.  
  276. #define RXARI_OK                   0  /* Interface completed         */
  277. #define RXARI_NOT_FOUND            1  /* Target program not found    */
  278. #define RXARI_PROCESSING_ERROR     2  /* Error processing request    */
  279. #endif /* INCL_RXARI for defines */
  280.  
  281. /***    Macro Space Interface defines */
  282. #ifdef INCL_RXMACRO
  283.  
  284. /***    Registration Search Order Flags */
  285.  
  286. #define RXMACRO_SEARCH_BEFORE       1  /* Beginning of search order  */
  287. #define RXMACRO_SEARCH_AFTER        2  /* End of search order        */
  288.  
  289.  
  290. /***    Return Codes from RxMacroSpace interface */
  291.  
  292. #define RXMACRO_OK                 0  /* Macro interface completed   */
  293. #define RXMACRO_NO_STORAGE         1  /* Not Enough Storage Available*/
  294. #define RXMACRO_NOT_FOUND          2  /* Requested function not found*/
  295. #define RXMACRO_EXTENSION_REQUIRED 3  /* File ext required for save  */
  296. #define RXMACRO_ALREADY_EXISTS     4  /* Macro functions exist       */
  297. #define RXMACRO_FILE_ERROR         5  /* File I/O error in save/load */
  298. #define RXMACRO_SIGNATURE_ERROR    6  /* Incorrect format for load   */
  299. #define RXMACRO_SOURCE_NOT_FOUND   7  /* Requested cannot be found   */
  300. #define RXMACRO_INVALID_POSITION   8  /* Invalid search order pos    */
  301. #define RXMACRO_NOT_INIT           9  /* API not initialized         */
  302. #endif /* INCL_RXMACRO for defines */
  303.  
  304. /*********************************************************************/
  305. /*                                                                   */
  306. /*                            32-bit                                 */
  307. /*                                                                   */
  308. /*********************************************************************/
  309.  
  310. /* XLATOFF */
  311. /***    Main Entry Point to the REXXSAA Interpreter */
  312.  
  313.  
  314. #pragma linkage(RexxStart,system)
  315. LONG   APIENTRY RexxStart(LONG ,                        /* Num of args passed to rexx */
  316.          PRXSTRING,                    /* Array of args passed to rex */
  317.          PCSZ,                          /* [d:][path] filename[.ext]  */
  318.          PRXSTRING,                    /* Loc of rexx proc in memory */
  319.          PCSZ,                          /* ASCIIZ initial environment.*/
  320.          LONG ,                        /* type (command,subrtn,funct) */
  321.          PRXSYSEXIT,                   /* SysExit env. names &  codes */
  322.          PSHORT,                       /* Ret code from if numeric   */
  323.          PRXSTRING );                  /* Retvalue from the rexx proc */
  324.  
  325. /***   Uppercase Entry Point Name */
  326. #define REXXSTART   RexxStart
  327.  
  328. /* XLATON */
  329.  
  330. /***    Subcommand Interface */
  331. #ifdef INCL_RXSUBCOM
  332.  
  333.  
  334. /* XLATOFF */
  335.  
  336. /* This typedef simplifies coding of a Subcommand handler.           */
  337. #pragma linkage(RexxSubcomHandler,system)
  338. typedef ULONG RexxSubcomHandler(PRXSTRING,
  339.                                 PUSHORT,
  340.                                 PRXSTRING);
  341.  
  342. /***   RexxRegisterSubcomDll -- Register a DLL entry point           */
  343. /***   as a Subcommand handler */
  344.  
  345. #pragma linkage(RexxRegisterSubcomDll,system)
  346. APIRET APIENTRY RexxRegisterSubcomDll(PCSZ,                          /* Name of subcom handler     */
  347.          PCSZ,                          /* Name of DLL                */
  348.          PCSZ,                          /* Name of procedure in DLL   */
  349.          PUCHAR,                       /* User area                  */
  350.          ULONG  );                     /* Drop authority.            */
  351.  
  352. /***   Uppercase Entry Point Name */
  353. #define REXXREGISTERSUBCOMDLL  RexxRegisterSubcomDll
  354.  
  355.  
  356. /***   RexxRegisterSubcomExe -- Register an EXE entry point          */
  357. /***   as a Subcommand handler */
  358.  
  359. #pragma linkage(RexxRegisterSubcomExe,system)
  360. APIRET APIENTRY RexxRegisterSubcomExe(PCSZ,                          /* Name of subcom handler     */
  361.          PFN,                          /* address of handler in EXE  */
  362.          PUCHAR);                      /* User area                  */
  363.  
  364. /***   Uppercase Entry Point Name */
  365. #define REXXREGISTERSUBCOMEXE  RexxRegisterSubcomExe
  366.  
  367.  
  368.  
  369. /***    RexxQuerySubcom - Query an environment for Existance */
  370.  
  371. #pragma linkage(RexxQuerySubcom,system)
  372. APIRET APIENTRY RexxQuerySubcom(PCSZ,                          /* Name of the Environment    */
  373.          PCSZ,                          /* DLL Module Name            */
  374.          PUSHORT,                      /* Stor for existance code    */
  375.          PUCHAR );                     /* Stor for user word         */
  376.  
  377. /***   Uppercase Entry Point Name */
  378. #define REXXQUERYSUBCOM  RexxQuerySubcom
  379.  
  380.  
  381.  
  382. /***    RexxDeregisterSubcom - Drop registration of a Subcommand     */
  383. /***    environment */
  384.  
  385. #pragma linkage(RexxDeregisterSubcom,system)
  386. APIRET APIENTRY RexxDeregisterSubcom(PCSZ,                          /* Name of the Environment    */
  387.          PCSZ );                        /* DLL Module Name            */
  388.  
  389. /***   Uppercase Entry Point Name */
  390. #define REXXDEREGISTERSUBCOM  RexxDeregisterSubcom
  391.  
  392.  
  393. /* XLATON */
  394. #endif /* INCL_RXSUBCOM */
  395.  
  396.  
  397.  
  398. /***    Shared Variable Pool Interface */
  399. #ifdef INCL_RXSHV
  400.  
  401. /* XLATOFF */
  402.  
  403. /***    RexxVariablePool - Request Variable Pool Service */
  404.  
  405. #pragma linkage(RexxVariablePool,system)
  406. APIRET APIENTRY RexxVariablePool(PSHVBLOCK);                  /* Pointer to list of SHVBLOCKs */
  407.  
  408. /***   Uppercase Entry Point Name */
  409. #define REXXVARIABLEPOOL  RexxVariablePool
  410. /* XLATON */
  411.  
  412.  
  413. #endif /* INCL_RXSHV */
  414.  
  415.  
  416. /***    External Function Interface */
  417. #ifdef INCL_RXFUNC
  418.  
  419. /* XLATOFF */
  420.  
  421. /* This typedef simplifies coding of an External Function.           */
  422. #pragma linkage(RexxFunctionHandler,system)
  423. typedef ULONG RexxFunctionHandler(PUCHAR,
  424.                                   ULONG,
  425.                                   PRXSTRING,
  426.                                   PSZ,
  427.                                   PRXSTRING);
  428.  
  429. /***    RexxRegisterFunctionDll - Register a function in the AFT */
  430.  
  431. #pragma linkage(RexxRegisterFunctionDll,system)
  432. APIRET APIENTRY RexxRegisterFunctionDll(PCSZ,                           /* Name of function to add    */
  433.         PCSZ,                           /* Dll file name (if in dll)  */
  434.         PCSZ);                          /* Entry in dll               */
  435.  
  436. /***   Uppercase Entry Point Name */
  437. #define REXXREGISTERFUNCTIONDLL  RexxRegisterFunctionDll
  438.  
  439.  
  440. /***    RexxRegisterFunctionExe - Register a function in the AFT */
  441.  
  442. #pragma linkage(RexxRegisterFunctionExe,system)
  443. APIRET APIENTRY RexxRegisterFunctionExe(PCSZ,                           /* Name of function to add    */
  444.         PFN);                          /* Entry point in EXE         */
  445.  
  446. /***   Uppercase Entry Point Name */
  447. #define REXXREGISTERFUNCTIONEXE  RexxRegisterFunctionExe
  448.  
  449.  
  450.  
  451. /***    RexxDeregisterFunction - Delete a function from the AFT */
  452.  
  453. #pragma linkage(RexxDeregisterFunction,system)
  454. APIRET APIENTRY RexxDeregisterFunction(PCSZ );                         /* Name of function to remove */
  455.  
  456. /***   Uppercase Entry Point Name */
  457. #define REXXDEREGISTERFUNCTION  RexxDeregisterFunction
  458.  
  459.  
  460.  
  461. /***    RexxQueryFunction - Scan the AFT for a function */
  462.  
  463. #pragma linkage(RexxQueryFunction,system)
  464. APIRET APIENTRY RexxQueryFunction(PCSZ );                         /* Name of function to find   */
  465.  
  466. /***   Uppercase Entry Point Name */
  467. #define REXXQUERYFUNCTION  RexxQueryFunction
  468.  
  469.  
  470.  
  471. /* XLATON */
  472.  
  473.  
  474. #endif /* INCL_RXFUNC */
  475.  
  476.  
  477. /***   System Exits */
  478. #ifdef INCL_RXSYSEXIT
  479.  
  480. /***    Subfunction RXFNCCAL - External Function Calls */
  481.  
  482. #if defined(__BORLANDC__)
  483. #pragma pack(1)
  484. #define _Packed
  485. #endif
  486.  
  487. typedef _Packed struct _RXFNC_FLAGS {          /* fl */
  488.    unsigned rxfferr  : 1;              /* Invalid call to routine.   */
  489.    unsigned rxffnfnd : 1;              /* Function not found.        */
  490.    unsigned rxffsub  : 1;              /* Called as a subroutine     */
  491. }  RXFNC_FLAGS ;
  492.  
  493. typedef _Packed struct _RXFNCCAL_PARM {        /* fnc */
  494.    RXFNC_FLAGS       rxfnc_flags ;     /* function flags             */
  495.    PUCHAR            rxfnc_name;       /* Pointer to function name.  */
  496.    USHORT            rxfnc_namel;      /* Length of function name.   */
  497.    PUCHAR            rxfnc_que;        /* Current queue name.        */
  498.    USHORT            rxfnc_quel;       /* Length of queue name.      */
  499.    USHORT            rxfnc_argc;       /* Number of args in list.    */
  500.    PRXSTRING         rxfnc_argv;       /* Pointer to argument list.  */
  501.    RXSTRING          rxfnc_retc;       /* Return value.              */
  502. }  RXFNCCAL_PARM;
  503.  
  504. /***    Subfunction RXCMDHST -- Process Host Commands     */
  505.  
  506. typedef _Packed struct _RXCMD_FLAGS {          /* fl */
  507.    unsigned rxfcfail : 1;              /* Command failed.            */
  508.    unsigned rxfcerr  : 1;              /* Command ERROR occurred.    */
  509. }  RXCMD_FLAGS;
  510.  
  511. typedef _Packed struct _RXCMDHST_PARM {        /* rx */
  512.    RXCMD_FLAGS       rxcmd_flags;      /* error/failure flags        */
  513.    PUCHAR            rxcmd_address;    /* Pointer to address name.   */
  514.    USHORT            rxcmd_addressl;   /* Length of address name.    */
  515.    PUCHAR            rxcmd_dll;        /* dll name for command.      */
  516.    USHORT            rxcmd_dll_len;    /* Length of dll name.        */
  517.    RXSTRING          rxcmd_command;    /* The command string.        */
  518.    RXSTRING          rxcmd_retc;       /* Pointer to return buffer   */
  519. }  RXCMDHST_PARM;
  520.  
  521.  
  522. #if defined(__BORLANDC__)
  523. #pragma pack()
  524. #endif
  525.  
  526. /***     Subfunction RXMSQPLL -- Pull Entry from Queue */
  527.  
  528. typedef struct _RXMSQPLL_PARM {        /* pll */
  529.    RXSTRING          rxmsq_retc;       /* Pointer to dequeued entry  */
  530.                                        /* buffer.  User allocated.   */
  531. } RXMSQPLL_PARM;
  532.  
  533.  
  534. #if defined(__BORLANDC__)
  535. #pragma pack(1)
  536. #endif
  537.  
  538. /***    Subfunction RXMSQPSH -- Push Entry on Queue */
  539.  
  540. typedef _Packed struct _RXMSQ_FLAGS {          /* fl */
  541.    unsigned rxfmlifo : 1;              /* Stack entry LIFO if set    */
  542. }  RXMSQ_FLAGS;
  543.  
  544. typedef _Packed struct _RXMSQPSH_PARM {        /* psh */
  545.    RXMSQ_FLAGS       rxmsq_flags;      /* LIFO/FIFO flag             */
  546.    RXSTRING          rxmsq_value;      /* The entry to be pushed.    */
  547. }  RXMSQPSH_PARM;
  548.  
  549.  
  550. #if defined(__BORLANDC__)
  551. #pragma pack()
  552. #endif
  553.  
  554.  
  555. /***    Subfunction RXMSQSIZ -- Return the Current Queue Size */
  556.  
  557. typedef struct _RXMSQSIZ_PARM {        /* siz */
  558.    ULONG             rxmsq_size;       /* Number of Lines in Queue   */
  559. }  RXMSQSIZ_PARM;
  560.  
  561.  
  562. /***    Subfunction RXMSQNAM -- Set Current Queue Name */
  563.  
  564. typedef struct _RXMSQNAM_PARM {        /* nam */
  565.    RXSTRING          rxmsq_name;       /* RXSTRING containing        */
  566.                                        /* queue name.                */
  567. }  RXMSQNAM_PARM;
  568.  
  569.  
  570. /***    Subfunction RXSIOSAY -- Perform SAY Clause */
  571.  
  572. typedef struct _RXSIOSAY_PARM {        /* say */
  573.    RXSTRING          rxsio_string;     /* String to display.         */
  574. }  RXSIOSAY_PARM;
  575.  
  576.  
  577. /***    Subfunction RXSIOTRC -- Write Trace Output */
  578.  
  579. typedef struct _RXSIOTRC_PARM { /* trcparm */
  580.    RXSTRING          rxsio_string;     /* Trace line to display.     */
  581. }  RXSIOTRC_PARM;
  582.  
  583.  
  584. /***    Subfunction RXSIOTRD -- Read Input from the Terminal */
  585.  
  586. typedef struct _RXSIOTRD_PARM {        /* trd */
  587.    RXSTRING          rxsiotrd_retc;    /* RXSTRING for output.       */
  588. }  RXSIOTRD_PARM;
  589.  
  590.  
  591. /***    Subfunction RXSIODTR -- Read Debug Input from the Terminal */
  592.  
  593. typedef struct _RXSIODTR_PARM {        /* dtr */
  594.    RXSTRING          rxsiodtr_retc;    /* RXSTRING for output.       */
  595. }  RXSIODTR_PARM;
  596.  
  597.  
  598. /***    Subfunction RXHSTTST -- Test for HALT Condition */
  599.  
  600. typedef struct _RXHLT_FLAGS {          /* fl Halt flag               */
  601.    unsigned rxfhhalt : 1;              /* Set if HALT occurred.      */
  602. }  RXHLT_FLAGS;
  603.  
  604. typedef struct _RXHLTTST_PARM {        /* tst */
  605.    RXHLT_FLAGS rxhlt_flags;            /* Set if HALT occurred       */
  606. }  RXHLTTST_PARM;
  607.  
  608.  
  609. /***    Subfunction RXTRCTST -- Test for TRACE Condition */
  610.  
  611. typedef struct _RXTRC_FLAGS {          /* fl Trace flags             */
  612.    unsigned rxftrace : 1;              /* Set to run external trace. */
  613. }  RXTRC_FLAGS;
  614.  
  615. typedef struct _RXTRCTST_PARM {        /* tst */
  616.    RXTRC_FLAGS rxtrc_flags;            /* Set to run external trace  */
  617. }  RXTRCTST_PARM;
  618.  
  619.  
  620. /* XLATOFF */
  621.  
  622. /* This typedef simplifies coding of an Exit handler.                */
  623. #pragma linkage(RexxExitHandler,system)
  624. typedef LONG RexxExitHandler(LONG,
  625.                              LONG,
  626.                              PEXIT);
  627.  
  628. /***      RexxRegisterExitDll - Register a system exit. */
  629.  
  630. #pragma linkage(RexxRegisterExitDll,system)
  631. APIRET APIENTRY RexxRegisterExitDll(PCSZ,                          /* Name of the exit handler   */
  632.          PCSZ,                          /* Name of the DLL            */
  633.          PCSZ,                          /* Name of the procedure      */
  634.          PUCHAR,                       /* User area                  */
  635.          ULONG );                      /* Drop authority             */
  636.  
  637. /***   Uppercase Entry Point Name */
  638. #define REXXREGISTEREXITDLL  RexxRegisterExitDll
  639.  
  640.  
  641. /***      RexxRegisterExitExe - Register a system exit. */
  642.  
  643. #pragma linkage(RexxRegisterExitExe,system)
  644. APIRET APIENTRY RexxRegisterExitExe(PCSZ,                          /* Name of the exit handler   */
  645.          PFN,                          /* Address of exit handler    */
  646.          PUCHAR);                      /* User area                  */
  647.  
  648. /***   Uppercase Entry Point Name */
  649. #define REXXREGISTEREXITEXE  RexxRegisterExitExe
  650.  
  651.  
  652.  
  653. /***    RexxDeregisterExit - Drop registration of a system exit. */
  654.  
  655. #pragma linkage(RexxDeregisterExit,system)
  656. APIRET APIENTRY RexxDeregisterExit(PCSZ,                          /* Exit name                  */
  657.          PCSZ ) ;                       /* DLL module name            */
  658.  
  659. /***   Uppercase Entry Point Name */
  660. #define REXXDEREGISTEREXIT  RexxDeregisterExit
  661.  
  662.  
  663.  
  664. /***    RexxQueryExit - Query an exit for existance. */
  665.  
  666. #pragma linkage(RexxQueryExit,system)
  667. APIRET APIENTRY RexxQueryExit(PCSZ,                          /* Exit name                  */
  668.          PCSZ,                          /* DLL Module name.           */
  669.          PUSHORT,                      /* Existance flag.            */
  670.          PUCHAR );                     /* User data.                 */
  671.  
  672. /***   Uppercase Entry Point Name */
  673. #define REXXQUERYEXIT  RexxQueryExit
  674. /* XLATON */
  675.  
  676.  
  677. #endif /* INCL_RXSYSEXIT */
  678.  
  679.  
  680. /***    Asynchronous Request Interface */
  681. #ifdef INCL_RXARI
  682.  
  683. /* XLATOFF */
  684.  
  685. /***    RexxSetHalt - Request Program Halt */
  686.  
  687. #pragma linkage(RexxSetHalt,system)
  688. APIRET APIENTRY RexxSetHalt(PID,                         /* Process Id                  */
  689.          TID);                        /* Thread Id                   */
  690.  
  691. /***   Uppercase Entry Point Name */
  692. #define REXXSETHALT  RexxSetHalt
  693.  
  694.  
  695. /***    RexxSetTrace - Request Program Trace */
  696.  
  697. #pragma linkage(RexxSetTrace,system)
  698. APIRET APIENTRY RexxSetTrace(PID,                         /* Process Id                  */
  699.          TID);                        /* Thread Id                   */
  700.  
  701. /***   Uppercase Entry Point Name */
  702. #define REXXSETTRACE  RexxSetTrace
  703.  
  704.  
  705. /***    RexxResetTrace - Turn Off Program Trace */
  706.  
  707. #pragma linkage(RexxResetTrace,system)
  708. APIRET APIENTRY RexxResetTrace(PID,                         /* Process Id                  */
  709.          TID);                        /* Thread Id                   */
  710.  
  711. /***   Uppercase Entry Point Name */
  712. #define REXXRESETTRACE  RexxResetTrace
  713.  
  714. /* XLATON */
  715.  
  716.  
  717. #endif /* INCL_RXARI */
  718.  
  719.  
  720. /***    Macro Space Interface */
  721. #ifdef INCL_RXMACRO
  722.  
  723. /* XLATOFF */
  724.  
  725. /***    RexxAddMacro - Register a function in the Macro Space        */
  726.  
  727. #pragma linkage(RexxAddMacro,system)
  728. APIRET APIENTRY RexxAddMacro(PCSZ,                         /* Function to add or change   */
  729.          PCSZ,                         /* Name of file to get function*/
  730.          ULONG  );                    /* Flag indicating search pos  */
  731.  
  732. /***   Uppercase Entry Point Name */
  733. #define REXXADDMACRO  RexxAddMacro
  734.  
  735.  
  736.  
  737. /***    RexxDropMacro - Remove a function from the Macro Space       */
  738.  
  739. #pragma linkage(RexxDropMacro,system)
  740. APIRET APIENTRY RexxDropMacro(PCSZ );                        /* Name of function to remove */
  741.  
  742. /***   Uppercase Entry Point Name */
  743. #define REXXDROPMACRO  RexxDropMacro
  744.  
  745.  
  746.  
  747. /***    RexxSaveMacroSpace - Save Macro Space functions to a file    */
  748.  
  749. #pragma linkage(RexxSaveMacroSpace,system)
  750. APIRET APIENTRY RexxSaveMacroSpace(ULONG ,                      /* Argument count (0==save all) */
  751.          PCSZ *,                       /* List of funct names to save */
  752.          PCSZ);                        /* File to save functions in   */
  753.  
  754. /***   Uppercase Entry Point Name */
  755. #define REXXSAVEMACROSPACE  RexxSaveMacroSpace
  756.  
  757.  
  758.  
  759. /***    RexxLoadMacroSpace - Load Macro Space functions from a file  */
  760.  
  761. #pragma linkage(RexxLoadMacroSpace,system)
  762. APIRET APIENTRY RexxLoadMacroSpace(ULONG ,                      /* Argument count (0==load all) */
  763.          PCSZ *,                       /* List of funct names to load */
  764.          PCSZ);                        /* File to load functions from */
  765.  
  766. /***   Uppercase Entry Point Name */
  767. #define REXXLOADMACROSPACE  RexxLoadMacroSpace
  768.  
  769.  
  770.  
  771. /***    RexxQueryMacro - Find a function's search-order position     */
  772.  
  773. #pragma linkage(RexxQueryMacro,system)
  774. APIRET APIENTRY RexxQueryMacro(PCSZ,                         /* Function to search for      */
  775.          PUSHORT );                   /* Ptr for position flag return */
  776.  
  777. /***   Uppercase Entry Point Name */
  778. #define REXXQUERYMACRO  RexxQueryMacro
  779.  
  780.  
  781.  
  782. /***    RexxReorderMacro - Change a function's search-order          */
  783. /***                            position                             */
  784.  
  785. #pragma linkage(RexxReorderMacro,system)
  786. APIRET APIENTRY RexxReorderMacro(PCSZ,                         /* Name of funct change order  */
  787.          ULONG  );                    /* New position for function   */
  788.  
  789. /***   Uppercase Entry Point Name */
  790. #define REXXREORDERMACRO  RexxReorderMacro
  791.  
  792.  
  793.  
  794. /***    RexxClearMacroSpace - Remove all functions from a MacroSpace */
  795.  
  796.  
  797. #pragma linkage(RexxClearMacroSpace,system)
  798. APIRET APIENTRY RexxClearMacroSpace(VOID );                      /* No Arguments.               */
  799.  
  800. /***   Uppercase Entry Point Name */
  801. #define REXXCLEARMACROSPACE  RexxClearMacroSpace
  802.  
  803. /* XLATON */
  804.  
  805. #endif /* INCL_RXMACRO */
  806.  
  807. #endif /* REXXSAA_INCLUDED */
  808.  
  809. #ifdef __cplusplus
  810.         }
  811. #endif
  812.  
  813. #if defined(__IBMC__)
  814. #pragma info( none )
  815.    #ifndef __CHKHDR__
  816.       #pragma info( restore )
  817.    #endif
  818. #pragma info( restore )
  819. #endif    /* __IBMC__ */
  820.