home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rex22emx.zip / rexxsaa.h < prev    next >
C/C++ Source or Header  |  2000-09-17  |  26KB  |  800 lines

  1. /*
  2.  *  The Regina Rexx Interpreter
  3.  *  Copyright (C) 1993-1994  Anders Christensen <anders@pvv.unit.no>
  4.  *
  5.  *  This library is free software; you can redistribute it and/or
  6.  *  modify it under the terms of the GNU Library General Public
  7.  *  License as published by the Free Software Foundation; either
  8.  *  version 2 of the License, or (at your option) any later version.
  9.  *
  10.  *  This library is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  *  Library General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU Library General Public
  16.  *  License along with this library; if not, write to the Free
  17.  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19. /*
  20.  * $Id: rexxsaa.h,v 1.8 2000/09/10 10:34:17 mark Exp mark $
  21.  */
  22.  
  23. #ifndef __REXXSAA_H_INCLUDED
  24. #define __REXXSAA_H_INCLUDED
  25. /* Remember to add prototypes for Rexx*() functions */
  26.  
  27. #if defined(WIN32) && (defined(__WATCOMC__) || defined(__BORLANDC__))
  28. # include <windows.h>
  29. #endif
  30.  
  31. #if defined(__RSXNT__) || defined(__MINGW32__)
  32. # include <windows.h>
  33. #endif
  34.  
  35. #if defined(_MSC_VER)
  36. # if _MSC_VER >= 1100
  37. /* Stupid MSC can't compile own headers without warning at least in VC 5.0 */
  38. #   pragma warning(disable: 4115 4201 4214)
  39. # endif
  40. # include <windows.h>
  41. # if _MSC_VER >= 1100
  42. #   pragma warning(default: 4115 4201 4214)
  43. # endif
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #ifndef CONST
  51. /* Introduced in Regina 2.0, may/should not exist in non-ANSI compilers.
  52.  * Everybody can see which params will change even if CONST is not defined.
  53.  * We don't use CONST at all places to be consistent with other
  54.  * implementations. You can see a "CONST" as a comment before each variable
  55.  * which is/must not be changed.
  56.  */
  57. # define CONST const
  58. #endif
  59.  
  60. #if defined(__MINGW32__)
  61. typedef CONST char *PCSZ ;
  62. #endif
  63.  
  64. #if defined(__MINGW32__) && defined(__REGINA_DLL)
  65. #define EXTNAME(n) __attribute__((alias (n)))
  66. #else
  67. #define EXTNAME(n)
  68. #endif
  69.  
  70. #if !defined(_OS2EMX_H) && !defined(__RSXNT__) && !defined(__MINGW32__)
  71. typedef char CHAR ;
  72. typedef short SHORT ;
  73. typedef long LONG ;
  74. typedef char *PSZ ;
  75. typedef CONST char *PCSZ ;
  76. # ifndef VOID
  77. typedef void VOID ;
  78. # endif
  79. typedef void* PVOID ;
  80.  
  81. typedef CHAR *PCHAR ;
  82. typedef SHORT *PSHORT ;
  83. typedef LONG *PLONG ;
  84.  
  85. # ifndef UCHAR_TYPEDEFED
  86. typedef unsigned char UCHAR ;
  87. #  define UCHAR_TYPEDEFED
  88. # endif
  89. # ifndef USHORT_TYPEDEFED
  90. typedef unsigned short USHORT ;
  91. #  define USHORT_TYPEDEFED
  92. # endif
  93. # ifndef ULONG_TYPEDEFED
  94. typedef unsigned long ULONG ;
  95. #  define ULONG_TYPEDEFED
  96. # endif
  97.  
  98. typedef USHORT *PUSHORT ;
  99. typedef CHAR *PCH ;
  100. typedef UCHAR *PUCHAR ;
  101.  
  102. #endif
  103.  
  104. #ifdef INCL_REXXSAA
  105. # define INCL_RXSUBCOM
  106. # define INCL_RXSHV
  107. # define INCL_RXFUNC
  108. # define INCL_RXSYSEXIT
  109. # define INCL_RXMACRO
  110. # define INCL_RXARI
  111. # define INCL_RXQUEUE
  112. # define INCL_RXMACRO
  113. #endif
  114.  
  115. #if !defined(APIENTRY)
  116. # define APIENTRY
  117. #endif
  118.  
  119. #if !defined(APIRET)
  120. # define APIRET ULONG
  121. #endif
  122.  
  123. #if !defined(_OS2EMX_H)
  124. typedef APIRET (APIENTRY *PFN)();
  125. #endif
  126.  
  127.  
  128. typedef struct RXSTRING_type
  129. {
  130.    ULONG strlength ;
  131.    char* strptr ;
  132. } RXSTRING ;
  133. typedef RXSTRING *PRXSTRING ;
  134.  
  135. typedef struct REXXDATETIME_type
  136. {
  137.    USHORT hours;               /* hour of the day (24-hour)    */
  138.    USHORT minutes;             /* minute of the hour           */
  139.    USHORT seconds;             /* second of the minute         */
  140.    USHORT hundredths;          /* hundredths of a second       */
  141.    USHORT day;                 /* day of the month             */
  142.    USHORT month;               /* month of the year            */
  143.    USHORT year;                /* current year                 */
  144.    USHORT weekday;             /* day of the week              */
  145.    ULONG  microseconds;        /* microseconds                 */
  146.    ULONG  yearday;             /* day number within the year   */
  147.    USHORT valid;               /* valid time stamp marker      */
  148. } REXXDATETIME;
  149. #define DATETIME REXXDATETIME
  150. typedef REXXDATETIME *PDATETIME;
  151.  
  152. #define RXAUTOBUFLEN  256L
  153.  
  154. typedef struct {
  155.    char *sysexit_name ;
  156.    LONG  sysexit_code ;
  157. } RXSYSEXIT ;
  158. typedef RXSYSEXIT *PRXSYSEXIT ;
  159.  
  160. /*
  161.  * -------------------------------------------------------------------
  162.  * System Exit Interface
  163.  *-------------------------------------------------------------------
  164.  */
  165. #ifdef INCL_RXSYSEXIT
  166.  
  167. /*
  168.  * The following are definition for the function codes and subcodes for
  169.  * System Exit Handlers. All RXxxx macros are function codes, while the
  170.  * RXxxxyyy macros are function subcodes for function code RXxxx.
  171.  */
  172. #define RXFNC        2
  173. # define RXFNCCAL    1
  174.  
  175. #define RXCMD        3
  176. # define RXCMDHST    1
  177.  
  178. #define RXMSQ        4 /* Net yet implemented */
  179. # define RXMSQPLL    1 /* Net yet implemented */
  180. # define RXMSQPSH    2 /* Net yet implemented */
  181. # define RXMSQSIZ    3 /* Net yet implemented */
  182. # define RXMSQNAM   20 /* Net yet implemented */
  183.  
  184. #define RXSIO        5
  185. # define RXSIOSAY    1
  186. # define RXSIOTRC    2
  187. # define RXSIOTRD    3
  188. # define RXSIODTR    4
  189. # define RXSIOTLL    5 /* Net yet implemented */
  190.  
  191. #define RXHLT        7
  192. # define RXHLTCLR    1
  193. # define RXHLTTST    2
  194.  
  195. #define RXTRC        8
  196. # define RXTRCTST    1
  197.  
  198. #define RXINI        9
  199. # define RXINIEXT    1
  200.  
  201. #define RXTER       10
  202. # define RXTEREXT    1
  203.  
  204. #define RXDBG       11
  205. # define RXDBGTST    1
  206.  
  207. #define RXENDLST     0
  208. #define RXNOOFEXITS 11
  209.  
  210. /* Symbolic return codes for System Exit Handlers */
  211. #define RXEXIT_HANDLED       0
  212. #define RXEXIT_NOT_HANDLED   1
  213. #define RXEXIT_RAISE_ERROR (-1)
  214.  
  215. #define RXEXIT_DROPPABLE     0x00
  216. #define RXEXIT_NONDROP       0x01
  217.  
  218. /* Return Codes from RXEXIT interface */
  219.  
  220. #define RXEXIT_ISREG         0x01
  221. #define RXEXIT_ERROR         0x01
  222. #define RXEXIT_FAILURE       0x02
  223. #define RXEXIT_BADENTRY      1001
  224. #define RXEXIT_NOEMEM        1002
  225. #define RXEXIT_BADTYPE       1003
  226. #define RXEXIT_NOTINIT       1004
  227. #define RXEXIT_OK               0
  228. #define RXEXIT_DUP             10
  229. #define RXEXIT_MAXREG          20
  230. #define RXEXIT_NOTREG          30
  231. #define RXEXIT_NOCANDROP       40
  232. #define RXEXIT_LOADERR         50
  233. #define RXEXIT_NOPROC         127
  234.  
  235. typedef struct {
  236.    struct {
  237.                unsigned  rxfferr:1 ;
  238.                unsigned  rxffnfnd:1 ;
  239.                unsigned  rxffsub:1 ;
  240.    }                     rxfnc_flags ;
  241.    /* CONST */ PUCHAR    rxfnc_name ;
  242.                USHORT    rxfnc_namel ;
  243.    /* CONST */ PUCHAR    rxfnc_que ;
  244.                USHORT    rxfnc_quel ;
  245.                USHORT    rxfnc_argc ;
  246.    /* CONST */ PRXSTRING rxfnc_argv ;
  247.                RXSTRING  rxfnc_retc ;
  248. } RXFNCCAL_PARM ;
  249.  
  250. typedef struct {
  251.    struct {
  252.                unsigned rxfcfail:1 ;
  253.                unsigned rxfcerr:1 ;
  254.    }                    rxcmd_flags ;
  255.    /* CONST */ PUCHAR   rxcmd_address ;
  256.                USHORT   rxcmd_addressl ;
  257.    /* CONST */ PUCHAR   rxcmd_dll ;
  258.                USHORT   rxcmd_dll_len ;
  259.    /* CONST */ RXSTRING rxcmd_command ;
  260.                RXSTRING  rxcmd_retc ;
  261. } RXCMDHST_PARM ;
  262.  
  263. typedef struct {
  264.    RXSTRING rxmsq_retc ;
  265. } RXMSQPLL_PARM ;
  266.  
  267. typedef struct {
  268.    struct {
  269.                unsigned rcfmlifo:1 ;
  270.    }                    rcmsq_flags ;
  271.    /* CONST */ RXSTRING rxmsq_value ;
  272. } RXMSQPSH_PARM ;
  273.  
  274. typedef struct {
  275.    ULONG rxmsq_size ;
  276. } RXMSQSIZ_PARM ;
  277.  
  278. typedef struct {
  279.    RXSTRING rxmsq_name ;
  280. } RXMSQNAM_PARM ;
  281.  
  282. typedef struct {
  283.    /* CONST */ RXSTRING rxsio_string ;
  284. } RXSIOSAY_PARM ;
  285.  
  286. typedef struct {
  287.    /* CONST */ RXSTRING rxsio_string ;
  288. } RXSIOTRC_PARM ;
  289.  
  290. typedef struct {
  291.    RXSTRING rxsiotrd_retc ;
  292. } RXSIOTRD_PARM ;
  293.  
  294. typedef struct {
  295.    RXSTRING rxsiodtr_retc ;
  296. } RXSIODTR_PARM ;
  297.  
  298. typedef struct {
  299.    struct {
  300.       unsigned rxfhhalt:1 ;
  301.    }           rxhlt_flags ;
  302. } RXHLTTST_PARM ;
  303.  
  304. typedef struct {
  305.    struct {
  306.       unsigned rxftrace:1 ;
  307.    }           rxtrx_flags ;
  308. } RXTRCTST_PARM ;
  309.  
  310. /*
  311.  #define rxfnc_flags    rxfnccal.u_rxfnc_flags
  312.  #define rxfnc_name     rxfnccal.u_rxfnc_name
  313.  #define rxfnc_namel    rxfnccal.u_rxfnc_namel
  314.  #define rxfnc_que      rxfnccal.u_rxfnc_que
  315.  #define rxfnc_quel     rxfnccal.u_rxfnc_quel
  316.  #define rxfnc_argc     rxfnccal.u_rxfnc_argc
  317.  #define rxfnc_argv     rxfnccal.u_rxfnc_argv
  318.  #define rxfnc_retc     rxfnccal.u_rxfnc_retc
  319.  #define rxcmd_flags    rxcmdhst.u_rxcmd_flags
  320.  #define rxcmd_address  rxcmdhst.u_rxcmd_address
  321.  #define rxcmd_addressl rxcmdhst.u_rxcmd_addressl
  322.  #define rxcmd_dll      rxcmdhst.u_rxcmd_dll
  323.  #define rxcmd_dll_len  rxcmdhst.u_rxcmd_dll_len
  324.  #define rxcmd_command  rxcmdhst.u_rxcmd_command
  325.  #define rxcmd_retc     rxcmdhst.u_rxcmd_retc
  326.  #define rxmsq_retc     rxmsqpll.u_rxmsq_retc
  327.  #define rxsio_string   rxsiosay.u_rxsio_string
  328.  #define rxsiotrd_retc  rxsiotrd.u_rxsiotrd_retc
  329.  #define rxsiodtr_retc  rxsiodtr.u_rxsiodtr_retc
  330.  #define rxhlt_flags    rxhlttst.u_rxhlt_flags
  331.  #define rxtrc_flags    rxtrctst.u_rxtrc_flags
  332.  */
  333.  
  334. typedef union {
  335.    RXFNCCAL_PARM fnccal ;
  336.    RXCMDHST_PARM cmdhst ;
  337.    RXMSQPLL_PARM msqpll ;
  338.    RXMSQPSH_PARM msqpsh ;
  339.    RXMSQSIZ_PARM msqsiz ;
  340.    RXMSQNAM_PARM msqnam ;
  341.    RXSIOSAY_PARM siosay ;
  342.    RXSIOTRC_PARM siotrc ;
  343.    RXSIOTRD_PARM siotrd ;
  344.    RXSIODTR_PARM siodtr ;
  345.    RXHLTTST_PARM hlttst ;
  346.    RXTRCTST_PARM trctst ;
  347. } EXIT ;
  348.  
  349. typedef PUCHAR PEXIT ;
  350.  
  351. typedef LONG APIENTRY RexxExitHandler( LONG, LONG, /* CONST */ PEXIT ) ;
  352.  
  353. APIRET APIENTRY RexxRegisterExitExe(
  354.                 PCSZ             EnvName,
  355. #ifdef RX_STRONGTYPING
  356.                 RexxExitHandler *EntryPoint,
  357. #else
  358.                 PFN              EntryPoint,
  359. #endif
  360.     /* CONST */ PUCHAR           UserArea )
  361. EXTNAME("RexxRegisterExitExe");
  362. #define REXXREGISTEREXITEXE RexxRegisterExitExe
  363.  
  364. APIRET APIENTRY RexxRegisterExitDll(
  365.                 PCSZ   EnvName,
  366.                 PCSZ   ModuleName,
  367.                 PCSZ   ProcedureName,
  368.     /* CONST */ PUCHAR UserArea,
  369.                 ULONG  DropAuth )
  370. EXTNAME("RexxRegisterExitDll");
  371. #define REXXREGISTEREXITDLL RexxRegisterExitDll
  372.  
  373. APIRET APIENTRY RexxDeregisterExit(
  374.                 PCSZ EnvName,
  375.                 PCSZ ModuleName )
  376. EXTNAME("RexxDeregisterExit");
  377. #define REXXDEREGISTEREXIT RexxDeregisterExit
  378.  
  379. APIRET APIENTRY RexxQueryExit (
  380.                 PCSZ    ExitName,
  381.                 PCSZ    ModuleName,
  382.                 PUSHORT Flag,
  383.                 PUCHAR  UserArea)
  384. EXTNAME("RexxQueryExit");
  385. #define REXXQUERYEXIT RexxQueryExit
  386.  
  387. #endif /* INCL_RXSYSEXIT */
  388.  
  389.  
  390.  
  391. #define MAXENVNAMELEN 31
  392.  
  393. #define MAKERXSTRING(x,c,l)   ((x).strptr=(c),(x).strlength=(l))
  394. #define RXNULLSTRING(x)       (!(x).strptr)
  395. #define RXSTRLEN(x)           ((x).strptr ? (x).strlength : 0UL)
  396. #define RXSTRPTR(x)           ((x).strptr)
  397. #define RXVALIDSTRING(x)      ((x).strptr && (x).strlength)
  398. #define RXZEROLENSTRING(x)    ((x).strptr && !(x).strlength)
  399.  
  400. #define RXCOMMAND         0
  401. #define RXSUBROUTINE      1
  402. #define RXFUNCTION        2
  403.  
  404.  
  405. #ifdef INCL_RXSHV
  406.  
  407. /*
  408.  * Definitions and declarations for the Rexx variable pool interface.
  409.  */
  410.  
  411. # define RXSHV_OK       0x00    /* Everything OK */
  412. # define RXSHV_NEWV     0x01    /* Var not previously set */
  413. # define RXSHV_LVAR     0x02    /* Last var in a NEXTV sequence */
  414. # define RXSHV_TRUNC    0x04    /* Name or value has been truncated */
  415. # define RXSHV_BADN     0x08    /* Bad/invalid name */
  416. # define RXSHV_MEMFL    0x10    /* Memory problem, e.g. out of memory */
  417. # define RXSHV_BADF     0x80    /* Invalid function code */
  418.  
  419. # define RXSHV_NOAVL    0x90    /* Interface is not available */
  420.  
  421. /*
  422.  * Note: Some documentation claims that RXSHV_BADF should have the
  423.  *       value 0x80, but that can't be correct, can it?
  424.  */
  425.  
  426. # define RXSHV_SET      0x00    /* Set variable */
  427. # define RXSHV_FETCH    0x01    /* Get value of variable */
  428. # define RXSHV_DROPV    0x02    /* Drop variable */
  429. # define RXSHV_SYSET    0x03    /* Set symbolic variable */
  430. # define RXSHV_SYFET    0x04    /* Get value of symbolic variable */
  431. # define RXSHV_SYDRO    0x05    /* Drop symbolic variable */
  432. # define RXSHV_NEXTV    0x06    /* Get next var in a NEXTV sequence */
  433. # define RXSHV_PRIV     0x07    /* Get private information */
  434. # define RXSHV_EXIT     0x08    /* Set function exit value */
  435.  
  436. /*
  437.  * Note: A symbolic variable is a symbol that will be 'expanded' before
  438.  *       use, while a (normal) variable is used directly, without
  439.  *       expanding it first.
  440.  */
  441.  
  442. typedef struct shvnode
  443. {
  444.    struct shvnode *shvnext ;
  445.    RXSTRING        shvname ;
  446.    RXSTRING        shvvalue ;
  447.    ULONG           shvnamelen ;
  448.    ULONG           shvvaluelen ;
  449.    UCHAR           shvcode ;
  450.    UCHAR           shvret ;
  451. } SHVBLOCK ;
  452.  
  453. typedef SHVBLOCK *PSHVBLOCK ;
  454.  
  455. APIRET APIENTRY RexxVariablePool(
  456.                 PSHVBLOCK  RequestBlockList )
  457. EXTNAME("RexxVariablePool");
  458. #define REXXVARIABLEPOOL RexxVariablePool
  459.  
  460. #endif /* INCL_RXSHV */
  461.  
  462.  
  463. APIRET APIENTRY RexxFreeMemory(
  464.                 PVOID      MemoryBlock )
  465. EXTNAME("RexxFreeMemory");
  466. #define REXXFREEMEMORY RexxFreeMemory
  467.  
  468. PVOID APIENTRY  RexxAllocateMemory(
  469.                 ULONG      size )
  470. EXTNAME("RexxAllocateMemory");
  471. #define REXXALLOCATEMEMORY RexxAllocateMemory
  472.  
  473.  
  474. APIRET APIENTRY RexxStart(
  475.                 LONG       ArgCount,
  476.     /* CONST */ PRXSTRING  ArgList,
  477.                 PCSZ       ProgramName,
  478.     /* CONST */ PRXSTRING  Instore,
  479.                 PCSZ       EnvName,
  480.                 LONG       CallType,
  481.     /* CONST */ PRXSYSEXIT Exits,
  482.                 PSHORT     ReturnCode,
  483.                 PRXSTRING  Result )
  484. EXTNAME("RexxStart");
  485. #define REXXSTART RexxStart
  486.  
  487. /*
  488.  * Return codes .... haha there doesn't seem to be a standard, except
  489.  * zero is OK, negative is an Rexx error, the positive error codes below
  490.  * are my own 'invention'
  491.  */
  492. #define RX_START_OK         0
  493. #define RX_START_BADP       1  /* Bad parameters */
  494. #define RX_START_UNIMPL     2  /* Not yet implemented :-) */
  495. #define RX_START_TOOMANYP   3  /* To many parameters */
  496. #define RX_DIDNT_START      4  /* Unable to start interpreter */
  497.  
  498. /*
  499.  * -------------------------------------------------------------------
  500.  * Sub-command Interface
  501.  *-------------------------------------------------------------------
  502.  */
  503. #ifdef INCL_RXSUBCOM
  504.  
  505. typedef APIRET APIENTRY RexxSubcomHandler(/* CONST */ PRXSTRING, PUSHORT, PRXSTRING);
  506.  
  507. APIRET APIENTRY RexxRegisterSubcomExe(
  508.                 PCSZ               EnvName,
  509. #ifdef RX_STRONGTYPING
  510.                 RexxSubcomHandler *EntryPoint,
  511. #else
  512.                 PFN                EntryPoint,
  513. #endif
  514.     /* CONST */ PUCHAR             UserArea )
  515. EXTNAME("RexxRegisterSubcomExe");
  516. #define REXXREGISTERSUBCOMEXE RexxRegisterSubcomExe
  517.  
  518. APIRET APIENTRY RexxDeregisterSubcom(
  519.                 PCSZ EnvName,
  520.                 PCSZ ModuleName )
  521. EXTNAME("RexxDeregisterSubcom");
  522. #define REXXDEREGISTERSUBCOM RexxDeregisterSubcom
  523.  
  524. APIRET APIENTRY RexxRegisterSubcomDll(
  525.                 PCSZ   EnvName,
  526.                 PCSZ   ModuleName,
  527.                 PCSZ   ProcedureName,
  528.     /* CONST */ PUCHAR UserArea,
  529.                 ULONG  DropAuth )
  530. EXTNAME("RexxRegisterSubcomDll");
  531. #define REXXREGISTERSUBCOMDLL RexxRegisterSubcomDll
  532.  
  533. APIRET APIENTRY RexxQuerySubcom(
  534.                 PCSZ    Envname,
  535.                 PCSZ    ModuleName,
  536.                 PUSHORT Flag,       /* Documentation diverges ... */
  537.                 PUCHAR  UserArea ) 
  538. EXTNAME("RexxQuerySubcom");
  539. #define REXXQUERYSUBCOM RexxQuerySubcom
  540.  
  541. #define RXSUBCOM_OK          0
  542. #define RXSUBCOM_DUP        10
  543. #define RXSUBCOM_MAXREG     20
  544. #define RXSUBCOM_NOTREG     30
  545. #define RXSUBCOM_NOCANDROP  40
  546. #define RXSUBCOM_LOADERR    50
  547. #define RXSUBCOM_NOPROC    127
  548.  
  549. #define RXSUBCOM_BADENTRY 1001
  550. #define RXSUBCOM_NOEMEM   1002
  551. #define RXSUBCOM_BADTYPE  1003
  552. #define RXSUBCOM_NOTINIT  1004
  553.  
  554. /* I don't know the 'real' values of these */
  555. #define RXSUBCOM_ERROR      0x01
  556. #define RXSUBCOM_ISREG      0x01
  557. #define RXSUBCOM_FAILURE    0x02
  558.  
  559. #define RXSUBCOM_DROPPABLE  0x00
  560. #define RXSUBCOM_NONDROP    0x01
  561.  
  562. #endif /* INCL_RXSUBCOM */
  563.  
  564.  
  565. /*
  566.  * -------------------------------------------------------------------
  567.  * External Function Interface
  568.  *-------------------------------------------------------------------
  569.  */
  570. #ifdef INCL_RXFUNC
  571.  
  572. #define RXFUNC_OK             0
  573. #define RXFUNC_DEFINED       10
  574. #define RXFUNC_NOMEM         20
  575. #define RXFUNC_NOTREG        30
  576. #define RXFUNC_MODNOTFND     40
  577. #define RXFUNC_ENTNOTFND     50
  578. #define RXFUNC_NOTINIT       60
  579. #define RXFUNC_BADTYPE       70
  580. #define RXFUNC_NOEMEM      1002
  581.  
  582. typedef APIRET APIENTRY RexxFunctionHandler(PCSZ name, ULONG argc, /* CONST */ PRXSTRING argv, PCSZ queuename, PRXSTRING returnstring) ;
  583.  
  584. APIRET APIENTRY RexxRegisterFunctionExe(
  585.                 PCSZ                 name,
  586. #ifdef RX_STRONGTYPING
  587.                 RexxFunctionHandler *EntryPoint )
  588. #else
  589.                 PFN                  EntryPoint )
  590. #endif
  591. EXTNAME("RexxRegisterFunctionExe");
  592. #define REXXREGISTERFUNCTIONEXE RexxRegisterFunctionExe
  593.  
  594. APIRET APIENTRY RexxRegisterFunctionDll(
  595.                 PCSZ ExternalName,
  596.                 PCSZ LibraryName,
  597.                 PCSZ InternalName )
  598. EXTNAME("RexxRegisterFunctionDll");
  599. #define REXXREGISTERFUNCTIONDLL RexxRegisterFunctionDll
  600.  
  601. APIRET APIENTRY RexxDeregisterFunction(
  602.                 PCSZ name )
  603. EXTNAME("RexxDeregisterFunction");
  604. #define REXXDEREGISTERFUNCTION RexxDeregisterFunction
  605.  
  606. APIRET APIENTRY RexxQueryFunction(
  607.                 PCSZ name )
  608. EXTNAME("RexxQueryFunction");
  609. #define REXXQUERYFUNCTION RexxQueryFunction
  610.  
  611. #endif /* INCL_RXFUNC */
  612.  
  613. /*
  614.  * -------------------------------------------------------------------
  615.  * Asynchronous Request Interface
  616.  *-------------------------------------------------------------------
  617.  */
  618. #ifdef INCL_RXARI
  619.  
  620. /***    Return Codes from Asynchronous Request interface */
  621.  
  622. #define RXARI_OK                   0
  623. #define RXARI_NOT_FOUND            1
  624. #define RXARI_PROCESSING_ERROR     2
  625.  
  626. APIRET APIENTRY RexxSetHalt(
  627.                 LONG pid,
  628.                 LONG tid)
  629. EXTNAME("RexxSetHalt");
  630. #define REXXSETHALT RexxSetHalt
  631.  
  632. #endif /* INCL_RXARI */
  633.  
  634. /*
  635.  * -------------------------------------------------------------------
  636.  * External Queue Interface
  637.  *-------------------------------------------------------------------
  638.  */
  639. #ifdef INCL_RXQUEUE
  640.  
  641. ULONG  APIENTRY RexxCreateQueue (
  642.                 PSZ,
  643.                 ULONG,
  644.                 PSZ,
  645.                 ULONG* )
  646. EXTNAME("RexxCreateQueue");
  647. #define REXXCREATEQUEUE RexxCreateQueue
  648.  
  649. ULONG  APIENTRY RexxDeleteQueue (
  650.                 PSZ )
  651. EXTNAME("RexxDeleteQueue");
  652. #define REXXDELETEQUEUE RexxDeleteQueue
  653.  
  654. ULONG  APIENTRY RexxQueryQueue (
  655.                 PSZ,
  656.                 ULONG* )
  657. EXTNAME("RexxQueryQueue");
  658. #define REXXQUERYQUEUE RexxQueryQueue
  659.  
  660. ULONG  APIENTRY RexxAddQueue (
  661.                 PSZ,      
  662.                 PRXSTRING,
  663.                 ULONG )
  664. EXTNAME("RexxAddQueue");
  665. #define REXXADDQUEUE RexxAddQueue
  666.  
  667. ULONG  APIENTRY RexxPullQueue (
  668.                 PSZ,
  669.                 PRXSTRING,
  670.                 PDATETIME,
  671.                 ULONG )
  672. EXTNAME("RexxPullQueue");
  673. #define REXXPULLQUEUE RexxPullQueue
  674.  
  675. /* Request flags for External Data Queue access --------------------- */
  676. #define RXQUEUE_FIFO          0    /* Access queue first-in-first-out */
  677. #define RXQUEUE_LIFO          1    /* Access queue last-in-first-out  */
  678.  
  679. #define RXQUEUE_NOWAIT        0    /* Wait for data if queue empty    */
  680. #define RXQUEUE_WAIT          1    /* Don't wait on an empty queue    */
  681.  
  682. /* Return Codes from RxQueue interface ------------------------------ */
  683. #define RXQUEUE_OK            0        /* Successful return           */
  684. #define RXQUEUE_NOTINIT       1000     /* Queues not initialized      */
  685.  
  686. #define RXQUEUE_STORAGE       1        /* Ret info buf not big enough */
  687. #define RXQUEUE_SIZE          2        /* Data size > 64K-64          */
  688. #define RXQUEUE_DUP           3        /* Attempt-duplicate queue name*/
  689. #define RXQUEUE_NOEMEM        4        /* Not enough available memory */
  690. #define RXQUEUE_BADQNAME      5        /* Not a valid queue name      */
  691. #define RXQUEUE_PRIORITY      6        /* Not accessed as LIFO|FIFO   */
  692. #define RXQUEUE_BADWAITFLAG   7        /* Not accessed as WAIT|NOWAIT */
  693. #define RXQUEUE_EMPTY         8        /* No data in queue            */
  694. #define RXQUEUE_NOTREG        9        /* Queue does not exist        */
  695. #define RXQUEUE_ACCESS       10        /* Queue busy and wait active  */
  696. #define RXQUEUE_MAXREG       11        /* No memory to create a queue */
  697. #define RXQUEUE_MEMFAIL      12        /* Failure in memory management*/
  698.   
  699. #endif /* INCL_RXQUEUE */
  700.  
  701. /*
  702.  * -------------------------------------------------------------------
  703.  * Macrospace Interface
  704.  *-------------------------------------------------------------------
  705.  */
  706. #ifdef INCL_RXMACRO
  707.  
  708. APIRET APIENTRY RexxAddMacro (
  709.                 PSZ,                         /* Function to add or change    */
  710.                 PSZ,                         /* Name of file to get function */
  711.                 ULONG  )                     /* Flag indicating search pos   */
  712. EXTNAME("RexxAddMacro");
  713. #define REXXADDMACRO  RexxAddMacro
  714.  
  715. APIRET APIENTRY RexxDropMacro (
  716.                 PSZ )                         /* Name of function to remove  */
  717. EXTNAME("RexxDropMacro");
  718. #define REXXDROPMACRO  RexxDropMacro
  719.  
  720. APIRET APIENTRY RexxSaveMacroSpace (
  721.                 ULONG ,                      /* Argument count (0==save all) */
  722.                 PSZ *,                       /* List of funct names to save  */
  723.                 PSZ)                         /* File to save functions in    */
  724. EXTNAME("RexxSaveMacroSpace");
  725. #define REXXSAVEMACROSPACE  RexxSaveMacroSpace
  726.  
  727. APIRET APIENTRY RexxLoadMacroSpace (
  728.                 ULONG ,                      /* Argument count (0==load all) */
  729.                 PSZ *,                       /* List of funct names to load  */
  730.                 PSZ)                        /* File to load functions from  */
  731. EXTNAME("RexxLoadMacroSpace");
  732. #define REXXLOADMACROSPACE  RexxLoadMacroSpace
  733.  
  734. APIRET APIENTRY RexxQueryMacro (
  735.                 PSZ,                         /* Function to search for       */
  736.                 PUSHORT )                   /* Ptr for position flag return */
  737. EXTNAME("RexxQueryMacro");
  738. #define REXXQUERYMACRO  RexxQueryMacro
  739.  
  740. APIRET APIENTRY RexxReorderMacro(
  741.                 PSZ,                         /* Name of funct change order   */
  742.                 ULONG  )                    /* New position for function    */
  743. EXTNAME("RexxReorderMacro");
  744. #define REXXREORDERMACRO  RexxReorderMacro
  745.  
  746. APIRET APIENTRY RexxClearMacroSpace(
  747.                 VOID )
  748. EXTNAME("RexxClearMacroSpace");
  749. #define REXXCLEARMACROSPACE  RexxClearMacroSpace
  750.  
  751. /* Registration Search Order Flags ---------------------------------- */
  752. #define RXMACRO_SEARCH_BEFORE       1  /* Beginning of search order   */
  753. #define RXMACRO_SEARCH_AFTER        2  /* End of search order         */
  754.  
  755. /* Return Codes from RxMacroSpace interface ------------------------- */
  756. #define RXMACRO_OK                 0  /* Macro interface completed    */
  757. #define RXMACRO_NO_STORAGE         1  /* Not Enough Storage Available */
  758. #define RXMACRO_NOT_FOUND          2  /* Requested function not found */
  759. #define RXMACRO_EXTENSION_REQUIRED 3  /* File ext required for save   */
  760. #define RXMACRO_ALREADY_EXISTS     4  /* Macro functions exist        */
  761. #define RXMACRO_FILE_ERROR         5  /* File I/O error in save/load  */
  762. #define RXMACRO_SIGNATURE_ERROR    6  /* Incorrect format for load    */
  763. #define RXMACRO_SOURCE_NOT_FOUND   7  /* Requested cannot be found    */
  764. #define RXMACRO_INVALID_POSITION   8  /* Invalid search order pos     */
  765. #define RXMACRO_NOT_INIT           9  /* API not initialized          */
  766.  
  767. #endif /* INCL_RXMACRO */
  768.  
  769.  
  770. /* REGINA EXTENSIONS *********************************************************/
  771. /* The following function is an extension to the standard. Never try to
  772.  * address the function directly. Use the dynamic linking machanism of
  773.  * your operating system instead. This function was introduced in version
  774.  * 2.0.
  775.  * Returns: ULONG, in lower byte the two-digit fraction part of the version.
  776.  *          The higher bytes will hold the integer part of the version.
  777.  *          Examples: 0x10A codes the Version "1.10".
  778.  * VersionString will be filled if VersionString is non-NULL.
  779.  * If VersionString is non-NULL then there are two possibilities:
  780.  * a) VersionString->strlength == 0: VersionString is filled with the
  781.  *                                   appropriate values. VersionString->strptr
  782.  *                                   is always created.
  783.  * b) VersionString->strlength != 0: VersionString->strptr is filled up to
  784.  *                                   this value. VersionString->strlength will
  785.  *                                   hold the copied bytes.
  786.  * Note: A terminating ASCII-zero is appended if there is enough space
  787.  *       although it is never counted in VersionString.strlength.
  788.  *       RexxAllocateMemory is used if needed.
  789.  */
  790. APIRET APIENTRY ReginaVersion( 
  791.                 PRXSTRING VersionString )
  792. EXTNAME("ReginaVersion");
  793. #define REGINAVERSION ReginaVersion
  794.  
  795. #ifdef __cplusplus
  796. }
  797. #endif
  798.  
  799. #endif /* __REXXSAA_H_INCLUDED */
  800.