bringing SDL 1.2.14 from vendor into the main branch
[AROS-Contrib.git] / regina / rexxsaa.h
blobd08ea914cc1082b7328fbb1a34bcf930c5cb940d
1 /*
2 * The Regina Rexx Interpreter
3 * Copyright (C) 1993-1994 Anders Christensen <anders@pvv.unit.no>
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.
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.
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.
20 * $Id$
23 #ifndef __REXXSAA_H_INCLUDED
24 #define __REXXSAA_H_INCLUDED
25 /* Remember to add prototypes for Rexx*() functions */
27 #if defined(WIN32) && (defined(__WATCOMC__) || defined(__BORLANDC__))
28 # include <windows.h>
29 #endif
31 #if defined(__RSXNT__) || defined(__MINGW32__)
32 # include <windows.h>
33 #endif
35 #if defined(_MSC_VER) && !defined(__WINS__)
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
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
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.
57 # define CONST const
58 #endif
60 #if defined(__MINGW32__)
61 typedef CONST char *PCSZ ;
62 #endif
64 #if defined(__MINGW32__) && defined(__REGINA_DLL)
65 #define EXTNAME(n) __attribute__((alias (n)))
66 #else
67 #define EXTNAME(n)
68 #endif
70 #if !defined(_OS2EMX_H) && !defined(__RSXNT__) && !defined(__MINGW32__) && !defined(__AROS__) && !defined(_AMIGA)
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 ;
81 typedef CHAR *PCHAR ;
82 typedef SHORT *PSHORT ;
83 typedef LONG *PLONG ;
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
98 typedef USHORT *PUSHORT ;
99 typedef CHAR *PCH ;
100 typedef UCHAR *PUCHAR ;
102 #elif defined(__AROS__) || defined(_AMIGA)
103 /* For AROS make SAA functions also internal
106 # include <exec/types.h>
107 typedef BYTE CHAR ;
108 typedef WORD SHORT ;
109 typedef char *PSZ ;
110 typedef CONST char *PCSZ ;
111 # ifndef VOID
112 typedef void VOID ;
113 # endif
114 typedef APTR PVOID;
116 typedef CHAR *PCHAR ;
117 typedef SHORT *PSHORT ;
118 typedef LONG *PLONG ;
120 # ifndef UCHAR_TYPEDEFED
121 typedef UBYTE UCHAR ;
122 # define UCHAR_TYPEDEFED
123 # endif
124 # ifndef USHORT_TYPEDEFED
125 typedef UWORD USHORT ;
126 # define USHORT_TYPEDEFED
127 # endif
128 # ifndef ULONG_TYPEDEFED
129 # define ULONG_TYPEDEFED
130 # endif
132 typedef USHORT *PUSHORT ;
133 typedef CHAR *PCH ;
134 typedef UCHAR *PUCHAR ;
135 #endif
137 #ifdef INCL_REXXSAA
138 # define INCL_RXSUBCOM
139 # define INCL_RXSHV
140 # define INCL_RXFUNC
141 # define INCL_RXSYSEXIT
142 # define INCL_RXMACRO
143 # define INCL_RXARI
144 # define INCL_RXQUEUE
145 # define INCL_RXMACRO
146 #endif
148 #if !defined(APIENTRY)
149 # define APIENTRY
150 #endif
152 #if !defined(APIRET)
153 # define APIRET ULONG
154 #endif
156 #if !defined(_OS2EMX_H) && !defined(PFN_DEFINED)
157 typedef APIRET (APIENTRY *PFN)();
158 #define PFN_DEFINED
159 #endif
162 typedef struct RXSTRING_type
164 ULONG strlength ;
165 char* strptr ;
166 } RXSTRING ;
167 typedef RXSTRING *PRXSTRING ;
169 #if !defined(_OS2EMX_H)
170 typedef struct REXXDATETIME_type
172 USHORT hours; /* hour of the day (24-hour) */
173 USHORT minutes; /* minute of the hour */
174 USHORT seconds; /* second of the minute */
175 USHORT hundredths; /* hundredths of a second */
176 USHORT day; /* day of the month */
177 USHORT month; /* month of the year */
178 USHORT year; /* current year */
179 USHORT weekday; /* day of the week */
180 ULONG microseconds; /* microseconds */
181 ULONG yearday; /* day number within the year */
182 USHORT valid; /* valid time stamp marker */
183 } REXXDATETIME;
184 #define DATETIME REXXDATETIME
185 typedef REXXDATETIME *PDATETIME;
186 #endif
188 #define RXAUTOBUFLEN 256L
190 typedef struct {
191 char *sysexit_name ;
192 LONG sysexit_code ;
193 } RXSYSEXIT ;
194 typedef RXSYSEXIT *PRXSYSEXIT ;
197 * -------------------------------------------------------------------
198 * System Exit Interface
199 *-------------------------------------------------------------------
201 #ifdef INCL_RXSYSEXIT
204 * The following are definition for the function codes and subcodes for
205 * System Exit Handlers. All RXxxx macros are function codes, while the
206 * RXxxxyyy macros are function subcodes for function code RXxxx.
208 #define RXFNC 2
209 # define RXFNCCAL 1
211 #define RXCMD 3
212 # define RXCMDHST 1
214 #define RXMSQ 4 /* Net yet implemented */
215 # define RXMSQPLL 1 /* Net yet implemented */
216 # define RXMSQPSH 2 /* Net yet implemented */
217 # define RXMSQSIZ 3 /* Net yet implemented */
218 # define RXMSQNAM 20 /* Net yet implemented */
220 #define RXSIO 5
221 # define RXSIOSAY 1
222 # define RXSIOTRC 2
223 # define RXSIOTRD 3
224 # define RXSIODTR 4
225 # define RXSIOTLL 5 /* Net yet implemented */
227 #define RXHLT 7
228 # define RXHLTCLR 1
229 # define RXHLTTST 2
231 #define RXTRC 8
232 # define RXTRCTST 1
234 #define RXINI 9
235 # define RXINIEXT 1
237 #define RXTER 10
238 # define RXTEREXT 1
240 #define RXDBG 11
241 # define RXDBGTST 1
243 #define RXENV 12 /* System Environment interface */
244 # define RXENVGET 1 /* Get System Environment Variable */
245 # define RXENVSET 2 /* Set System Environment Variable */
247 #define RXENDLST 0
248 #define RXNOOFEXITS 12
250 /* Symbolic return codes for System Exit Handlers */
251 #define RXEXIT_HANDLED 0
252 #define RXEXIT_NOT_HANDLED 1
253 #define RXEXIT_RAISE_ERROR (-1)
255 #define RXEXIT_DROPPABLE 0x00
256 #define RXEXIT_NONDROP 0x01
258 /* Return Codes from RXEXIT interface */
260 #define RXEXIT_ISREG 0x01
261 #define RXEXIT_ERROR 0x01
262 #define RXEXIT_FAILURE 0x02
263 #define RXEXIT_BADENTRY 1001
264 #define RXEXIT_NOEMEM 1002
265 #define RXEXIT_BADTYPE 1003
266 #define RXEXIT_NOTINIT 1004
267 #define RXEXIT_OK 0
268 #define RXEXIT_DUP 10
269 #define RXEXIT_MAXREG 20
270 #define RXEXIT_NOTREG 30
271 #define RXEXIT_NOCANDROP 40
272 #define RXEXIT_LOADERR 50
273 #define RXEXIT_NOPROC 127
275 typedef struct {
276 struct {
277 unsigned rxfferr:1 ;
278 unsigned rxffnfnd:1 ;
279 unsigned rxffsub:1 ;
280 } rxfnc_flags ;
281 /* CONST */ PUCHAR rxfnc_name ;
282 USHORT rxfnc_namel ;
283 /* CONST */ PUCHAR rxfnc_que ;
284 USHORT rxfnc_quel ;
285 USHORT rxfnc_argc ;
286 /* CONST */ PRXSTRING rxfnc_argv ;
287 RXSTRING rxfnc_retc ;
288 } RXFNCCAL_PARM ;
290 typedef struct {
291 struct {
292 unsigned rxfcfail:1 ;
293 unsigned rxfcerr:1 ;
294 } rxcmd_flags ;
295 /* CONST */ PUCHAR rxcmd_address ;
296 USHORT rxcmd_addressl ;
297 /* CONST */ PUCHAR rxcmd_dll ;
298 USHORT rxcmd_dll_len ;
299 /* CONST */ RXSTRING rxcmd_command ;
300 RXSTRING rxcmd_retc ;
301 } RXCMDHST_PARM ;
303 typedef struct {
304 RXSTRING rxmsq_retc ;
305 } RXMSQPLL_PARM ;
307 typedef struct {
308 struct {
309 unsigned rcfmlifo:1 ;
310 } rcmsq_flags ;
311 /* CONST */ RXSTRING rxmsq_value ;
312 } RXMSQPSH_PARM ;
314 typedef struct {
315 ULONG rxmsq_size ;
316 } RXMSQSIZ_PARM ;
318 typedef struct {
319 RXSTRING rxmsq_name ;
320 } RXMSQNAM_PARM ;
322 typedef struct {
323 /* CONST */ RXSTRING rxsio_string ;
324 } RXSIOSAY_PARM ;
326 typedef struct {
327 /* CONST */ RXSTRING rxsio_string ;
328 } RXSIOTRC_PARM ;
330 typedef struct {
331 RXSTRING rxsiotrd_retc ;
332 } RXSIOTRD_PARM ;
334 typedef struct {
335 RXSTRING rxsiodtr_retc ;
336 } RXSIODTR_PARM ;
338 typedef struct {
339 struct {
340 unsigned rxfhhalt:1 ;
341 } rxhlt_flags ;
342 } RXHLTTST_PARM ;
344 typedef struct {
345 struct {
346 unsigned rxftrace:1 ;
347 } rxtrx_flags ;
348 } RXTRCTST_PARM ;
350 typedef struct {
351 RXSTRING rxenv_name ;
352 RXSTRING rxenv_value ;
353 } RXENVGET_PARM ;
355 typedef struct {
356 RXSTRING rxenv_name ;
357 RXSTRING rxenv_value ;
358 } RXENVSET_PARM ;
361 #define rxfnc_flags rxfnccal.u_rxfnc_flags
362 #define rxfnc_name rxfnccal.u_rxfnc_name
363 #define rxfnc_namel rxfnccal.u_rxfnc_namel
364 #define rxfnc_que rxfnccal.u_rxfnc_que
365 #define rxfnc_quel rxfnccal.u_rxfnc_quel
366 #define rxfnc_argc rxfnccal.u_rxfnc_argc
367 #define rxfnc_argv rxfnccal.u_rxfnc_argv
368 #define rxfnc_retc rxfnccal.u_rxfnc_retc
369 #define rxcmd_flags rxcmdhst.u_rxcmd_flags
370 #define rxcmd_address rxcmdhst.u_rxcmd_address
371 #define rxcmd_addressl rxcmdhst.u_rxcmd_addressl
372 #define rxcmd_dll rxcmdhst.u_rxcmd_dll
373 #define rxcmd_dll_len rxcmdhst.u_rxcmd_dll_len
374 #define rxcmd_command rxcmdhst.u_rxcmd_command
375 #define rxcmd_retc rxcmdhst.u_rxcmd_retc
376 #define rxmsq_retc rxmsqpll.u_rxmsq_retc
377 #define rxsio_string rxsiosay.u_rxsio_string
378 #define rxsiotrd_retc rxsiotrd.u_rxsiotrd_retc
379 #define rxsiodtr_retc rxsiodtr.u_rxsiodtr_retc
380 #define rxhlt_flags rxhlttst.u_rxhlt_flags
381 #define rxtrc_flags rxtrctst.u_rxtrc_flags
384 typedef union {
385 RXFNCCAL_PARM fnccal ;
386 RXCMDHST_PARM cmdhst ;
387 RXMSQPLL_PARM msqpll ;
388 RXMSQPSH_PARM msqpsh ;
389 RXMSQSIZ_PARM msqsiz ;
390 RXMSQNAM_PARM msqnam ;
391 RXSIOSAY_PARM siosay ;
392 RXSIOTRC_PARM siotrc ;
393 RXSIOTRD_PARM siotrd ;
394 RXSIODTR_PARM siodtr ;
395 RXHLTTST_PARM hlttst ;
396 RXTRCTST_PARM trctst ;
397 RXENVGET_PARM envget ;
398 RXENVSET_PARM envset ;
399 } EXIT ;
401 typedef PUCHAR PEXIT ;
403 typedef LONG APIENTRY RexxExitHandler( LONG, LONG, /* CONST */ PEXIT ) ;
405 APIRET APIENTRY RexxRegisterExitExe(
406 PCSZ EnvName,
407 #ifdef RX_STRONGTYPING
408 RexxExitHandler *EntryPoint,
409 #else
410 PFN EntryPoint,
411 #endif
412 /* CONST */ PUCHAR UserArea )
413 EXTNAME("RexxRegisterExitExe");
414 #define REXXREGISTEREXITEXE RexxRegisterExitExe
416 APIRET APIENTRY RexxRegisterExitDll(
417 PCSZ EnvName,
418 PCSZ ModuleName,
419 PCSZ ProcedureName,
420 /* CONST */ PUCHAR UserArea,
421 ULONG DropAuth )
422 EXTNAME("RexxRegisterExitDll");
423 #define REXXREGISTEREXITDLL RexxRegisterExitDll
425 APIRET APIENTRY RexxDeregisterExit(
426 PCSZ EnvName,
427 PCSZ ModuleName )
428 EXTNAME("RexxDeregisterExit");
429 #define REXXDEREGISTEREXIT RexxDeregisterExit
431 APIRET APIENTRY RexxQueryExit (
432 PCSZ ExitName,
433 PCSZ ModuleName,
434 PUSHORT Flag,
435 PUCHAR UserArea)
436 EXTNAME("RexxQueryExit");
437 #define REXXQUERYEXIT RexxQueryExit
439 #endif /* INCL_RXSYSEXIT */
443 #define MAXENVNAMELEN 31
445 #define MAKERXSTRING(x,c,l) ((x).strptr=(c),(x).strlength=(l))
446 #define RXNULLSTRING(x) (!(x).strptr)
447 #define RXSTRLEN(x) ((x).strptr ? (x).strlength : 0UL)
448 #define RXSTRPTR(x) ((x).strptr)
449 #define RXVALIDSTRING(x) ((x).strptr && (x).strlength)
450 #define RXZEROLENSTRING(x) ((x).strptr && !(x).strlength)
452 #define RXCOMMAND 0
453 #define RXSUBROUTINE 1
454 #define RXFUNCTION 2
456 * RXRESTRICTED is OR'ed with one of the above values to run Regina
457 * in "restricted" mode
459 #define RXRESTRICTED 256
462 #ifdef INCL_RXSHV
465 * Definitions and declarations for the Rexx variable pool interface.
468 # define RXSHV_OK 0x00 /* Everything OK */
469 # define RXSHV_NEWV 0x01 /* Var not previously set */
470 # define RXSHV_LVAR 0x02 /* Last var in a NEXTV sequence */
471 # define RXSHV_TRUNC 0x04 /* Name or value has been truncated */
472 # define RXSHV_BADN 0x08 /* Bad/invalid name */
473 # define RXSHV_MEMFL 0x10 /* Memory problem, e.g. out of memory */
474 # define RXSHV_BADF 0x80 /* Invalid function code */
476 # define RXSHV_NOAVL 0x90 /* Interface is not available */
479 * Note: Some documentation claims that RXSHV_BADF should have the
480 * value 0x80, but that can't be correct, can it?
483 # define RXSHV_SET 0x00 /* Set variable */
484 # define RXSHV_FETCH 0x01 /* Get value of variable */
485 # define RXSHV_DROPV 0x02 /* Drop variable */
486 # define RXSHV_SYSET 0x03 /* Set symbolic variable */
487 # define RXSHV_SYFET 0x04 /* Get value of symbolic variable */
488 # define RXSHV_SYDRO 0x05 /* Drop symbolic variable */
489 # define RXSHV_NEXTV 0x06 /* Get next var in a NEXTV sequence */
490 # define RXSHV_PRIV 0x07 /* Get private information */
491 # define RXSHV_EXIT 0x08 /* Set function exit value */
494 * Note: A symbolic variable is a symbol that will be 'expanded' before
495 * use, while a (normal) variable is used directly, without
496 * expanding it first.
499 typedef struct shvnode
501 struct shvnode *shvnext ;
502 RXSTRING shvname ;
503 RXSTRING shvvalue ;
504 ULONG shvnamelen ;
505 ULONG shvvaluelen ;
506 UCHAR shvcode ;
507 UCHAR shvret ;
508 } SHVBLOCK ;
510 typedef SHVBLOCK *PSHVBLOCK ;
512 APIRET APIENTRY RexxVariablePool(
513 PSHVBLOCK RequestBlockList )
514 EXTNAME("RexxVariablePool");
515 #define REXXVARIABLEPOOL RexxVariablePool
517 #endif /* INCL_RXSHV */
520 APIRET APIENTRY RexxFreeMemory(
521 PVOID MemoryBlock )
522 EXTNAME("RexxFreeMemory");
523 #define REXXFREEMEMORY RexxFreeMemory
525 PVOID APIENTRY RexxAllocateMemory(
526 ULONG size )
527 EXTNAME("RexxAllocateMemory");
528 #define REXXALLOCATEMEMORY RexxAllocateMemory
531 APIRET APIENTRY RexxStart(
532 LONG ArgCount,
533 /* CONST */ PRXSTRING ArgList,
534 PCSZ ProgramName,
535 /* CONST */ PRXSTRING Instore,
536 PCSZ EnvName,
537 LONG CallType,
538 /* CONST */ PRXSYSEXIT Exits,
539 PSHORT ReturnCode,
540 PRXSTRING Result )
541 EXTNAME("RexxStart");
542 #define REXXSTART RexxStart
545 * Return codes .... haha there doesn't seem to be a standard, except
546 * zero is OK, negative is an Rexx error, the positive error codes below
547 * are my own 'invention'
549 #define RX_START_OK 0
550 #define RX_START_BADP 1 /* Bad parameters */
551 #define RX_START_UNIMPL 2 /* Not yet implemented :-) */
552 #define RX_START_TOOMANYP 3 /* To many parameters */
553 #define RX_DIDNT_START 4 /* Unable to start interpreter */
556 * -------------------------------------------------------------------
557 * Sub-command Interface
558 *-------------------------------------------------------------------
560 #ifdef INCL_RXSUBCOM
562 typedef APIRET APIENTRY RexxSubcomHandler(/* CONST */ PRXSTRING, PUSHORT, PRXSTRING);
564 APIRET APIENTRY RexxRegisterSubcomExe(
565 PCSZ EnvName,
566 #ifdef RX_STRONGTYPING
567 RexxSubcomHandler *EntryPoint,
568 #else
569 PFN EntryPoint,
570 #endif
571 /* CONST */ PUCHAR UserArea )
572 EXTNAME("RexxRegisterSubcomExe");
573 #define REXXREGISTERSUBCOMEXE RexxRegisterSubcomExe
575 APIRET APIENTRY RexxDeregisterSubcom(
576 PCSZ EnvName,
577 PCSZ ModuleName )
578 EXTNAME("RexxDeregisterSubcom");
579 #define REXXDEREGISTERSUBCOM RexxDeregisterSubcom
581 APIRET APIENTRY RexxRegisterSubcomDll(
582 PCSZ EnvName,
583 PCSZ ModuleName,
584 PCSZ ProcedureName,
585 /* CONST */ PUCHAR UserArea,
586 ULONG DropAuth )
587 EXTNAME("RexxRegisterSubcomDll");
588 #define REXXREGISTERSUBCOMDLL RexxRegisterSubcomDll
590 APIRET APIENTRY RexxQuerySubcom(
591 PCSZ Envname,
592 PCSZ ModuleName,
593 PUSHORT Flag, /* Documentation diverges ... */
594 PUCHAR UserArea )
595 EXTNAME("RexxQuerySubcom");
596 #define REXXQUERYSUBCOM RexxQuerySubcom
598 #define RXSUBCOM_OK 0
599 #define RXSUBCOM_DUP 10
600 #define RXSUBCOM_MAXREG 20
601 #define RXSUBCOM_NOTREG 30
602 #define RXSUBCOM_NOCANDROP 40
603 #define RXSUBCOM_LOADERR 50
604 #define RXSUBCOM_NOPROC 127
606 #define RXSUBCOM_BADENTRY 1001
607 #define RXSUBCOM_NOEMEM 1002
608 #define RXSUBCOM_BADTYPE 1003
609 #define RXSUBCOM_NOTINIT 1004
611 /* I don't know the 'real' values of these */
612 #define RXSUBCOM_ERROR 0x01
613 #define RXSUBCOM_ISREG 0x01
614 #define RXSUBCOM_FAILURE 0x02
616 #define RXSUBCOM_DROPPABLE 0x00
617 #define RXSUBCOM_NONDROP 0x01
619 #endif /* INCL_RXSUBCOM */
623 * -------------------------------------------------------------------
624 * External Function Interface
625 *-------------------------------------------------------------------
627 #ifdef INCL_RXFUNC
629 #define RXFUNC_OK 0
630 #define RXFUNC_DEFINED 10
631 #define RXFUNC_NOMEM 20
632 #define RXFUNC_NOTREG 30
633 #define RXFUNC_MODNOTFND 40
634 #define RXFUNC_ENTNOTFND 50
635 #define RXFUNC_NOTINIT 60
636 #define RXFUNC_BADTYPE 70
637 #define RXFUNC_NOEMEM 1002
639 typedef APIRET APIENTRY RexxFunctionHandler(PCSZ name, ULONG argc, /* CONST */ PRXSTRING argv, PCSZ queuename, PRXSTRING returnstring) ;
641 APIRET APIENTRY RexxRegisterFunctionExe(
642 PCSZ name,
643 #ifdef RX_STRONGTYPING
644 RexxFunctionHandler *EntryPoint )
645 #else
646 PFN EntryPoint )
647 #endif
648 EXTNAME("RexxRegisterFunctionExe");
649 #define REXXREGISTERFUNCTIONEXE RexxRegisterFunctionExe
651 APIRET APIENTRY RexxRegisterFunctionDll(
652 PCSZ ExternalName,
653 PCSZ LibraryName,
654 PCSZ InternalName )
655 EXTNAME("RexxRegisterFunctionDll");
656 #define REXXREGISTERFUNCTIONDLL RexxRegisterFunctionDll
658 APIRET APIENTRY RexxDeregisterFunction(
659 PCSZ name )
660 EXTNAME("RexxDeregisterFunction");
661 #define REXXDEREGISTERFUNCTION RexxDeregisterFunction
663 APIRET APIENTRY RexxQueryFunction(
664 PCSZ name )
665 EXTNAME("RexxQueryFunction");
666 #define REXXQUERYFUNCTION RexxQueryFunction
668 #endif /* INCL_RXFUNC */
671 * -------------------------------------------------------------------
672 * Asynchronous Request Interface
673 *-------------------------------------------------------------------
675 #ifdef INCL_RXARI
677 /*** Return Codes from Asynchronous Request interface */
679 #define RXARI_OK 0
680 #define RXARI_NOT_FOUND 1
681 #define RXARI_PROCESSING_ERROR 2
683 APIRET APIENTRY RexxSetHalt(
684 LONG pid,
685 LONG tid)
686 EXTNAME("RexxSetHalt");
687 #define REXXSETHALT RexxSetHalt
689 #endif /* INCL_RXARI */
692 * -------------------------------------------------------------------
693 * External Queue Interface
694 *-------------------------------------------------------------------
696 #ifdef INCL_RXQUEUE
698 ULONG APIENTRY RexxCreateQueue (
699 PSZ,
700 ULONG,
701 PSZ,
702 ULONG* )
703 EXTNAME("RexxCreateQueue");
704 #define REXXCREATEQUEUE RexxCreateQueue
706 ULONG APIENTRY RexxDeleteQueue (
707 PSZ )
708 EXTNAME("RexxDeleteQueue");
709 #define REXXDELETEQUEUE RexxDeleteQueue
711 ULONG APIENTRY RexxQueryQueue (
712 PSZ,
713 ULONG* )
714 EXTNAME("RexxQueryQueue");
715 #define REXXQUERYQUEUE RexxQueryQueue
717 ULONG APIENTRY RexxAddQueue (
718 PSZ,
719 PRXSTRING,
720 ULONG )
721 EXTNAME("RexxAddQueue");
722 #define REXXADDQUEUE RexxAddQueue
724 ULONG APIENTRY RexxPullQueue (
725 PSZ,
726 PRXSTRING,
727 PDATETIME,
728 ULONG )
729 EXTNAME("RexxPullQueue");
730 #define REXXPULLQUEUE RexxPullQueue
732 /* Request flags for External Data Queue access --------------------- */
733 #define RXQUEUE_FIFO 0 /* Access queue first-in-first-out */
734 #define RXQUEUE_LIFO 1 /* Access queue last-in-first-out */
736 #define RXQUEUE_NOWAIT 0 /* Wait for data if queue empty */
737 #define RXQUEUE_WAIT 1 /* Don't wait on an empty queue */
739 /* Return Codes from RxQueue interface ------------------------------ */
740 #define RXQUEUE_OK 0 /* Successful return */
741 #define RXQUEUE_NOTINIT 1000 /* Queues not initialized */
743 #define RXQUEUE_STORAGE 1 /* Ret info buf not big enough */
744 #define RXQUEUE_SIZE 2 /* Data size > 64K-64 */
745 #define RXQUEUE_DUP 3 /* Attempt-duplicate queue name*/
746 #define RXQUEUE_NOEMEM 4 /* Not enough available memory */
747 #define RXQUEUE_BADQNAME 5 /* Not a valid queue name */
748 #define RXQUEUE_PRIORITY 6 /* Not accessed as LIFO|FIFO */
749 #define RXQUEUE_BADWAITFLAG 7 /* Not accessed as WAIT|NOWAIT */
750 #define RXQUEUE_EMPTY 8 /* No data in queue */
751 #define RXQUEUE_NOTREG 9 /* Queue does not exist */
752 #define RXQUEUE_ACCESS 10 /* Queue busy and wait active */
753 #define RXQUEUE_MAXREG 11 /* No memory to create a queue */
754 #define RXQUEUE_MEMFAIL 12 /* Failure in memory management*/
756 #endif /* INCL_RXQUEUE */
759 * -------------------------------------------------------------------
760 * Macrospace Interface
761 *-------------------------------------------------------------------
763 #ifdef INCL_RXMACRO
765 APIRET APIENTRY RexxAddMacro (
766 PSZ, /* Function to add or change */
767 PSZ, /* Name of file to get function */
768 ULONG ) /* Flag indicating search pos */
769 EXTNAME("RexxAddMacro");
770 #define REXXADDMACRO RexxAddMacro
772 APIRET APIENTRY RexxDropMacro (
773 PSZ ) /* Name of function to remove */
774 EXTNAME("RexxDropMacro");
775 #define REXXDROPMACRO RexxDropMacro
777 APIRET APIENTRY RexxSaveMacroSpace (
778 ULONG , /* Argument count (0==save all) */
779 PSZ *, /* List of funct names to save */
780 PSZ) /* File to save functions in */
781 EXTNAME("RexxSaveMacroSpace");
782 #define REXXSAVEMACROSPACE RexxSaveMacroSpace
784 APIRET APIENTRY RexxLoadMacroSpace (
785 ULONG , /* Argument count (0==load all) */
786 PSZ *, /* List of funct names to load */
787 PSZ) /* File to load functions from */
788 EXTNAME("RexxLoadMacroSpace");
789 #define REXXLOADMACROSPACE RexxLoadMacroSpace
791 APIRET APIENTRY RexxQueryMacro (
792 PSZ, /* Function to search for */
793 PUSHORT ) /* Ptr for position flag return */
794 EXTNAME("RexxQueryMacro");
795 #define REXXQUERYMACRO RexxQueryMacro
797 APIRET APIENTRY RexxReorderMacro(
798 PSZ, /* Name of funct change order */
799 ULONG ) /* New position for function */
800 EXTNAME("RexxReorderMacro");
801 #define REXXREORDERMACRO RexxReorderMacro
803 APIRET APIENTRY RexxClearMacroSpace(
804 VOID )
805 EXTNAME("RexxClearMacroSpace");
806 #define REXXCLEARMACROSPACE RexxClearMacroSpace
808 /* Registration Search Order Flags ---------------------------------- */
809 #define RXMACRO_SEARCH_BEFORE 1 /* Beginning of search order */
810 #define RXMACRO_SEARCH_AFTER 2 /* End of search order */
812 /* Return Codes from RxMacroSpace interface ------------------------- */
813 #define RXMACRO_OK 0 /* Macro interface completed */
814 #define RXMACRO_NO_STORAGE 1 /* Not Enough Storage Available */
815 #define RXMACRO_NOT_FOUND 2 /* Requested function not found */
816 #define RXMACRO_EXTENSION_REQUIRED 3 /* File ext required for save */
817 #define RXMACRO_ALREADY_EXISTS 4 /* Macro functions exist */
818 #define RXMACRO_FILE_ERROR 5 /* File I/O error in save/load */
819 #define RXMACRO_SIGNATURE_ERROR 6 /* Incorrect format for load */
820 #define RXMACRO_SOURCE_NOT_FOUND 7 /* Requested cannot be found */
821 #define RXMACRO_INVALID_POSITION 8 /* Invalid search order pos */
822 #define RXMACRO_NOT_INIT 9 /* API not initialized */
824 #endif /* INCL_RXMACRO */
827 /* REGINA EXTENSIONS *********************************************************/
828 /* The following function is an extension to the standard. Never try to
829 * address the function directly. Use the dynamic linking machanism of
830 * your operating system instead. This function was introduced in version
831 * 2.0.
832 * Returns: ULONG, in lower byte the two-digit fraction part of the version.
833 * The higher bytes will hold the integer part of the version.
834 * Examples: 0x10A codes the Version "1.10".
835 * VersionString will be filled if VersionString is non-NULL.
836 * If VersionString is non-NULL then there are two possibilities:
837 * a) VersionString->strlength == 0: VersionString is filled with the
838 * appropriate values. VersionString->strptr
839 * is always created.
840 * b) VersionString->strlength != 0: VersionString->strptr is filled up to
841 * this value. VersionString->strlength will
842 * hold the copied bytes.
843 * Note: A terminating ASCII-zero is appended if there is enough space
844 * although it is never counted in VersionString.strlength.
845 * RexxAllocateMemory is used if needed.
847 APIRET APIENTRY ReginaVersion(
848 PRXSTRING VersionString )
849 EXTNAME("ReginaVersion");
850 #define REGINAVERSION ReginaVersion
852 #ifdef __cplusplus
854 #endif
856 #endif /* __REXXSAA_H_INCLUDED */