SystemInterpreter Class Reference

#include <SystemInterpreter.hpp>

Static Public Member Functions

static void live (size_t)
 
static void liveGeneral (int reason)
 
static void processStartup ()
 
static void processShutdown ()
 
static void startInterpreter ()
 
static void terminateInterpreter ()
 
static void initializeInstance (InterpreterInstance *instance)
 
static void terminateInstance (InterpreterInstance *instance)
 
static void getCurrentWorkingDirectory (char *)
 
static RexxObjectpopEnvironment (RexxActivation *context)
 
static RexxObjectpushEnvironment (RexxActivation *context)
 
static void restoreEnvironment (void *CurrentEnv)
 
static RexxObjectbuildEnvlist ()
 
static RexxStringqualifyFileSystemName (RexxString *name)
 
static void getCurrentTime (RexxDateTime *Date)
 
static RexxStringgetSystemName ()
 
static RexxStringgetSystemVersion ()
 
static RexxStringgetInternalSystemName ()
 
static RexxStringgetSourceString (RexxString *callType, RexxString *programName)
 
static RexxStringgetUserid ()
 
static void releaseResultMemory (void *)
 
static void * allocateResultMemory (sizeB_t)
 
static RexxStringgetMessageHeader (wholenumber_t code)
 
static RexxStringgetMessageText (wholenumber_t code)
 
static bool valueFunction (RexxString *name, RexxObject *newValue, RexxString *selector, RexxObject *&result)
 
static RexxStringgetDefaultAddressName ()
 
static bool invokeExternalFunction (RexxActivation *, RexxActivity *, RexxString *, RexxObject **, size_t, size_t, RexxString *, ProtectedObject &)
 
static void validateAddressName (RexxString *name)
 
static void loadImage (char **imageBuffer, size_t *imageSize)
 
static RexxBufferreadProgram (const char *file_name)
 
static void live (size_t)
 
static void liveGeneral (int reason)
 
static void processStartup (HINSTANCE mod)
 
static void processShutdown ()
 
static void startInterpreter ()
 
static void terminateInterpreter ()
 
static void initializeInstance (InterpreterInstance *instance)
 
static void terminateInstance (InterpreterInstance *instance)
 
static void startTimeSlice ()
 
static void stopTimeSlice ()
 
static void setTimeSliceTimerThread (HANDLE h)
 
static bool loadMessage (wholenumber_t code, char *buffer, size_t bufferLength)
 
static RexxObjectpopEnvironment (RexxActivation *context)
 
static RexxObjectpushEnvironment (RexxActivation *context)
 
static void restoreEnvironment (void *CurrentEnv)
 
static RexxStringqualifyFileSystemName (RexxString *name)
 
static void getCurrentTime (RexxDateTime *Date)
 
static RexxStringgetSystemName ()
 
static RexxStringgetSystemVersion ()
 
static RexxStringgetInternalSystemName ()
 
static RexxStringgetSourceString (RexxString *callType, RexxString *programName)
 
static void releaseResultMemory (void *)
 
static void * allocateResultMemory (sizeB_t)
 
static RexxStringgetMessageHeader (wholenumber_t code)
 
static RexxStringgetMessageText (wholenumber_t code)
 
static RexxStringgetUserid ()
 
static bool valueFunction (RexxString *name, RexxObject *newValue, RexxString *selector, RexxObject *&result)
 
static RexxStringgetDefaultAddressName ()
 
static bool invokeExternalFunction (RexxActivation *, RexxActivity *, RexxString *, RexxObject **, size_t, size_t, RexxString *, ProtectedObject &)
 
static void validateAddressName (RexxString *name)
 
static void loadImage (char **imageBuffer, size_t *imageSize)
 
static RexxBufferreadProgram (const char *file_name)
 
static bool processSignal (DWORD dwCtrlType)
 

Static Public Attributes

static sigset_t oldmask
 
static sigset_t newmask
 
static ULONG exceptionHostProcessId = 0
 
static HANDLE exceptionHostProcess = NULL
 
