InterpreterAPI.cpp File Reference
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include "RexxCore.h"
#include "RexxMemory.hpp"
#include "StringClass.hpp"
#include "DirectoryClass.hpp"
#include "RexxActivity.hpp"
#include "ActivityManager.hpp"
#include "MethodClass.hpp"
#include "StackClass.hpp"
#include "Interpreter.hpp"
#include "TranslateDispatcher.hpp"
#include "RexxStartDispatcher.hpp"
#include "InterpreterInstance.hpp"
#include "RexxNativeActivation.hpp"
#include "RexxInternalApis.h"
#include "SystemInterpreter.hpp"
Include dependency graph for InterpreterAPI.cpp:

Go to the source code of this file.

Functions

int REXXENTRY RexxTerminate ()
 
int REXXENTRY RexxInitialize ()
 
void REXXENTRY RexxCreateInterpreterImage (const char *target)
 
int REXXENTRY RexxStart (size_t argcount, PCONSTRXSTRING arglist, const char *programname, PRXSTRING instore, const char *envname, int calltype, PRXSYSEXIT exits, short *retcode, PRXSTRING result)
 
RexxReturnCode REXXENTRY RexxTranslateProgram (const char *inFile, const char *outFile, PRXSYSEXIT exits)
 
RexxReturnCode REXXENTRY RexxTranslateInstoreProgram (const char *inFile, CONSTRXSTRING *source, RXSTRING *image)
 
char *REXXENTRY RexxGetVersionInformation ()
 
RexxReturnCode REXXENTRY RexxHaltThread (thread_id_t threadid)
 
RexxReturnCode REXXENTRY RexxSetHalt (process_id_t procid, thread_id_t threadid)
 
RexxReturnCode REXXENTRY RexxSetThreadTrace (thread_id_t threadid)
 
RexxReturnCode REXXENTRY RexxResetThreadTrace (thread_id_t threadid)
 
RexxReturnCode REXXENTRY RexxSetTrace (process_id_t procid, thread_id_t threadid)
 
RexxReturnCode REXXENTRY RexxResetTrace (process_id_t procid, thread_id_t threadid)
 
RexxReturnCode RexxEntry RexxCreateInterpreter (RexxInstance **instance, RexxThreadContext **context, RexxOption *options)
 
RexxReturnCode RexxEntry RexxVariablePool (PSHVBLOCK pshvblock)
 
RexxReturnCode RexxEntry RexxStemSort (const char *stemname, int order, int type, size_t start, size_t end, size_t firstcol, size_t lastcol)
 
void RexxEntry RexxWaitForTermination ()
 
RexxReturnCode RexxEntry RexxDidRexxTerminate ()
 

Function Documentation

◆ RexxCreateInterpreter()

RexxReturnCode RexxEntry RexxCreateInterpreter ( RexxInstance **  instance,
RexxThreadContext **  context,
RexxOption options 
)

Create an interpreter instance at the API level.

Parameters
instanceThe returned instance pointer.
contextThe initial thread context for this instance.
exitsA list of user exits to be used for this context.
userDataA pointer to a user defined data area.
Returns
RXAPI_OK if the instance was created, RXAPI_MEMFAIL for any creation errors.

Definition at line 380 of file InterpreterAPI.cpp.

References Interpreter::createInstance(), RXAPI_MEMFAIL, and RXAPI_OK.

Referenced by main(), and WinMain().

◆ RexxCreateInterpreterImage()

void REXXENTRY RexxCreateInterpreterImage ( const char *  target)

Create the Rexx saved image during build processing.

Returns
Nothing

Definition at line 93 of file InterpreterAPI.cpp.

References Interpreter::SAVE_IMAGE_MODE, and Interpreter::startInterpreter().

Referenced by main().

◆ RexxDidRexxTerminate()

RexxReturnCode RexxEntry RexxDidRexxTerminate ( void  )

Test if the interpreter environment has terminated. This is a nop in 4.0 since the APIs do the proper thing with respect to threading termination. This is maintained solely for binary compatibility.

Returns
always returns true

Definition at line 441 of file InterpreterAPI.cpp.

◆ RexxGetVersionInformation()

char* REXXENTRY RexxGetVersionInformation ( void  )

Retrieve the interpreter version information.

Returns

Definition at line 233 of file InterpreterAPI.cpp.

References SystemInterpreter::allocateResultMemory(), and build().

Referenced by main().

◆ RexxHaltThread()

RexxReturnCode REXXENTRY RexxHaltThread ( thread_id_t  threadid)

Raise a halt condition for a target thread.

Parameters
threadidThe target threadid.
Returns
RXARI_OK if this worked, RXARI_NOT_FOUND if the thread isn't active.

Definition at line 271 of file InterpreterAPI.cpp.

References ActivityManager::haltActivity(), Interpreter::isActive(), OREF_NULL, RXARI_NOT_FOUND, and RXARI_OK.

Referenced by RexxSetHalt().

◆ RexxInitialize()

int REXXENTRY RexxInitialize ( )

