forgotten commit. disabled until egl is adapted.
[AROS-Contrib.git] / regina / rexxsaa.h
blob68c065c4c094fa9e8d0433c840199cba395ad4cb
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.
19 #ifndef __REXXSAA_H_INCLUDED
20 #define __REXXSAA_H_INCLUDED
21 /* Remember to add prototypes for Rexx*() functions */
23 #if defined(WIN32) && (defined(__WATCOMC__) || defined(__BORLANDC__))
24 # include <windows.h>
25 #endif
27 #if defined(__RSXNT__) || defined(__MINGW32__)
28 # include <windows.h>
29 #endif
31 #if defined(_MSC_VER) && !defined(__WINS__)
32 # if _MSC_VER >= 1100
33 /* Stupid MSC can't compile own headers without warning at least in VC 5.0 */
34 # pragma warning(disable: 4115 4201 4214 4514)
35 # endif
36 # include <windows.h>
37 # if _MSC_VER >= 1100
38 # pragma warning(default: 4115 4201 4214)
39 # endif
40 # define VOID_TYPEDEFED
41 #endif
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
48 * pack(1) was introduced in Regina 3.3 to become binary compatible in
49 * structures with OS/2, Object Rexx, etc.
51 #ifdef OREXX_BINARY_COMPATIBLE
52 # pragma pack(1)
53 #endif
55 #ifndef CONST
56 /* Introduced in Regina 2.0, may/should not exist in non-ANSI compilers.
57 * Everybody can see which params will change even if CONST is not defined.
58 * We don't use CONST at all places to be consistent with other
59 * implementations. You can see a "CONST" as a comment before each variable
60 * which is/must not be changed.
62 # define CONST const
63 #endif
65 #if defined(__MINGW32__)
66 # if defined(__REGINA_DLL)
67 # define EXTNAME(n) __declspec(dllexport)
68 # else
69 # define EXTNAME(n) __declspec(dllimport)
70 # endif
71 #else
72 #define EXTNAME(n)
73 #endif
75 #if !defined(OS2_VAC_C) && !defined(_OS2EMX_H) && !defined(__RSXNT__) && !defined(__MINGW32__) && !defined(__AROS__) && !defined(_AMIGA)
77 # if !defined(VOID_TYPEDEFED) && !defined(VOID)
78 typedef void VOID ;
79 # define VOID_TYPEDEFED
80 # endif
82 # ifndef PVOID_TYPEDEFED
83 typedef void* PVOID ;
84 # define PVOID_TYPEDEFED
85 # endif
87 # ifndef CHAR_TYPEDEFED
88 typedef char CHAR;
89 # define CHAR_TYPEDEFED
90 # endif
91 # ifndef PCHAR_TYPEDEFED
92 typedef CHAR *PCHAR ;
93 # define PCHAR_TYPEDEFED
94 # endif
95 # ifndef UCHAR_TYPEDEFED
96 typedef unsigned char UCHAR ;
97 # define UCHAR_TYPEDEFED
98 # endif
99 # ifndef PUCHAR_TYPEDEFED
100 typedef UCHAR *PUCHAR;
101 # define PUCHAR_TYPEDEFED
102 # endif
104 # ifndef SHORT_TYPEDEFED
105 typedef short SHORT;
106 # define SHORT_TYPEDEFED
107 # endif
108 # ifndef PSHORT_TYPEDEFED
109 typedef SHORT *PSHORT ;
110 # define PSHORT_TYPEDEFED
111 # endif
112 # ifndef USHORT_TYPEDEFED
113 typedef unsigned short USHORT ;
114 # define USHORT_TYPEDEFED
115 # endif
116 # ifndef PUSHORT_TYPEDEFED
117 typedef USHORT *PUSHORT;
118 # define PUSHORT_TYPEDEFED
119 # endif
121 # ifndef LONG_TYPEDEFED
122 typedef long LONG;
123 # define LONG_TYPEDEFED
124 # endif
125 # ifndef PLONG_TYPEDEFED
126 typedef LONG *PLONG;
127 # define PLONG_TYPEDEFED
128 # endif
129 # ifndef ULONG_TYPEDEFED
130 typedef unsigned long ULONG ;
131 # define ULONG_TYPEDEFED
132 # endif
134 typedef char *PSZ ;
135 typedef CONST char *PCSZ ;
136 typedef CHAR *PCH ;
138 #elif defined(__AROS__) || defined(_AMIGA)
139 /* For AROS make SAA functions also internal
142 # include <exec/types.h>
143 typedef BYTE CHAR ;
144 #ifdef __MORPHOS__
145 #define USHORT_TYPEDEFED
146 #else
147 typedef WORD SHORT ;
148 #endif
149 typedef char *PSZ ;
150 typedef CONST char *PCSZ ;
151 # ifndef VOID
152 typedef void VOID ;
153 # endif
154 typedef APTR PVOID;
156 typedef CHAR *PCHAR ;
157 typedef SHORT *PSHORT ;
158 typedef LONG *PLONG ;
160 # ifndef UCHAR_TYPEDEFED
161 typedef UBYTE UCHAR ;
162 # define UCHAR_TYPEDEFED
163 # endif
164 # ifndef USHORT_TYPEDEFED
165 typedef UWORD USHORT ;
166 # define USHORT_TYPEDEFED
167 # endif
168 # ifndef ULONG_TYPEDEFED
169 # define ULONG_TYPEDEFED
170 # endif
172 typedef USHORT *PUSHORT ;
173 typedef CHAR *PCH ;
174 typedef UCHAR *PUCHAR ;
175 #endif
177 #ifdef __MINGW32__
178 typedef CONST char *PCSZ ;
179 #endif
181 #ifdef INCL_REXXSAA
182 # define INCL_RXSUBCOM
183 # define INCL_RXSHV
184 # define INCL_RXFUNC
185 # define INCL_RXSYSEXIT
186 # define INCL_RXMACRO
187 # define INCL_RXARI
188 # define INCL_RXQUEUE
189 # define INCL_RXMACRO
190 #endif
193 * For Innotek gcc, force use of _System calling convention
195 #if defined( __EMX__ ) && defined( __INNOTEK_LIBC__ )
196 # undef APIENTRY
197 # define APIENTRY _System
198 #endif
200 #if !defined(APIENTRY)
201 # define APIENTRY
202 #endif
204 #if !defined(APIRET)
205 # define APIRET ULONG
206 #endif
208 #if !defined(_OS2EMX_H) && !defined( PFN_TYPEDEFED )
209 typedef APIRET (APIENTRY *PFN)();
210 #define PFN_DEFINED
211 #endif
214 typedef struct RXSTRING_type
216 ULONG strlength ;
217 char* strptr ;
218 } RXSTRING ;
219 typedef RXSTRING *PRXSTRING ;
221 #if !defined(_OS2EMX_H)
222 typedef struct REXXDATETIME_type
224 USHORT hours; /* hour of the day (24-hour) */
225 USHORT minutes; /* minute of the hour */
226 USHORT seconds; /* second of the minute */
227 USHORT hundredths; /* hundredths of a second */
228 USHORT day; /* day of the month */
229 USHORT month; /* month of the year */
230 USHORT year; /* current year */
231 USHORT weekday; /* day of the week */
232 ULONG microseconds; /* microseconds */
233 ULONG yearday; /* day number within the year */
234 USHORT valid; /* valid time stamp marker */
235 } REXXDATETIME;
236 #define DATETIME REXXDATETIME
237 typedef REXXDATETIME *PDATETIME;
238 #endif
240 #define RXAUTOBUFLEN 256L
242 typedef struct {
243 char *sysexit_name ;
244 LONG sysexit_code ;
245 } RXSYSEXIT ;
246 typedef RXSYSEXIT *PRXSYSEXIT ;
248 typedef PUCHAR PEXIT ;
251 * typedefs for Rexx handler types
253 typedef APIRET APIENTRY RexxFunctionHandler(PCSZ name, ULONG argc, /* CONST */ PRXSTRING argv, PCSZ queuename, PRXSTRING returnstring) ;
254 typedef LONG APIENTRY RexxExitHandler( LONG, LONG, /* CONST */ PEXIT ) ;
255 typedef APIRET APIENTRY RexxSubcomHandler(/* CONST */ PRXSTRING, PUSHORT, PRXSTRING);
258 * -------------------------------------------------------------------
259 * System Exit Interface
260 *-------------------------------------------------------------------
262 #ifdef INCL_RXSYSEXIT
265 * The following are definition for the function codes and subcodes for
266 * System Exit Handlers. All RXxxx macros are function codes, while the
267 * RXxxxyyy macros are function subcodes for function code RXxxx.
269 #define RXFNC 2
270 # define RXFNCCAL 1
272 #define RXCMD 3
273 # define RXCMDHST 1
275 #define RXMSQ 4 /* Net yet implemented */
276 # define RXMSQPLL 1 /* Net yet implemented */
277 # define RXMSQPSH 2 /* Net yet implemented */
278 # define RXMSQSIZ 3 /* Net yet implemented */
279 # define RXMSQNAM 20 /* Net yet implemented */
281 #define RXSIO 5
282 # define RXSIOSAY 1
283 # define RXSIOTRC 2
284 # define RXSIOTRD 3
285 # define RXSIODTR 4
286 # define RXSIOTLL 5 /* Net yet implemented */
288 #define RXHLT 7
289 # define RXHLTCLR 1
290 # define RXHLTTST 2
292 #define RXTRC 8
293 # define RXTRCTST 1
295 #define RXINI 9
296 # define RXINIEXT 1
298 #define RXTER 10
299 # define RXTEREXT 1
301 #define RXDBG 11
302 # define RXDBGTST 1
304 #define RXENV 12 /* System Environment interface */
305 # define RXENVGET 1 /* Get System Environment Variable */
306 # define RXENVSET 2 /* Set System Environment Variable */
307 # define RXCWDGET 3 /* Get Current Working Directory */
308 # define RXCWDSET 4 /* Set Current Working Directory */
310 #define RXENDLST 0
311 #define RXNOOFEXITS 13 /* MUST be 1 more than last exit number */
313 /* Symbolic return codes for System Exit Handlers */
314 #define RXEXIT_HANDLED 0
315 #define RXEXIT_NOT_HANDLED 1
316 #define RXEXIT_RAISE_ERROR (-1)
318 #define RXEXIT_DROPPABLE 0x00
319 #define RXEXIT_NONDROP 0x01
321 /* Return Codes from RXEXIT interface */
323 #define RXEXIT_ISREG 0x01
324 #define RXEXIT_ERROR 0x01
325 #define RXEXIT_FAILURE 0x02
326 #define RXEXIT_BADENTRY 1001
327 #define RXEXIT_NOEMEM 1002
328 #define RXEXIT_BADTYPE 1003
329 #define RXEXIT_NOTINIT 1004
330 #define RXEXIT_OK 0
331 #define RXEXIT_DUP 10
332 #define RXEXIT_MAXREG 20
333 #define RXEXIT_NOTREG 30
334 #define RXEXIT_NOCANDROP 40
335 #define RXEXIT_LOADERR 50
336 #define RXEXIT_NOPROC 127
338 typedef struct {
339 struct {
340 unsigned rxfferr:1 ;
341 unsigned rxffnfnd:1 ;
342 unsigned rxffsub:1 ;
343 } rxfnc_flags ;
344 /* CONST */ PUCHAR rxfnc_name ;
345 USHORT rxfnc_namel ;
346 /* CONST */ PUCHAR rxfnc_que ;
347 USHORT rxfnc_quel ;
348 USHORT rxfnc_argc ;
349 /* CONST */ PRXSTRING rxfnc_argv ;
350 RXSTRING rxfnc_retc ;
351 } RXFNCCAL_PARM ;
353 typedef struct {
354 struct {
355 unsigned rxfcfail:1 ;
356 unsigned rxfcerr:1 ;
357 } rxcmd_flags ;
358 /* CONST */ PUCHAR rxcmd_address ;
359 USHORT rxcmd_addressl ;
360 /* CONST */ PUCHAR rxcmd_dll ;
361 USHORT rxcmd_dll_len ;
362 /* CONST */ RXSTRING rxcmd_command ;
363 RXSTRING rxcmd_retc ;
364 } RXCMDHST_PARM ;
366 typedef struct {
367 RXSTRING rxmsq_retc ;
368 } RXMSQPLL_PARM ;
370 typedef struct {
371 struct {
372 unsigned rxfmlifo:1 ;
373 } rxmsq_flags ;
374 /* CONST */ RXSTRING rxmsq_value ;
375 } RXMSQPSH_PARM ;
377 typedef struct {
378 ULONG rxmsq_size ;
379 } RXMSQSIZ_PARM ;
381 typedef struct {
382 RXSTRING rxmsq_name ;
383 } RXMSQNAM_PARM ;
385 typedef struct {
386 /* CONST */ RXSTRING rxsio_string ;
387 } RXSIOSAY_PARM ;
389 typedef struct {
390 /* CONST */ RXSTRING rxsio_string ;
391 } RXSIOTRC_PARM ;
393 typedef struct {
394 RXSTRING rxsiotrd_retc ;
395 } RXSIOTRD_PARM ;
397 typedef struct {
398 RXSTRING rxsiodtr_retc ;
399 } RXSIODTR_PARM ;
401 typedef struct {
402 struct {
403 unsigned rxfhhalt:1 ;
404 } rxhlt_flags ;
405 } RXHLTTST_PARM ;
407 typedef struct {
408 struct {
409 unsigned rxftrace:1 ;
410 } rxtrx_flags ;
411 } RXTRCTST_PARM ;
413 typedef struct {
414 RXSTRING rxenv_name ;
415 RXSTRING rxenv_value ;
416 } RXENVGET_PARM ;
418 typedef struct {
419 RXSTRING rxenv_name ;
420 RXSTRING rxenv_value ;
421 } RXENVSET_PARM ;
423 typedef struct {
424 RXSTRING rxcwd_value ;
425 } RXCWDGET_PARM ;
427 typedef struct {
428 RXSTRING rxcwd_value ;
429 } RXCWDSET_PARM ;
431 APIRET APIENTRY RexxRegisterExitExe(
432 PCSZ EnvName,
433 #ifdef RX_WEAKTYPING
434 PFN EntryPoint,
435 #else
436 RexxExitHandler *EntryPoint,
437 #endif
438 /* CONST */ PUCHAR UserArea )
439 EXTNAME("RexxRegisterExitExe");
440 #define REXXREGISTEREXITEXE RexxRegisterExitExe
442 APIRET APIENTRY RexxRegisterExitDll(
443 PCSZ EnvName,
444 PCSZ ModuleName,
445 PCSZ ProcedureName,
446 /* CONST */ PUCHAR UserArea,
447 ULONG DropAuth )
448 EXTNAME("RexxRegisterExitDll");
449 #define REXXREGISTEREXITDLL RexxRegisterExitDll
451 APIRET APIENTRY RexxDeregisterExit(
452 PCSZ EnvName,
453 PCSZ ModuleName )
454 EXTNAME("RexxDeregisterExit");
455 #define REXXDEREGISTEREXIT RexxDeregisterExit
457 APIRET APIENTRY RexxQueryExit (
458 PCSZ ExitName,
459 PCSZ ModuleName,
460 PUSHORT Flag,
461 PUCHAR UserArea)
462 EXTNAME("RexxQueryExit");
463 #define REXXQUERYEXIT RexxQueryExit
465 #endif /* INCL_RXSYSEXIT */
468 #define MAXENVNAMELEN 32767 /* at least, there is no limit */
470 #define MAKERXSTRING(x,c,l) ((x).strptr=(c),(x).strlength=(l))
471 #define RXNULLSTRING(x) (!(x).strptr)
472 #define RXSTRLEN(x) ((x).strptr ? (x).strlength : 0UL)
473 #define RXSTRPTR(x) ((x).strptr)
474 #define RXVALIDSTRING(x) ((x).strptr && (x).strlength)
475 #define RXZEROLENSTRING(x) ((x).strptr && !(x).strlength)
477 #define RXCOMMAND 0
478 #define RXSUBROUTINE 1
479 #define RXFUNCTION 2
481 * RXRESTRICTED is OR'ed with one of the above values to run Regina
482 * in "restricted" mode
484 #define RXRESTRICTED 256
487 #ifdef INCL_RXSHV
490 * Definitions and declarations for the Rexx variable pool interface.
493 # define RXSHV_OK 0x00 /* Everything OK */
494 # define RXSHV_NEWV 0x01 /* Var not previously set */
495 # define RXSHV_LVAR 0x02 /* Last var in a NEXTV sequence */
496 # define RXSHV_TRUNC 0x04 /* Name or value has been truncated */
497 # define RXSHV_BADN 0x08 /* Bad/invalid name */
498 # define RXSHV_MEMFL 0x10 /* Memory problem, e.g. out of memory */
499 # define RXSHV_BADF 0x80 /* Invalid function code */
501 # define RXSHV_NOAVL 0x90 /* Interface is not available */
504 * Note: Some documentation claims that RXSHV_BADF should have the
505 * value 0x80, but that can't be correct, can it?
508 # define RXSHV_SET 0x00 /* Set variable */
509 # define RXSHV_FETCH 0x01 /* Get value of variable */
510 # define RXSHV_DROPV 0x02 /* Drop variable */
511 # define RXSHV_SYSET 0x03 /* Set symbolic variable */
512 # define RXSHV_SYFET 0x04 /* Get value of symbolic variable */
513 # define RXSHV_SYDRO 0x05 /* Drop symbolic variable */
514 # define RXSHV_NEXTV 0x06 /* Get next var in a NEXTV sequence */
515 # define RXSHV_PRIV 0x07 /* Get private information */
516 # define RXSHV_EXIT 0x08 /* Set function exit value */
519 * Note: A symbolic variable is a symbol that will be 'expanded' before
520 * use, while a (normal) variable is used directly, without
521 * expanding it first.
524 typedef struct shvnode
526 struct shvnode *shvnext ;
527 RXSTRING shvname ;
528 RXSTRING shvvalue ;
529 ULONG shvnamelen ;
530 ULONG shvvaluelen ;
531 UCHAR shvcode ;
532 UCHAR shvret ;
533 } SHVBLOCK ;
535 typedef SHVBLOCK *PSHVBLOCK ;
537 APIRET APIENTRY RexxVariablePool(
538 PSHVBLOCK RequestBlockList )
539 EXTNAME("RexxVariablePool");
540 #define REXXVARIABLEPOOL RexxVariablePool
542 #endif /* INCL_RXSHV */
545 APIRET APIENTRY RexxFreeMemory(
546 PVOID MemoryBlock )
547 EXTNAME("RexxFreeMemory");
548 #define REXXFREEMEMORY RexxFreeMemory
550 PVOID APIENTRY RexxAllocateMemory(
551 ULONG size )
552 EXTNAME("RexxAllocateMemory");
553 #define REXXALLOCATEMEMORY RexxAllocateMemory
556 APIRET APIENTRY RexxStart(
557 LONG ArgCount,
558 /* CONST */ PRXSTRING ArgList,
559 PCSZ ProgramName,
560 /* CONST */ PRXSTRING Instore,
561 PCSZ EnvName,
562 LONG CallType,
563 /* CONST */ PRXSYSEXIT Exits,
564 PSHORT ReturnCode,
565 PRXSTRING Result )
566 EXTNAME("RexxStart");
567 #define REXXSTART RexxStart
570 * Return codes .... haha there doesn't seem to be a standard, except
571 * zero is OK, negative is an Rexx error, the positive error codes below
572 * are my own 'invention'
574 #define RX_START_OK 0
575 #define RX_START_BADP 1 /* Bad parameters */
576 #define RX_START_UNIMPL 2 /* Not yet implemented :-) */
577 #define RX_START_TOOMANYP 3 /* To many parameters */
578 #define RX_DIDNT_START 4 /* Unable to start interpreter */
580 APIRET APIENTRY RexxCallBack(
581 PCSZ ProcedureName,
582 LONG ArgCount,
583 PRXSTRING ArgList,
584 PSHORT ReturnCode,
585 PRXSTRING Result )
586 EXTNAME("RexxCallBack");
587 #define REXXCALLBACK RexxCallBack
590 * Return codes for RexxCallBack
592 #define RX_CB_OK 0
593 #define RX_CB_BADP 1 /* Bad parameters */
594 #define RX_CB_NOTSTARTED 2 /* Interface not running */
595 #define RX_CB_TOOMANYP 3 /* Too many parameters */
596 #define RX_CB_BADN 8 /* Procedure not found */
598 * -------------------------------------------------------------------
599 * Sub-command Interface
600 *-------------------------------------------------------------------
602 #ifdef INCL_RXSUBCOM
604 APIRET APIENTRY RexxRegisterSubcomExe(
605 PCSZ EnvName,
606 #ifdef RX_WEAKTYPING
607 PFN EntryPoint,
608 #else
609 RexxSubcomHandler *EntryPoint,
610 #endif
611 /* CONST */ PUCHAR UserArea )
612 EXTNAME("RexxRegisterSubcomExe");
613 #define REXXREGISTERSUBCOMEXE RexxRegisterSubcomExe
615 APIRET APIENTRY RexxDeregisterSubcom(
616 PCSZ EnvName,
617 PCSZ ModuleName )
618 EXTNAME("RexxDeregisterSubcom");
619 #define REXXDEREGISTERSUBCOM RexxDeregisterSubcom
621 APIRET APIENTRY RexxRegisterSubcomDll(
622 PCSZ EnvName,
623 PCSZ ModuleName,
624 PCSZ ProcedureName,
625 /* CONST */ PUCHAR UserArea,
626 ULONG DropAuth )
627 EXTNAME("RexxRegisterSubcomDll");
628 #define REXXREGISTERSUBCOMDLL RexxRegisterSubcomDll
630 APIRET APIENTRY RexxQuerySubcom(
631 PCSZ Envname,
632 PCSZ ModuleName,
633 PUSHORT Flag, /* Documentation diverges ... */
634 PUCHAR UserArea )
635 EXTNAME("RexxQuerySubcom");
636 #define REXXQUERYSUBCOM RexxQuerySubcom
638 #define RXSUBCOM_OK 0
639 #define RXSUBCOM_DUP 10
640 #define RXSUBCOM_MAXREG 20
641 #define RXSUBCOM_NOTREG 30
642 #define RXSUBCOM_NOCANDROP 40
643 #define RXSUBCOM_LOADERR 50
644 #define RXSUBCOM_NOPROC 127
646 #define RXSUBCOM_BADENTRY 1001
647 #define RXSUBCOM_NOEMEM 1002
648 #define RXSUBCOM_BADTYPE 1003
649 #define RXSUBCOM_NOTINIT 1004
651 /* I don't know the 'real' values of these */
652 #define RXSUBCOM_ERROR 0x01
653 #define RXSUBCOM_ISREG 0x01
654 #define RXSUBCOM_FAILURE 0x02
656 #define RXSUBCOM_DROPPABLE 0x00
657 #define RXSUBCOM_NONDROP 0x01
659 #endif /* INCL_RXSUBCOM */
663 * -------------------------------------------------------------------
664 * External Function Interface
665 *-------------------------------------------------------------------
667 #ifdef INCL_RXFUNC
669 #define RXFUNC_OK 0
670 #define RXFUNC_DEFINED 10
671 #define RXFUNC_NOMEM 20
672 #define RXFUNC_NOTREG 30
673 #define RXFUNC_MODNOTFND 40
674 #define RXFUNC_ENTNOTFND 50
675 #define RXFUNC_NOTINIT 60
676 #define RXFUNC_BADTYPE 70
677 #define RXFUNC_NOEMEM 1002
679 APIRET APIENTRY RexxRegisterFunctionExe(
680 PCSZ name,
681 #ifdef RX_WEAKTYPING
682 PFN EntryPoint )
683 #else
684 RexxFunctionHandler *EntryPoint )
685 #endif
686 EXTNAME("RexxRegisterFunctionExe");
687 #define REXXREGISTERFUNCTIONEXE RexxRegisterFunctionExe
689 APIRET APIENTRY RexxRegisterFunctionDll(
690 PCSZ ExternalName,
691 PCSZ LibraryName,
692 PCSZ InternalName )
693 EXTNAME("RexxRegisterFunctionDll");
694 #define REXXREGISTERFUNCTIONDLL RexxRegisterFunctionDll
696 APIRET APIENTRY RexxDeregisterFunction(
697 PCSZ name )
698 EXTNAME("RexxDeregisterFunction");
699 #define REXXDEREGISTERFUNCTION RexxDeregisterFunction
701 APIRET APIENTRY RexxQueryFunction(
702 PCSZ name )
703 EXTNAME("RexxQueryFunction");
704 #define REXXQUERYFUNCTION RexxQueryFunction
706 #endif /* INCL_RXFUNC */
709 * -------------------------------------------------------------------
710 * Asynchronous Request Interface
711 *-------------------------------------------------------------------
713 #ifdef INCL_RXARI
715 /*** Return Codes from Asynchronous Request interface */
717 #define RXARI_OK 0
718 #define RXARI_NOT_FOUND 1
719 #define RXARI_PROCESSING_ERROR 2
721 APIRET APIENTRY RexxSetHalt(
722 LONG pid,
723 LONG tid)
724 EXTNAME("RexxSetHalt");
725 #define REXXSETHALT RexxSetHalt
727 #endif /* INCL_RXARI */
730 * -------------------------------------------------------------------
731 * External Queue Interface
732 *-------------------------------------------------------------------
734 #ifdef INCL_RXQUEUE
736 ULONG APIENTRY RexxCreateQueue (
737 PSZ,
738 ULONG,
739 PSZ,
740 ULONG* )
741 EXTNAME("RexxCreateQueue");
742 #define REXXCREATEQUEUE RexxCreateQueue
744 ULONG APIENTRY RexxDeleteQueue (
745 PSZ )
746 EXTNAME("RexxDeleteQueue");
747 #define REXXDELETEQUEUE RexxDeleteQueue
749 ULONG APIENTRY RexxQueryQueue (
750 PSZ,
751 ULONG* )
752 EXTNAME("RexxQueryQueue");
753 #define REXXQUERYQUEUE RexxQueryQueue
755 ULONG APIENTRY RexxAddQueue (
756 PSZ,
757 PRXSTRING,
758 ULONG )
759 EXTNAME("RexxAddQueue");
760 #define REXXADDQUEUE RexxAddQueue
762 ULONG APIENTRY RexxPullQueue (
763 PSZ,
764 PRXSTRING,
765 PDATETIME,
766 ULONG )
767 EXTNAME("RexxPullQueue");
768 #define REXXPULLQUEUE RexxPullQueue
770 /* Request flags for External Data Queue access --------------------- */
771 #define RXQUEUE_FIFO 0 /* Access queue first-in-first-out */
772 #define RXQUEUE_LIFO 1 /* Access queue last-in-first-out */
774 #define RXQUEUE_NOWAIT 0 /* Wait for data if queue empty */
775 #define RXQUEUE_WAIT 1 /* Don't wait on an empty queue */
777 /* Return Codes from RxQueue interface ------------------------------ */
778 #define RXQUEUE_OK 0 /* Successful return */
779 #define RXQUEUE_NOTINIT 1000 /* Queues not initialized */
781 #define RXQUEUE_STORAGE 1 /* Ret info buf not big enough */
782 #define RXQUEUE_SIZE 2 /* Data size > 64K-64 */
783 #define RXQUEUE_DUP 3 /* Attempt-duplicate queue name*/
784 #define RXQUEUE_NOEMEM 4 /* Not enough available memory */
785 #define RXQUEUE_BADQNAME 5 /* Not a valid queue name */
786 #define RXQUEUE_PRIORITY 6 /* Not accessed as LIFO|FIFO */
787 #define RXQUEUE_BADWAITFLAG 7 /* Not accessed as WAIT|NOWAIT */
788 #define RXQUEUE_EMPTY 8 /* No data in queue */
789 #define RXQUEUE_NOTREG 9 /* Queue does not exist */
790 #define RXQUEUE_ACCESS 10 /* Queue busy and wait active */
791 #define RXQUEUE_MAXREG 11 /* No memory to create a queue */
792 #define RXQUEUE_MEMFAIL 12 /* Failure in memory management*/
793 #define RXQUEUE_NETERROR 100 /* Network error */
795 #endif /* INCL_RXQUEUE */
798 * -------------------------------------------------------------------
799 * Macrospace Interface
800 *-------------------------------------------------------------------
802 #ifdef INCL_RXMACRO
804 APIRET APIENTRY RexxAddMacro (
805 PSZ, /* Function to add or change */
806 PSZ, /* Name of file to get function */
807 ULONG ) /* Flag indicating search pos */
808 EXTNAME("RexxAddMacro");
809 #define REXXADDMACRO RexxAddMacro
811 APIRET APIENTRY RexxDropMacro (
812 PSZ ) /* Name of function to remove */
813 EXTNAME("RexxDropMacro");
814 #define REXXDROPMACRO RexxDropMacro
816 APIRET APIENTRY RexxSaveMacroSpace (
817 ULONG , /* Argument count (0==save all) */
818 PSZ *, /* List of funct names to save */
819 PSZ) /* File to save functions in */
820 EXTNAME("RexxSaveMacroSpace");
821 #define REXXSAVEMACROSPACE RexxSaveMacroSpace
823 APIRET APIENTRY RexxLoadMacroSpace (
824 ULONG , /* Argument count (0==load all) */
825 PSZ *, /* List of funct names to load */
826 PSZ) /* File to load functions from */
827 EXTNAME("RexxLoadMacroSpace");
828 #define REXXLOADMACROSPACE RexxLoadMacroSpace
830 APIRET APIENTRY RexxQueryMacro (
831 PSZ, /* Function to search for */
832 PUSHORT ) /* Ptr for position flag return */
833 EXTNAME("RexxQueryMacro");
834 #define REXXQUERYMACRO RexxQueryMacro
836 APIRET APIENTRY RexxReorderMacro(
837 PSZ, /* Name of funct change order */
838 ULONG ) /* New position for function */
839 EXTNAME("RexxReorderMacro");
840 #define REXXREORDERMACRO RexxReorderMacro
842 APIRET APIENTRY RexxClearMacroSpace(
844 EXTNAME("RexxClearMacroSpace");
845 #define REXXCLEARMACROSPACE RexxClearMacroSpace
847 /* Registration Search Order Flags ---------------------------------- */
848 #define RXMACRO_SEARCH_BEFORE 1 /* Beginning of search order */
849 #define RXMACRO_SEARCH_AFTER 2 /* End of search order */
851 /* Return Codes from RxMacroSpace interface ------------------------- */
852 #define RXMACRO_OK 0 /* Macro interface completed */
853 #define RXMACRO_NO_STORAGE 1 /* Not Enough Storage Available */
854 #define RXMACRO_NOT_FOUND 2 /* Requested function not found */
855 #define RXMACRO_EXTENSION_REQUIRED 3 /* File ext required for save */
856 #define RXMACRO_ALREADY_EXISTS 4 /* Macro functions exist */
857 #define RXMACRO_FILE_ERROR 5 /* File I/O error in save/load */
858 #define RXMACRO_SIGNATURE_ERROR 6 /* Incorrect format for load */
859 #define RXMACRO_SOURCE_NOT_FOUND 7 /* Requested cannot be found */
860 #define RXMACRO_INVALID_POSITION 8 /* Invalid search order pos */
861 #define RXMACRO_NOT_INIT 9 /* API not initialized */
863 #endif /* INCL_RXMACRO */
866 /* REGINA EXTENSIONS *********************************************************/
867 /* The following functions are an extension to the standard. Never try to
868 * address the function directly if you want to be compatible. Use the dynamic
869 * linking machanism of your operating system instead.
872 * ReginaVersion returns informations about the version of the library.
873 * This function was introduced in version 2.0.
874 * Returns: ULONG, in lower byte the two-digit fraction part of the version.
875 * The higher bytes will hold the integer part of the version.
876 * Examples: 0x10A codes the Version "1.10".
877 * VersionString will be filled if VersionString is non-NULL.
878 * If VersionString is non-NULL then there are two possibilities:
879 * a) VersionString->strlength == 0: VersionString is filled with the
880 * appropriate values. VersionString->strptr
881 * is always created.
882 * b) VersionString->strlength != 0: VersionString->strptr is filled up to
883 * this value. VersionString->strlength will
884 * hold the copied bytes.
885 * Note: A terminating ASCII-zero is appended if there is enough space
886 * although it is never counted in VersionString.strlength.
887 * RexxAllocateMemory is used if needed.
889 APIRET APIENTRY ReginaVersion(
890 PRXSTRING VersionString )
891 EXTNAME("ReginaVersion");
892 #define REGINAVERSION ReginaVersion
895 * ReginaCleanup performs a graceful cleanup. This is done automatically
896 * on many systems but you can't be sure in all cases. The cleanup operations
897 * destroys all informations that are collected so far by one thread.
898 * It works for a single process or thread too. Although all memory is
899 * freed, some open handles may remain open. It is necessary to perform
900 * the appropriate "RexxDeregister<whatever>" calls before this routine
901 * is called.
902 * This function was introduced in version 3.3.
903 * Returns: ULONG, 0 if this call hasn't done anything.
904 * 1 if at least something could be freed.
905 * It is allowed to reuse every API function after this call but this routine
906 * must not be used when some parts of the Regina core are in use.
908 APIRET APIENTRY ReginaCleanup( )
909 EXTNAME("ReginaCleanup");
910 #define REGINACLEANUP ReginaCleanup
912 #ifdef OREXX_BINARY_COMPATIBLE
913 # pragma pack()
914 #endif
916 #ifdef __cplusplus
918 #endif
920 #endif /* __REXXSAA_H_INCLUDED */