static bool exceptionConsole = false
 
static bool explicitConsole = false
 
static int signalCount = 0
 

Static Protected Attributes

static HINSTANCE moduleHandle = 0
 
static HANDLE timeSliceTimerThread = 0
 

Detailed Description

Definition at line 68 of file unix/SystemInterpreter.hpp.

Member Function Documentation

◆ allocateResultMemory() [1/2]

◆ allocateResultMemory() [2/2]

static void* SystemInterpreter::allocateResultMemory ( sizeB_t  )
static

◆ buildEnvlist()

RexxObject * SystemInterpreter::buildEnvlist ( )
static

◆ getCurrentTime() [1/2]

◆ getCurrentTime() [2/2]

static void SystemInterpreter::getCurrentTime ( RexxDateTime Date)
static

◆ getCurrentWorkingDirectory()

void SystemInterpreter::getCurrentWorkingDirectory ( char *  buf)
static

Get the current working directory for the process.

Returns
The current working directory as a Rexx string.

Definition at line 183 of file unix/SystemInterpreter.cpp.

Referenced by buildEnvlist(), and RexxRoutine1().

◆ getDefaultAddressName() [1/2]

RexxString * SystemInterpreter::getDefaultAddressName ( )
static

Retrieve the globally default initial address.

Returns
The string name of the default address.

Definition at line 101 of file unix/SystemCommands.cpp.

Referenced by InterpreterInstance::initialize().

◆ getDefaultAddressName() [2/2]

static RexxString* SystemInterpreter::getDefaultAddressName ( )
static

◆ getInternalSystemName() [1/2]

RexxString * SystemInterpreter::getInternalSystemName ( )
static

Definition at line 91 of file unix/MiscSystem.cpp.

References getSystemName().

Referenced by RexxMemory::createImage().

◆ getInternalSystemName() [2/2]

static RexxString* SystemInterpreter::getInternalSystemName ( )
static

◆ getMessageHeader() [1/2]

RexxString * SystemInterpreter::getMessageHeader ( wholenumber_t  code)
static

Return a message header for a given error message.

Parameters
codeThe error code
Returns
The formatted message header

Return a message header for a given error message.

Parameters
codeThe error code
Returns
On Windows, always returns NULL

Definition at line 183 of file unix/ErrorMessages.cpp.

References msgEntry::code, msgEntry::msgid, new_string(), and OREF_NULL.

Referenced by RexxActivity::display().

◆ getMessageHeader() [2/2]

static RexxString* SystemInterpreter::getMessageHeader ( wholenumber_t  code)
static

◆ getMessageText() [1/2]

RexxString * SystemInterpreter::getMessageText ( wholenumber_t  code)
static

Retrieve the message text for a give error code.

Parameters
codeThe Rexx error code
Returns
The error message associated with that code.

Definition at line 102 of file unix/ErrorMessages.cpp.

References CATD_ERR, msgEntry::code, msgEntry::msgid, new_string(), OREF_NULL, REXXMESSAGEFILE, and SECOND_PARAMETER.

Referenced by RexxActivity::buildMessage(), BUILTIN(), RexxActivity::createExceptionObject(), RexxActivation::debugPause(), RexxActivity::display(), RexxActivity::displayDebug(), and RexxActivity::reraiseException().

◆ getMessageText() [2/2]

static RexxString* SystemInterpreter::getMessageText ( wholenumber_t  code)
static

◆ getSourceString() [1/2]

RexxString * SystemInterpreter::getSourceString ( RexxString callType,
RexxString programName 
)
static

◆ getSourceString() [2/2]

static RexxString* SystemInterpreter::getSourceString ( RexxString callType,
RexxString programName 
)
static

◆ getSystemName() [1/2]

RexxString * SystemInterpreter::getSystemName ( )
static

Definition at line 96 of file unix/MiscSystem.cpp.

References new_string().

Referenced by RexxMemory::createImage(), and getInternalSystemName().

◆ getSystemName() [2/2]

static RexxString* SystemInterpreter::getSystemName ( )
static

