65 #include "SystemInterpreter.hpp"
179 if (startLine != 0) _source->
adjustLine(startLine, startLine + s->
size() - 1);
226 size_t named_argcount,
234 code->
call(activity,
this, msgname, argPtr, argcount, named_argcount, result);
243 size_t named_argcount,
254 code->
call(activity,
this, msgname, argPtr, argcount, named_argcount, calltype, environment, context, result);
283 RexxObject **named_arglist,
size_t named_argcount)
288 size_t count = args->
size();
297 expectedNamedArguments.
match(named_arglist, named_argcount,
true,
false);
301 size_t named_count = 0;
306 p_named_args_value = named_args_value;
313 named_count = named_args_value->
items();
318 if (named_count != 0)
321 p_new_args = new_args;
338 size_t named_argCount,
353 size_t named_argCount,
384 return envelope->
pack(
this);
400 outBuffer->
strptr = (
char *)data;
412 FILE *handle = fopen(filename,
"wb");
430 metaData.
write(handle, buffer);
436 void *RoutineClass::operator
new (
size_t size)
477 newSourceArray =
new_array(sourceString);
489 for (
size_t counter = 1; counter <= newSourceArray->
size(); counter++)
503 newSourceArray ->
put(sourceString, counter);
507 p_newSourceArray = newSourceArray;
578 for (
size_t counter = 1; counter <= newSourceArray->
size(); counter++)
592 newSourceArray ->
put(sourceString, counter);
605 size_t named_argCount)
621 size_t initCount = 0;
638 sourceContext = ((
RexxMethod *)option)->getSourceObject();
642 sourceContext = ((
RoutineClass *)option)->getSourceObject();
646 sourceContext = ((
PackageClass *)option)->getSourceObject();
656 bool isBlock =
false;
673 newRoutine->
sendMessage(OREF_INIT, init_args, initCount, named_argCount);
737 if (instore[0].strptr == NULL && instore[1].strptr == NULL)
748 if (instore[1].strptr != NULL)
754 if (instore[0].strptr != NULL)
764 if (instore[0].strptr != NULL)
768 if (source_buffer->
getData()[0] ==
'#' && source_buffer->
getData()[1] ==
'!')
770 memcpy(source_buffer->
getData(),
"--", 2);
777 routine->
save(&instore[1]);
813 envelope->
puff(buffer, startPointer, length);
830 const char *data = buffer->
getData();
834 if (data[0] ==
'#' && data[1] ==
'!')
846 bool badVersion =
false;
848 if (!metaData->
validate(badVersion))
873 const char *data = inData->
strptr;
877 if (data[0] ==
'#' && data[1] ==
'!')
892 if (!metaData->
validate(badVersion))
957 descriptor =
stringArgument(descriptor, OREF_positional,
"descriptor");
963 if (((
RexxString *)(_words->
get(1)))->strCompare(CHAR_LIBRARY))
970 if (_words->
size() == 3)
975 else if (_words->
size() == 2)
void reportException(wholenumber_t error)
RexxArray * new_array(size_t s)
RexxBuffer * new_buffer(size_t s)
RexxString * stringArgument(RexxObject *object, RexxString *kind, size_t position)
RexxArray * arrayArgument(RexxObject *object, RexxString *kind, size_t position)
void requiredArgument(RexxObject *object, RexxString *kind, size_t position)
#define Error_Execution_user_defined
#define Error_Translation_bad_external
#define Error_Incorrect_method_no_method
#define Error_Incorrect_method_nostring_inarray
#define Error_Incorrect_method_argType
#define Error_Program_unreadable_name
#define Error_Logical_value_logical_list
#define Error_Program_unreadable_output_error
#define Error_Program_unreadable_version
#define Error_Incorrect_method_noarray
RexxReturnCode REXXENTRY RexxResolveMacroFunction(const char *, PRXSTRING)
#define memory_mark(oref)
RexxObject * new_object(size_t s)
#define flatten_reference(oref, envel)
#define CLASS_CREATE(name, id, className)
#define memory_mark_general(oref)
#define setUpFlatten(type)
RexxString * new_string(const char *s, stringsize_t l)
static RexxActivity *volatile currentActivity
virtual RexxObject * setSecurityManager(RexxObject *manager)
virtual void call(RexxActivity *, RoutineClass *, RexxString *, RexxObject **, size_t, size_t, RexxString *, RexxString *, int, ProtectedObject &)
RexxString * executableName
RexxSource * getSourceObject()
RexxString * getDefaultEnvironment()
void match(RexxObject **namedArglist, size_t namedArgCount, bool strict, bool extraAllowed, size_t minimumRequired=0)
static RoutineClass * loadRoutine(RexxString *packageName, RexxString *function)
RexxSource * getSourceObject()
InterpreterInstance * getInstance()
RexxActivation * getCurrentRexxFrame()
void put(RexxObject *eref, size_t pos)
RexxString * makeString(RexxString *, RexxString *)
RexxObject * get(size_t pos)
static void processNewArgs(RexxObject **, size_t, RexxObject ***, size_t *, size_t, RexxObject **, RexxObject **)
RexxBehaviour * getInstanceBehaviour()
size_t appendAllIndexesItemsTo(RexxArray *array, size_t from)
RexxBuffer * pack(RexxObject *)
void puff(RexxBuffer *, char *, size_t length)
RexxObject * getReceiver()
void setBehaviour(RexxBehaviour *b)
RexxString * makeString()
RexxArray * requestArray()
void sendMessage(RexxString *, RexxArray *, RexxDirectory *, ProtectedObject &)
RexxDirectory * requestDirectory()
void setBufferedSource(RexxBuffer *newSource)
RexxString * getProgramName()
RexxCode * generateCode(bool isMethod)
void adjustLine(size_t, size_t)
void setProgramName(RexxString *name)
void inheritSourceContext(RexxSource *source)
const char * getStringData()
void runProgram(RexxActivity *activity, RexxString *calltype, RexxString *environment, RexxObject **arguments, size_t argCount, size_t named_argCount, ProtectedObject &result)
RexxObject * callRexx(RexxObject **, size_t, size_t)
RexxObject * setSecurityManager(RexxObject *)
static RoutineClass * restoreFromMacroSpace(RexxString *name)
RoutineClass(RexxString *n, BaseCode *_code)
RoutineClass * loadExternalRoutine(RexxString *name, RexxString *descriptor)
void call(RexxActivity *, RexxString *, RexxObject **, size_t, size_t, RexxString *, RexxString *, int, ProtectedObject &)
static RoutineClass * restore(RexxBuffer *, char *, size_t length)
RexxObject * callWithRexx(RexxArray *, RexxObject **, size_t)
void liveGeneral(int reason)
static RoutineClass * processInstore(PRXSTRING instore, RexxString *name)
RoutineClass * newRexx(RexxObject **, size_t, size_t)
static RoutineClass * fromFile(RexxString *filename)
RoutineClass * newFileRexx(RexxString *)
static RoutineClass * newRoutineObject(RexxString *, RexxObject *, RexxObject *, RexxSource *s, bool isBlock)
static void createInstance()
static RexxClass * classInstance
void flatten(RexxEnvelope *)
static RexxArray * words(const char *data, size_t length)
static RexxBuffer * readProgram(const char *file_name)
static void releaseResultMemory(void *)
static const char * strnchr(const char *, size_t n, char ch)
RexxReturnCode REXXENTRY RexxQueryMacro(CONSTANT_STRING, unsigned short *)
#define MAKERXSTRING(r, p, l)