__regina_faked_main()
Synopsis
int __regina_faked_main(
int __regina_faked_main(int argc, char *argv[]);
Function
Runs Regina's command-line interpreter from the shared library.
It initializes interpreter state, processes command-line options,
and reads, executes, or tokenizes the selected Rexx input.
The regina executable calls this entry point. It is not the
RexxStart() SAA execution interface.
Result
Returns the converted numeric script result during ordinary
execution. If that result is absent or cannot be converted to an
integer, ordinary result conversion returns EXIT_SUCCESS.
Returns zero for help or version options and on successful
tokenization. In the exceptional interpreter-exit path, returns
-1 if no result is stored; otherwise uses atoi() on that result.
Notes
With no input filename, the interpreter reads from standard input.
The -c option produces tokenized output; -e executes tokenized
input. Other options follow the standalone Regina command line.
This entry point uses command-line state and shared interpreter
initialization. It does not provide per-call isolation guarantees
for embedding in arbitrary applications. Use RexxStart() for the
SAA programmatic execution interface.
Bugs
Some invalid or conflicting command-line options call exit(1)
rather than returning an error. Calling this vector from within
another program can therefore terminate that program.
The argument vector and argv[0] are not validated before use.
Invalid pointers are not a supported input condition.
IsReginaMsg()
Synopsis
BOOL IsReginaMsg(
BOOL IsReginaMsg(struct RexxMsg *msg);
Function
Checks whether a Rexx message is associated with one of the
thread-context values currently recorded by regina.library. The
routine opens rexxsyslib.library, calls IsRexxMsg(), closes the
library, and compares rm_Private2 with the stored TSD values.
Result
TRUE when IsRexxMsg() accepts the message and rm_Private2 matches
a value in the Regina context list; FALSE otherwise.
Also returns FALSE if rexxsyslib.library cannot be opened.
Notes
IsRexxMsg() checks the RexxSys message-identity pointer, not the
contents of an arbitrary RexxMsg. This routine does not read
rm_Private1 or validate the message contents beyond these tests.
This routine traverses the context list without taking a lock.
Its result is not guaranteed during concurrent changes to that
list. A match does not confer ownership of the message or context.
Bugs
An invalid or NULL msg is unsafe: IsRexxMsg() dereferences the
supplied pointer without checking it first.
Cleanup clears a context node's TSD pointer without removing its
node. Therefore a valid RexxSys message with rm_Private2 == NULL
can be accepted as a Regina message if any cleared node remains
in the list.
ReginaVersion()
Synopsis
APIRET ReginaVersion(
PRXSTRING VersionString );
Function
Returns the Regina library version and can optionally fill a version
string.
Result
A numeric version code with the major version in the upper byte and a
two-digit minor component in the low byte.
Notes
VersionString.strlength excludes the terminating NUL. Release an API-
allocated version buffer with RexxFreeMemory().
RexxAddMacro()
Synopsis
APIRET RexxAddMacro(
PSZ FuncName,
PSZ SourceFile,
ULONG Position );
Function
This entry point is intended to register a source program in the macro
space, but is not implemented.
Result
Returns RXMACRO_OK (zero) without performing the requested operation.
RexxAddQueue()
Synopsis
APIRET RexxAddQueue(
PSZ QueueName,
PRXSTRING EntryData,
ULONG AddFlag );
Function
Adds an RXSTRING entry to a named queue.
Result
The queue operation status; a missing or empty name produces
RXQUEUE_BADQNAME.
Notes
The AROS build disables external queues.
RexxAllocateMemory()
Synopsis
PVOID RexxAllocateMemory(
ULONG size );
Function
Allocates a buffer using the Regina API allocator.
Result
Pointer to the allocation, or NULL when allocation fails.
Notes
Release the buffer using RexxFreeMemory().
RexxCallBack()
Synopsis
APIRET RexxCallBack(
PCSZ ProcedureName,
LONG ArgCount,
PRXSTRING ArgList,
PSHORT ReturnCode,
PRXSTRING Result );
Function
Calls a named Rexx procedure within an active interpreter session.
Result
The callback status. RX_CB_NOTSTARTED indicates no active interpreter;
RX_CB_BADP, RX_CB_TOOMANYP, and RX_CB_BADN cover invalid arguments and
unknown procedures.
Notes
Normally call from the thread executing the interpreter. A NULL Result
is accepted.
RexxCreateQueue()
Synopsis
APIRET RexxCreateQueue(
PSZ Buffer,
ULONG BuffLen,
PSZ RequestedName,
ULONG *DupFlag );
Function
Creates a named queue in the Regina queue subsystem.
Result
The queue creation status returned by the queue subsystem.
Notes
The AROS build disables external queues with NO_EXTERNAL_QUEUES. Do
not assume a named queue is shared between processes.
RexxDeregisterExit()
Synopsis
APIRET RexxDeregisterExit(
PCSZ EnvName,
PCSZ ModuleName );
Function
Removes a previously registered system exit handler.
Result
The deregistration status. A null EnvName produces RXEXIT_BADTYPE.
RexxDeregisterSubcom()
Synopsis
APIRET RexxDeregisterSubcom(
PCSZ EnvName,
PCSZ ModuleName );
Function
Removes a registered Rexx subcommand environment.
Result
The deregistration status. Null EnvName produces RXSUBCOM_BADTYPE.
RexxDropMacro()
Synopsis
APIRET RexxDropMacro(
PSZ FuncName );
Function
This entry point is intended to remove a program from the macro space,
but is not implemented.
Result
Returns RXMACRO_OK (zero) without performing the requested operation.
RexxFreeMemory()
Synopsis
APIRET RexxFreeMemory(
PVOID MemoryBlock );
Function
Releases memory allocated by the Regina API allocator.
Result
The allocator release status. A null pointer produces RXFUNC_BADTYPE.
Notes
Do not release a buffer twice or use it after release.
RexxLoadMacroSpace()
Synopsis
APIRET RexxLoadMacroSpace(
ULONG FuncCount,
PSZ *FuncNames,
PSZ MacroLibFile );
Function
This entry point is intended to load macro-space entries from a file,
but is not implemented.
Result
Returns RXMACRO_OK (zero) without performing the requested operation.
RexxPullQueue()
Synopsis
APIRET RexxPullQueue(
PSZ QueueName,
PRXSTRING DataBuf,
PDATETIME TimeStamp,
ULONG WaitFlag );
Function
Removes an entry from the named queue.
Result
The queue operation status. Invalid WaitFlag produces
RXQUEUE_BADWAITFLAG; a null DataBuf produces RXQUEUE_MEMFAIL.
Notes
The AROS build disables external queues.
RexxQueryExit()
Synopsis
APIRET RexxQueryExit(
PCSZ EnvName,
PCSZ ModuleName,
PUSHORT Flag,
PUCHAR UserArea );
Function
Checks for a registered system exit handler.
Result
The query status. A null EnvName or Flag produces RXEXIT_BADTYPE.
RexxQueryMacro()
Synopsis
APIRET RexxQueryMacro(
PSZ FuncName,
PUSHORT Position );
Function
This entry point is intended to query a macro-space entry, but is not
implemented.
Result
Returns RXMACRO_OK (zero) without performing the requested operation.
RexxQueryQueue()
Synopsis
APIRET RexxQueryQueue(
PSZ QueueName,
ULONG *Count );
Function
Obtains the number of entries in a named queue.
Result
The query status; a missing or empty name produces RXQUEUE_BADQNAME.
Notes
The AROS build disables external queues. Queue visibility is limited
by the local queue subsystem.
RexxQuerySubcom()
Synopsis
APIRET RexxQuerySubcom(
PCSZ EnvName,
PCSZ ModuleName,
PUSHORT Flag,
PUCHAR UserArea );
Function
Queries a registered Rexx command environment.
Result
The query status. A null EnvName or Flag produces RXSUBCOM_BADTYPE.
RexxRegisterExitDll()
Synopsis
APIRET RexxRegisterExitDll(
PCSZ EnvName,
PCSZ ModuleName,
PCSZ ProcedureName,
PUCHAR UserArea,
ULONG DropAuth );
Function
Registers a system exit handler identified by a dynamic module and
procedure.
Result
The exit-registration status. Null required names or an invalid
DropAuth produce RXEXIT_BADTYPE.
Notes
The implementation validates DropAuth but does not pass it to the
registration helper.
RexxRegisterExitExe()
Synopsis
APIRET RexxRegisterExitExe(
PCSZ EnvName,
RexxExitHandler *EntryPoint,
PUCHAR UserArea );
Function
Registers a process-resident system exit handler for RexxStart().
Result
The status returned by the exit-registration interface. RXEXIT_BADTYPE
is returned for a null name or callback.
RexxRegisterFunctionDll()
Synopsis
APIRET RexxRegisterFunctionDll(
PCSZ ExternalName,
PCSZ LibraryName,
PCSZ InternalName );
Function
Registers a Rexx function backed by a named dynamic library export.
Result
The registration status. A null required name produces RXFUNC_BADTYPE.
RexxRegisterFunctionExe()
Synopsis
APIRET RexxRegisterFunctionExe(
PCSZ Name,
RexxFunctionHandler *EntryPoint );
Function
Registers a direct external Rexx function handler.
Result
The registration status. A null Name or EntryPoint produces
RXFUNC_BADTYPE.
RexxRegisterSubcomDll()
Synopsis
APIRET RexxRegisterSubcomDll(
PCSZ EnvName,
PCSZ ModuleName,
PCSZ ProcedureName,
PUCHAR UserArea,
ULONG DropAuth );
Function
Registers a command environment implemented by a dynamically loaded
procedure.
Result
Registration status. Missing required names or an invalid DropAuth
produce RXSUBCOM_BADTYPE.
Notes
DropAuth is checked but is not passed to the registration helper.
RexxRegisterSubcomExe()
Synopsis
APIRET RexxRegisterSubcomExe(
PCSZ EnvName,
RexxSubcomHandler *EntryPoint,
PUCHAR UserArea );
Function
Registers a direct handler for a named Rexx command environment.
Result
The registration status; RXSUBCOM_BADTYPE is returned when EnvName or
EntryPoint is NULL.
RexxReorderMacro()
Synopsis
APIRET RexxReorderMacro(
PSZ FuncName,
ULONG Position );
Function
This entry point is intended to change the search order of a macro-
space entry, but is not implemented.
Result
Returns RXMACRO_OK (zero) without performing the requested operation.
RexxSaveMacroSpace()
Synopsis
APIRET RexxSaveMacroSpace(
ULONG FuncCount,
PSZ *FuncNames,
PSZ MacroLibFile );
Function
This entry point is intended to save macro-space entries to a file,
but is not implemented.
Result
Returns RXMACRO_OK (zero) without performing the requested operation.
RexxSetHalt()
Synopsis
APIRET RexxSetHalt(
LONG pid,
LONG tid );
Function
Requests interruption of the current Rexx interpreter context.
Result
RXARI_OK after setting the current context halt flag.
Notes
This implementation ignores pid and tid; it does not select a
different process or thread.
RexxStart()
Synopsis
APIRET RexxStart(
LONG ArgCount,
PRXSTRING ArgList,
PCSZ ProgramName,
PRXSTRING Instore,
PCSZ EnvName,
LONG CallType,
PRXSYSEXIT Exits,
PSHORT ReturnCode,
PRXSTRING Result );
Function
Starts a Rexx program from a file, source buffer, or tokenized in-
storage image.
Result
API status of the invocation; the program return code is reported
separately through ReturnCode. Invalid parameters produce
RXFUNC_BADTYPE or RX_START_BADP. Too many arguments produce
RX_START_TOOMANYP.
Notes
RXCOMMAND accepts at most one argument string. Result storage depends
on the supplied RXSTRING buffer and interpreter output.
RexxVariablePool()
Synopsis
APIRET RexxVariablePool(
PSHVBLOCK RequestBlockList );
Function
Processes a linked sequence of Rexx variable-pool requests in the
running interpreter.
Result
Bitwise combination of the request status bits. RXSHV_NOAVL is
returned when no interpreter variable tree is available; a null
request list produces RXFUNC_BADTYPE.
Notes
For each request, inspect shvret and any returned name or value. The
interface requires an active interpreter context.