◆ getSystemVersion() [1/2]

RexxString * SystemInterpreter::getSystemVersion ( )
static

Definition at line 112 of file unix/MiscSystem.cpp.

References new_string().

Referenced by RexxMemory::createImage().

◆ getSystemVersion() [2/2]

static RexxString* SystemInterpreter::getSystemVersion ( )
static

◆ getUserid() [1/2]

RexxString * SystemInterpreter::getUserid ( )
static

Definition at line 64 of file unix/UseridFunction.cpp.

References ACCOUNT_BUFFER_SIZE, and new_string().

Referenced by BUILTIN().

◆ getUserid() [2/2]

static RexxString* SystemInterpreter::getUserid ( )
static

◆ initializeInstance() [1/2]

static void SystemInterpreter::initializeInstance ( InterpreterInstance instance)
static

◆ initializeInstance() [2/2]

static void SystemInterpreter::initializeInstance ( InterpreterInstance instance)
static

◆ invokeExternalFunction() [1/2]

bool SystemInterpreter::invokeExternalFunction ( RexxActivation activation,
RexxActivity activity,
RexxString target,
RexxObject **  arguments,
size_t  argcount,
size_t  named_argcount,
RexxString calltype,
ProtectedObject result 
)
static

◆ invokeExternalFunction() [2/2]

static bool SystemInterpreter::invokeExternalFunction ( RexxActivation ,
RexxActivity ,
RexxString ,
RexxObject **  ,
size_t  ,
size_t  ,
RexxString ,
ProtectedObject  
)
static

◆ live() [1/2]

void SystemInterpreter::live ( size_t  liveMark)
static

Definition at line 166 of file unix/SystemInterpreter.cpp.

Referenced by RexxMemory::live().

◆ live() [2/2]

static void SystemInterpreter::live ( size_t  )
static

◆ liveGeneral() [1/2]

void SystemInterpreter::liveGeneral ( int  reason)
static

Definition at line 170 of file unix/SystemInterpreter.cpp.

References memoryObject, and RexxMemory::savingImage().

Referenced by RexxMemory::liveGeneral().

◆ liveGeneral() [2/2]

static void SystemInterpreter::liveGeneral ( int  reason)
static

◆ loadImage() [1/2]

void SystemInterpreter::loadImage ( char **  imageBuffer,
size_t *  imageSize 
)
static

Load the base image into storage.

Parameters
imageBufferreturned start of the image
imageSizereturned size of the image
Remarks
We pass null to primitiveSearchName(), which has the effect of the Windows API SearchPath() being called with null for the path. When SearchPath is called with null for the path, and there is no path informtion in the file name, the first directory searched is the directory in which the application (rexx.exe) image is located.

Since, on Windows, the base image (rexx.img) is always located in the same directory as rexx.exe, this results in the image being found faster. For development, it prevents the wrong base image being picked up during a compile.

If the image is not found in the application image's directory, the regular executable search, which searches the path, is performed.

Definition at line 142 of file unix/FileSystem.cpp.

References RexxMemory::allocateImageBuffer(), BASEIMAGE, Interpreter::logicError(), memoryObject, and SysFileSystem::primitiveSearchName().

Referenced by RexxMemory::restoreImage().

◆ loadImage() [2/2]

static void SystemInterpreter::loadImage ( char **  imageBuffer,
size_t *  imageSize 
)
static

◆ loadMessage()

bool SystemInterpreter::loadMessage ( wholenumber_t  code,
char *  buffer,
size_t  bufferLength 
)
static

Load a message from the system message resources.

Parameters
codeThe error message identifier.
bufferThe buffer for the returned message.
bufferLengthThe length of th message buffer.
Returns
The success/failure indicator.

Definition at line 117 of file windows/SystemInterpreter.cpp.

References moduleHandle.

◆ popEnvironment() [1/2]

RexxObject * SystemInterpreter::popEnvironment ( RexxActivation context)
static

Pop an environment for the SysEndLocal() BIF.

