65 #include "SystemInterpreter.hpp"
73 #include "SysDebug.hpp"
224 size_t inputIndex = 0;
225 size_t outputIndex = 1;
226 bool usedArglist =
false;
230 descriptors[0].
type = *argumentTypes;
233 uint16_t *currentType = argumentTypes + 1;
240 if (outputIndex >= maximumArgumentCount)
248 descriptors[outputIndex].
type =
type;
329 if (inputIndex < _argcount && _arglist[inputIndex] !=
OREF_NULL)
467 if (temp != argument)
484 if (temp != argument)
527 if (temp != argument)
601 descriptors[outputIndex].
flags = 0;
660 if (inputIndex < _argcount && !usedArglist)
683 for (
size_t i = 0; i < count; i++)
1140 if (sscanf(string->
getStringData(),
"0x%p", &pointerVal) != 1)
1305 resultObj = this->
result;
1409 resultObj = this->
result;
1462 for (
size_t argindex = 0; argindex < count; argindex++)
1485 argPtr[argindex].
strptr = NULL;
1496 MAKERXSTRING(funcresult, default_return_buffer,
sizeof(default_return_buffer));
1507 functionrc = (int)(*methp)(functionName->
getStringData(), count, argPtr, queuename, &funcresult);
1551 resultObj = this->
result;
1563 if (functionrc == 0)
1565 if (funcresult.
strptr != NULL)
1570 if (funcresult.
strptr != default_return_buffer)
1840 return object->numberValue(temp, this->
digits());
1939 if (
string !=
object)
1944 return string->getStringData();
1961 if (sscanf(string->
getStringData(),
"0x%p", &pointerVal) != 1)
1994 return object->doubleValue(r);
2404 *value = variable_value;
2434 if (condition->
isEqual(OREF_SYNTAX))
2853 void * RexxNativeActivation::operator
new(
size_t size)
2884 retcode |= pshvblock->
shvret;
2885 pshvblock = pshvblock->
shvnext;
2895 retcode |= pshvblock->
shvret;
2913 if (pshvblock->
shvname.strptr == NULL)
3084 if (pshvblock->
shvname.strptr == NULL)
3091 const char *variable = pshvblock->
shvname.strptr;
3093 if (strcmp(variable,
"VERSION") == 0)
3099 else if (strcmp(variable,
"QUENAME") == 0)
3105 else if (strcmp(variable,
"SOURCE") == 0)
3113 else if (strcmp(variable,
"PARM") == 0)
3120 else if (!memcmp(variable,
"PARM.",
sizeof(
"PARM.") - 1))
3127 if (!tail->
numberValue(value_position) || value_position <= 0)
3138 value = OREF_NULLSTRING;
3238 size_t string_length;
3246 if (rxstring->
strptr == NULL)
3249 if (rxstring->
strptr == NULL)
3253 rxstring->
strlength = string_length + 1;
3256 if (string_length > rxstring->
strlength)
3267 if (rxstring->
strlength > string_length)
3270 rxstring->
strptr[string_length] =
'\0';
3274 *length = string_length;
3299 if ((!
isOfClass(StemVariableTerm, retriever)) && (!
isOfClass(CompoundVariableTerm, retriever)))
3307 if (
isOfClass(CompoundVariableTerm, retriever))
3312 while (variable->
getChar(position) !=
'.')
3319 tail = variable->
extract(position, length);
3320 tail = tail->
upper();
3324 return retriever->
sort(
activation, tail, order,
type, start, end, firstcol, lastcol);
3373 _argcount = positionalArgs->
size();
3375 p_arguments = arguments;
3378 _arglist = arguments->
data();
3384 to->
messageSend(msg, _arglist, _argcount, _named_argcount, _result);
3388 to->
messageSend(msg, _arglist, _argcount, _named_argcount, super, _result);
void reportException(wholenumber_t error)
RexxArray * new_array(size_t s)
RexxBuffer * new_buffer(size_t s)
RexxDirectory * new_directory()
RexxIdentityTable * new_identity_table()
RexxInteger * new_integer(wholenumber_t v)
uint16_t *(RexxEntry * PNATIVEMETHOD)(RexxMethodContext *, ValueDescriptor *)
uint16_t *(RexxEntry * PNATIVEROUTINE)(RexxCallContext *, ValueDescriptor *)
RexxPointer * new_pointer(void *p)
RexxString * stringArgument(RexxObject *object, RexxString *kind, size_t position)
bool isString(RexxObject *o)
#define isOfClassType(t, r)
RexxArray * arrayArgument(RexxObject *object, RexxString *kind, size_t position)
#define TheMutableBufferClass
#define Error_Invalid_argument_range
#define Error_Logical_value_method
#define Error_Incorrect_call_signature
#define Error_Incorrect_method_nostem
#define Error_Invalid_argument_noarg
#define Error_Invalid_argument_double
#define Error_Invalid_argument_maxarg
#define Error_Incorrect_method_signature
#define Error_Incorrect_call_nostem
#define Error_Invalid_argument_pointer
#define Error_Invalid_argument_noclass
#define Message_Translations_compiled_routine_invocation
#define Error_Incorrect_call_external
#define Message_Translations_compiled_method_invocation
#define memory_mark(oref)
RexxObject * new_object(size_t s)
#define memory_mark_general(oref)
#define MAX_NATIVE_ARGUMENTS
RexxString * new_string(const char *s, stringsize_t l)
bool isStem(const char *cstring)
virtual void handleError(wholenumber_t, RexxDirectory *)
void setContext(RexxActivity *act, RexxNativeActivation *a)
static RexxActivity *volatile currentActivity
RexxClass * findClass(RexxString *className)
RexxSource * getSourceObject()
virtual void handleError(wholenumber_t, RexxDirectory *)
void setContext(RexxActivity *act, RexxNativeActivation *a)
static RexxString * getVersionNumber()
static RexxClass * findClass(RexxString *className)
static RexxString * getCurrentQueue()
static const wholenumber_t MIN_WHOLENUMBER
static bool objectToUintptr(RexxObject *source, uintptr_t &result)
static NumericSettings * getDefaultSettings()
static RexxObject * stringsizeToObject(stringsize_t v)
static const wholenumber_t MAX_WHOLENUMBER
static const bool DEFAULT_FORM
static bool objectToUnsignedInt64(RexxObject *o, uint64_t &result)
static const size_t MAX_STRINGSIZE
static bool objectToUnsignedInteger(RexxObject *o, size_t &result, size_t max)
static bool objectToWholeNumber(RexxObject *o, wholenumber_t &result, wholenumber_t max, wholenumber_t min)
static RexxObject * int64ToObject(int64_t v)
static const size_t DEFAULT_FUZZ
static bool objectToIntptr(RexxObject *source, intptr_t &result)
static RexxObject * wholenumberToObject(wholenumber_t v)
static bool objectToStringSize(RexxObject *o, stringsize_t &result, stringsize_t max)
static bool objectToSignedInteger(RexxObject *o, ssize_t &result, ssize_t max, ssize_t min)
static RexxString * pointerToString(void *)
static bool objectToInt64(RexxObject *o, int64_t &result)
static RexxObject * uint64ToObject(uint64_t v)
static const size_t DEFAULT_DIGITS
RexxRoutineHandler * getEntry()
RexxActivationBase * previous
virtual bool trap(RexxString *, RexxDirectory *)
RexxObject * getExecutableObject()
BaseExecutable * executable
RexxActivationBase * getPreviousStackFrame()
BaseExecutable * getExecutable()
virtual RexxActivation * findRexxContext()
RexxDirectory * getAllLocalVariables()
RexxString * sourceString()
RexxClass * findClass(RexxString *name)
RexxVariableDictionary * getLocalVariables()
size_t getProgramArgumentCount()
RexxObject * getProgramArgument(size_t position)
RexxObject * getContextObject()
virtual NumericSettings * getNumericSettings()
size_t getActivationLevel()
void restoreActivationLevel(size_t l)
void createMethodContext(MethodContext &context, RexxNativeActivation *owner)
void popStackFrame(bool reply)
RexxString * buildMessage(wholenumber_t, RexxArray *)
void reraiseException(RexxDirectory *)
void createCallContext(CallContext &context, RexxNativeActivation *owner)
SecurityManager * getInstanceSecurityManager()
bool raiseCondition(RexxString *, RexxObject *, RexxString *, RexxObject *, RexxObject *)
RexxActivation * getCurrentRexxFrame()
void put(RexxObject *eref, size_t pos)
RexxString * createCompoundName(RexxString *stemName)
RexxObject * at(RexxString *)
size_t appendAllIndexesItemsTo(RexxArray *array, size_t from)
static RexxDirectory * fromIndexItemArray(RexxObject **arglist, size_t count)
virtual RexxObject * put(RexxObject *, RexxObject *)
virtual RexxObject * remove(RexxObject *key)
virtual RexxObject * getRealValue(RexxActivation *)
void setHasNoReferences()
virtual RexxObject * getValue(RexxActivation *)
RexxCompoundElement * compoundelement
int64_t int64Value(RexxObject *o, size_t position)
void setNextVariable(size_t value)
RexxReturnCode copyValue(RexxObject *value, RXSTRING *rxstring, size_t *length)
RexxReturnCode variablePoolInterface(PSHVBLOCK requests)
void variablePoolSetVariable(PSHVBLOCK pshvblock)
void dropObjectVariable(const char *name)
RexxDirectory * getNamedArguments()
void accessCallerContext()
void disableVariablepool()
RexxVariableDictionary * nextCurrent()
RexxDirectory * conditionObj
BaseExecutable * getRexxContextExecutable()
bool trap(RexxString *, RexxDirectory *)
void callRegisteredRoutine(RoutineClass *routine, RegisteredRoutine *code, RexxString *functionName, RexxObject **list, size_t count, size_t named_count, ProtectedObject &resultObj)
bool isInteger(RexxObject *)
void variablePoolFetchVariable(PSHVBLOCK pshvblock)
bool objectToValue(RexxObject *o, ValueDescriptor *value)
void variablePoolDropVariable(PSHVBLOCK pshvblock)
RexxObject * getContextVariable(const char *name)
RexxArray * getPositionalArguments()
void variablePoolFetchPrivate(PSHVBLOCK pshvblock)
stringsize_t unsignedIntegerValue(RexxObject *o, size_t position, stringsize_t maxValue)
RexxDirectory * getAllContextVariables()
RexxVariableDictionary * methodVariables()
virtual bool isStackBase()
RexxString * getMessageName()
virtual SecurityManager * getSecurityManager()
void dropContextVariable(const char *name)
RexxClass * findClass(RexxString *className)
RexxActivation * activation
void processArguments(size_t argcount, RexxObject **arglist, uint16_t *argumentTypes, ValueDescriptor *descriptors, size_t maximumArgumentCount)
void reportSignatureError()
void setNextCurrent(RexxVariableDictionary *vdict)
wholenumber_t signedIntegerValue(RexxObject *o, size_t position, wholenumber_t maxValue, wholenumber_t minValue)
virtual NumericSettings * getNumericSettings()
RexxVariableBase * variablePoolGetVariable(PSHVBLOCK pshvblock, bool symbolic)
void createLocalReference(RexxObject *objr)
RexxIdentityTable * savelist
void callNativeRoutine(RoutineClass *routine, RexxNativeRoutine *code, RexxString *functionName, RexxObject **list, size_t count, size_t named_count, ProtectedObject &result)
double getDoubleValue(RexxObject *, size_t position)
RexxStem * resolveStemVariable(RexxObject *s)
uint64_t unsignedInt64Value(RexxObject *o, size_t position)
int stemSort(const char *stemname, int order, int type, size_t start, size_t end, size_t firstcol, size_t lastcol)
void setCompoundElement(RexxCompoundElement *element)
void * pointerString(RexxObject *object, size_t position)
virtual RexxActivation * getRexxContext()
RexxDirectory * argDirectory
RexxObject * getRexxContextObject()
void setObjectVariable(const char *name, RexxObject *value)
RexxObject * getObjectVariable(const char *name)
SecurityManager * securityManager
RexxSource * getSourceObject()
RexxObject * valueToObject(ValueDescriptor *value)
void run(RexxMethod *_method, RexxNativeMethod *_code, RexxObject *_receiver, RexxString *_msgname, RexxObject **_arglist, size_t _argcount, size_t _named_argcount, ProtectedObject &resultObj)
ActivationType activationType
void reportStemError(size_t position, RexxObject *object)
bool isDouble(RexxObject *)
void liveGeneral(int reason)
void * pointer(RexxObject *)
RexxVariableDictionary * nextcurrent
void removeLocalReference(RexxObject *objr)
virtual RexxObject * getReceiver()
void variablePoolNextVariable(PSHVBLOCK pshvblock)
virtual RexxActivation * findRexxContext()
RexxVariable * nextStem()
void setContextVariable(const char *name, RexxObject *value)
RexxObject * getPositionalArgument(size_t index)
void raiseCondition(RexxString *condition, RexxString *description, RexxObject *additional, RexxObject *result)
RexxObject * getContextStem(RexxString *name)
void variablePoolRequest(PSHVBLOCK pshvblock)
const char * cstring(RexxObject *)
void setNextStem(RexxVariable *stemVar)
RexxVariableDictionary * objectVariables
StackFrameClass * createStackFrame()
void forwardMessage(RexxObject *to, RexxString *msg, RexxClass *super, RexxArray *positionalArgs, RexxDirectory *namedArgs, ProtectedObject &result)
void setConditionInfo(RexxDirectory *info)
void enableVariablepool()
bool fetchNext(RexxString **name, RexxObject **value)
RexxClass * findCallerClass(RexxString *className)
RexxArray * valuesToObject(ValueDescriptor *value, size_t count)
SecurityManager * getSecurityManager()
PNATIVEROUTINE getEntry()
RexxVariableDictionary * getObjectVariables(RexxObject *)
RexxObject * superScope(RexxObject *)
virtual bool doubleValue(double &result)
RexxString * stringValue()
bool messageSend(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true, bool dynamicTarget=true)
RexxString * requestString()
bool isInstanceOf(RexxClass *)
virtual bool logicalValue(logical_t &)
SecurityManager * getSecurityManager()
RexxCompoundElement * nextVariable(RexxNativeActivation *activation)
bool sort(RexxActivation *context, RexxString *prefix, int order, int type, size_t start, size_t end, size_t firstcol, size_t lastcol)
bool numberValue(wholenumber_t &result, size_t precision)
void toRxstring(CONSTRXSTRING &r)
const char * getStringData()
RexxString * extract(size_t offset, size_t sublength)
RexxString * concatWithCstring(const char *)
bool isEqual(RexxObject *)
bool strCompare(const char *s)
virtual void set(RexxActivation *, RexxObject *)
virtual void drop(RexxActivation *)
static RexxVariableBase * getVariableRetriever(RexxString *variable)
static RexxVariableBase * getDirectVariableRetriever(RexxString *variable)
void reserve(RexxActivity *)
void release(RexxActivity *)
RexxVariable * nextVariable(RexxNativeActivation *)
RexxObject * getVariableValue()
static void * allocateResultMemory(size_t)
static void releaseResultMemory(void *)
virtual void handleError(wholenumber_t, RexxDirectory *)
void setContext(RexxActivity *act, RexxNativeActivation *a)
#define REXX_VALUE_double
#define REXX_VALUE_size_t
#define REXX_VALUE_uint8_t
#define REXX_VALUE_POINTER
#define REXX_VALUE_wholenumber_t
#define IS_OPTIONAL_ARGUMENT(t)
#define REXX_VALUE_stringsize_t
#define REXX_VALUE_int32_t
#define REXX_VALUE_uintptr_t
#define REXX_VALUE_uint32_t
#define REXX_ARGUMENT_TERMINATOR
#define REXX_VALUE_uint64_t
#define REXX_VALUE_RexxMutableBufferObject
#define REXX_VALUE_RexxClassObject
#define REXX_VALUE_ssize_t
#define REXX_VALUE_RexxStemObject
#define REXX_VALUE_uint16_t
#define REXX_VALUE_ARGLIST
#define REXX_VALUE_int8_t
#define REXX_VALUE_RexxArrayObject
#define REXX_VALUE_intptr_t
#define REXX_VALUE_RexxObjectPtr
#define REXX_VALUE_RexxStringObject
#define REXX_VALUE_int64_t
#define REXX_VALUE_int16_t
#define REXX_VALUE_logical_t
#define REXX_VALUE_CSTRING
#define REXX_VALUE_POINTERSTRING
struct _RexxClassObject * RexxClassObject
size_t REXXENTRY RexxRoutineHandler(CONSTANT_STRING, size_t, PCONSTRXSTRING, CONSTANT_STRING, PRXSTRING)
struct _RexxMutableBufferObject * RexxMutableBufferObject
struct _RexxStringObject * RexxStringObject
struct _RexxArrayObject * RexxArrayObject
struct _RexxObjectPtr * RexxObjectPtr
#define MAKERXSTRING(r, p, l)
struct _RexxStemObject * RexxStemObject
CONSTANT_RXSTRING shvname
struct _SHVBLOCK * shvnext
RexxMutableBufferObject value_RexxMutableBufferObject
RexxStringObject value_RexxStringObject
uintptr_t value_uintptr_t
logical_t value_logical_t
POINTER value_POINTERSTRING
wholenumber_t value_wholenumber_t
RexxClassObject value_RexxClassObject
RexxStemObject value_RexxStemObject
union _ValueDescriptor::@26 value
stringsize_t value_stringsize_t
RexxArrayObject value_RexxArrayObject
RexxObjectPtr value_RexxObjectPtr
RexxCallContext threadContext
RexxMethodContext threadContext
ValueDescriptor * arguments
ValueDescriptor * arguments
unsigned __int64 uint64_t