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