Parameters
contextThe current activation context.
Returns
Always returns FALSE. This is a NOP on Windows.

Definition at line 409 of file unix/ExternalFunctions.cpp.

References RexxBuffer::getData(), RexxActivation::popEnvironment(), restoreEnvironment(), TheFalseObject, TheNilObject, and TheTrueObject.

Referenced by BUILTIN().

◆ popEnvironment() [2/2]

static RexxObject* SystemInterpreter::popEnvironment ( RexxActivation context)
static

◆ processShutdown() [1/2]

void SystemInterpreter::processShutdown ( )
static

Definition at line 67 of file unix/SystemInterpreter.cpp.

References Interpreter::processStartup().

Referenced by _fini(), and DllMain().

◆ processShutdown() [2/2]

static void SystemInterpreter::processShutdown ( )
static

◆ processSignal()

bool SystemInterpreter::processSignal ( DWORD  dwCtrlType)
static

Process a signal based on current command handler settings.

Parameters
dwCtrlTypeThe type of exception.
Returns
true if we handled the signal, false if it should be passed up the handler chain.

Definition at line 130 of file windows/SystemInterpreter.cpp.

References exceptionConsole, exceptionHostProcess, exceptionHostProcessId, Interpreter::haltAllActivities(), and OREF_NULL.

Referenced by WinConsoleCtrlHandler().

◆ processStartup() [1/2]

void SystemInterpreter::processStartup ( )
static

Definition at line 60 of file unix/SystemInterpreter.cpp.

References Interpreter::processStartup().

Referenced by _init(), and DllMain().

◆ processStartup() [2/2]

void SystemInterpreter::processStartup ( HINSTANCE  mod)
static

◆ pushEnvironment() [1/2]

RexxObject * SystemInterpreter::pushEnvironment ( RexxActivation context)
static

Push a new environment for the SysSetLocal() BIF.

Parameters
contextThe current activation context.
Returns
Returns TRUE if the environment was successfully pushed.

Definition at line 387 of file unix/ExternalFunctions.cpp.

References buildEnvlist(), OREF_NULL, RexxActivation::pushEnvironment(), TheFalseObject, and TheTrueObject.

Referenced by BUILTIN().

◆ pushEnvironment() [2/2]

static RexxObject* SystemInterpreter::pushEnvironment ( RexxActivation context)
static

◆ qualifyFileSystemName() [1/2]

RexxString * SystemInterpreter::qualifyFileSystemName ( RexxString name)
static

◆ qualifyFileSystemName() [2/2]

static RexxString* SystemInterpreter::qualifyFileSystemName ( RexxString name)
static

◆ readProgram() [1/2]

RexxBuffer * SystemInterpreter::readProgram ( const char *  file_name)
static

Definition at line 189 of file unix/FileSystem.cpp.

References RexxBuffer::getData(), new_buffer(), and OREF_NULL.

Referenced by RoutineClass::fromFile(), and RexxSource::initFile().

◆ readProgram() [2/2]

static RexxBuffer* SystemInterpreter::readProgram ( const char *  file_name)
static

◆ releaseResultMemory() [1/2]

◆ releaseResultMemory() [2/2]

static void SystemInterpreter::releaseResultMemory ( void *  )
static

◆ restoreEnvironment() [1/2]

void SystemInterpreter::restoreEnvironment ( void *  CurrentEnv)
static

◆ restoreEnvironment() [2/2]

static void SystemInterpreter::restoreEnvironment ( void *  CurrentEnv)
static

◆ setTimeSliceTimerThread()

static void SystemInterpreter::setTimeSliceTimerThread ( HANDLE  h)
inlinestatic

Definition at line 75 of file windows/SystemInterpreter.hpp.

References timeSliceTimerThread.

Referenced by TimeSliceControl().

◆ startInterpreter() [1/2]

void SystemInterpreter::startInterpreter ( )
static

Definition at line 127 of file unix/SystemInterpreter.cpp.

References signalHandler().

Referenced by Interpreter::startInterpreter().

◆ startInterpreter() [2/2]