Definition at line 76 of file InterpreterAPI.cpp.

References Interpreter::RUN_MODE, and Interpreter::startInterpreter().

◆ RexxResetThreadTrace()

RexxReturnCode REXXENTRY RexxResetThreadTrace ( thread_id_t  threadid)

Reset the external trace for a target thread.

Parameters
threadidThe target thread id.
Returns
The success/failure indicator.

Definition at line 327 of file InterpreterAPI.cpp.

References Interpreter::isActive(), RXARI_NOT_FOUND, RXARI_OK, and ActivityManager::setActivityTrace().

Referenced by RexxResetTrace().

◆ RexxResetTrace()

RexxReturnCode REXXENTRY RexxResetTrace ( process_id_t  procid,
thread_id_t  threadid 
)

The compatibility stub for the reset trace API.

Parameters
procidThe target process id (ignored).
threadidThe thread id of the target thread.
Returns
The success/failure indicator.

Definition at line 363 of file InterpreterAPI.cpp.

References RexxResetThreadTrace().

Referenced by GrxHost().

◆ RexxSetHalt()

RexxReturnCode REXXENTRY RexxSetHalt ( process_id_t  procid,
thread_id_t  threadid 
)

Compatibility function for doing a RexxHaltThread().

Parameters
procidThe process id (ignored).
threadidThe target threadid
Returns
the success/failure return code.

Definition at line 293 of file InterpreterAPI.cpp.

References RexxHaltThread().

Referenced by GrxHost().

◆ RexxSetThreadTrace()

RexxReturnCode REXXENTRY RexxSetThreadTrace ( thread_id_t  threadid)

Turn on tracing for a given interpreter thread.

Parameters
threadidThe target thread identifier.
Returns
the success/failure return code.

Definition at line 306 of file InterpreterAPI.cpp.

References Interpreter::isActive(), RXARI_NOT_FOUND, RXARI_OK, and ActivityManager::setActivityTrace().

Referenced by RexxSetTrace().

◆ RexxSetTrace()

RexxReturnCode REXXENTRY RexxSetTrace ( process_id_t  procid,
thread_id_t  threadid 
)

Compatibility stub for the old signature of RexxSetTrace.

Parameters
procidThe process id (ignored).
threadidThe target thread identifier.
Returns
the success/failure return code.

Definition at line 349 of file InterpreterAPI.cpp.

References RexxSetThreadTrace().

Referenced by GrxHost().

◆ RexxStart()

◆ RexxStemSort()

RexxReturnCode RexxEntry RexxStemSort ( const char *  stemname,
int  order,
int  type,
size_t  start,
size_t  end,
size_t  firstcol,
size_t  lastcol 
)

Process a stemsort call for the rexxutil SysStemSort function.

Parameters
stemnameThe name of the stem.
orderThe sort order.
typeThe type of sort (case sensitivity).
startThe starting element number.
endThe end element number.
firstcolThe first sort column.
lastcolThe last sort column.
Returns
The sort return code result.

Definition at line 412 of file InterpreterAPI.cpp.

References NativeContextBlock::self, RexxNativeActivation::stemSort(), and type.

Referenced by SysStemSort().

◆ RexxTerminate()

int REXXENTRY RexxTerminate ( )

Definition at line 65 of file InterpreterAPI.cpp.

References Interpreter::terminateInterpreter().

◆ RexxTranslateInstoreProgram()

RexxReturnCode REXXENTRY RexxTranslateInstoreProgram ( const char *  inFile,
CONSTRXSTRING source,
RXSTRING image 
)

Translate a program and store the translated results in an external file.

Parameters
inFileThe input name.
sourceThe source RXSTRING
imageThe returned image RXSTRING
Returns
The error return code (if any).

Definition at line 215 of file InterpreterAPI.cpp.

References TranslateInstoreDispatcher::image, ActivityDispatcher::invoke(), TranslateInstoreDispatcher::programName, ActivityDispatcher::rc, and TranslateInstoreDispatcher::source.

◆ RexxTranslateProgram()

RexxReturnCode REXXENTRY RexxTranslateProgram ( const char *  inFile,
const char *  outFile,
PRXSYSEXIT  exits 
)

Translate a program and store the translated results in an external file.

Parameters
inFileThe input source file.
outFileThe output source.
exitsThe exits to use during the translation process.
Returns
The error return code (if any).

Definition at line 185 of file InterpreterAPI.cpp.

References TranslateDispatcher::instore, ActivityDispatcher::invoke(), TranslateDispatcher::outputName, TranslateDispatcher::programName, ActivityDispatcher::rc, and Interpreter::terminateInterpreter().

Referenced by main().

◆ RexxVariablePool()

◆ RexxWaitForTermination()

void RexxEntry RexxWaitForTermination ( void  )

Wait for Rexx termination. This is a nop in 4.0 since the APIs do the proper thing with respect to threading termination. This is maintained solely for binary compatibility.

Returns

Definition at line 428 of file InterpreterAPI.cpp.