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