static void SystemInterpreter::startInterpreter ( )
static

◆ startTimeSlice()

void SystemInterpreter::startTimeSlice ( )
static

◆ stopTimeSlice()

void SystemInterpreter::stopTimeSlice ( )
static

Definition at line 169 of file windows/TimeSupport.cpp.

References timeSliceTimerThread.

◆ terminateInstance() [1/2]

static void SystemInterpreter::terminateInstance ( InterpreterInstance instance)
static

◆ terminateInstance() [2/2]

static void SystemInterpreter::terminateInstance ( InterpreterInstance instance)
static

◆ terminateInterpreter() [1/2]

void SystemInterpreter::terminateInterpreter ( )
static

Definition at line 157 of file unix/SystemInterpreter.cpp.

Referenced by Interpreter::terminateInterpreter().

◆ terminateInterpreter() [2/2]

static void SystemInterpreter::terminateInterpreter ( )
static

◆ validateAddressName() [1/2]

void SystemInterpreter::validateAddressName ( RexxString name)
static

Validate an external address name.

Parameters
NameThe name to validate

Definition at line 134 of file unix/MiscSystem.cpp.

References Error_Environment_name_name, RexxString::getBLength(), MAX_ADDRESS_NAME_LENGTH, and reportException().

Referenced by RexxInstructionAddress::execute().

◆ validateAddressName() [2/2]

static void SystemInterpreter::validateAddressName ( RexxString name)
static

◆ valueFunction() [1/2]

bool SystemInterpreter::valueFunction ( RexxString name,
RexxObject newValue,
RexxString selector,
RexxObject *&  result 
)
static

Process a value function call for external repositories.

Parameters
NameThe variable name.
NewValueThe new value to assign to that variable.
SelectorThe variable pool selector.
resultThe returned existing value.
Returns
true if this worked, false otherwise.

Definition at line 67 of file unix/ValueFunction.cpp.

References ARG_TWO, RexxString::getStringData(), new_string(), OREF_NULL, SELECTOR, RexxString::strCaselessCompare(), stringArgument(), and TheNilObject.

Referenced by BUILTIN().

◆ valueFunction() [2/2]

static bool SystemInterpreter::valueFunction ( RexxString name,
RexxObject newValue,
RexxString selector,
RexxObject *&  result 
)
static

Member Data Documentation

◆ exceptionConsole

bool SystemInterpreter::exceptionConsole = false
static

Definition at line 102 of file windows/SystemInterpreter.hpp.

Referenced by processSignal(), and systemCommandHandler().

◆ exceptionHostProcess

HANDLE SystemInterpreter::exceptionHostProcess = NULL
static

Definition at line 101 of file windows/SystemInterpreter.hpp.

Referenced by processSignal(), and sysCommandNT().

◆ exceptionHostProcessId

ULONG SystemInterpreter::exceptionHostProcessId = 0
static

Definition at line 100 of file windows/SystemInterpreter.hpp.

Referenced by processSignal(), and sysCommandNT().

◆ explicitConsole

bool SystemInterpreter::explicitConsole = false
static

Definition at line 103 of file windows/SystemInterpreter.hpp.

Referenced by sysCommandNT(), and systemCommandHandler().

◆ moduleHandle

HINSTANCE SystemInterpreter::moduleHandle = 0
staticprotected

Definition at line 108 of file windows/SystemInterpreter.hpp.

Referenced by loadMessage(), and processStartup().

◆ newmask

sigset_t SystemInterpreter::newmask
static

Definition at line 107 of file unix/SystemInterpreter.hpp.

◆ oldmask

sigset_t SystemInterpreter::oldmask
static

Definition at line 106 of file unix/SystemInterpreter.hpp.

◆ signalCount

int SystemInterpreter::signalCount = 0
static

Definition at line 104 of file windows/SystemInterpreter.hpp.

◆ timeSliceTimerThread

HANDLE SystemInterpreter::timeSliceTimerThread = 0
staticprotected

The documentation for this class was generated from the following files: