ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

RexxActivity.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel */
40 /* */
41 /* Primitive Activity Class */
42 /* */
43 /* NOTE: activities are an execution time only object. They are never */
44 /* flattened or saved in the image, and hence will never be in old */
45 /* space. Because of this, activities "cheat" and do not use */
46 /* OrefSet to assign values to get better performance. Care must be */
47 /* used to maintain this situation. */
48 /* */
49 /******************************************************************************/
50 #include <stdlib.h>
51 #include <ctype.h>
52 #include "RexxCore.h"
53 #include "StringClass.hpp"
54 #include "StackClass.hpp"
55 #include "RexxActivity.hpp"
56 #include "RexxActivation.hpp"
57 #include "RexxNativeActivation.hpp"
58 #include "MessageClass.hpp"
59 #include "ArrayClass.hpp"
60 #include "TableClass.hpp"
61 #include "DirectoryClass.hpp"
62 #include "SourceFile.hpp"
64 #include "RexxCode.hpp"
65 #include "RexxInstruction.hpp"
66 #include "RexxMemory.hpp"
68 #include "ProtectedObject.hpp"
69 #include "PointerClass.hpp"
70 #include "InterpreterInstance.hpp"
71 #include "ActivityDispatcher.hpp"
72 #include "MessageDispatcher.hpp"
73 #include "Interpreter.hpp"
74 #include "PackageClass.hpp"
75 #include "SystemInterpreter.hpp"
76 #include "ActivationFrame.hpp"
77 #include "StackFrameClass.hpp"
79 
80 const size_t ACT_STACK_SIZE = 20;
81 
86 {
87  bool firstDispatch = true; // some things only occur on subsequent requests
88  /* establish the stack base pointer */
90 
91  for (;;)
92  {
93  // save the actitivation level in case there's an error unwind for an unhandled
94  // exception;
95  size_t activityLevel = 0;
96  // the thread might have terminated for a control stack issue
97  // so make sure checking is turned back on before trying to run
98  // anything
99  this->stackcheck = true;
100 
101  try
102  {
103  this->runsem.wait(); /* wait for run permission */
104  if (this->exit) /* told to exit? */
105  {
106  break; /* we're out of here */
107  }
108  this->requestAccess(); /* now get the kernel lock */
109  // we're already marked as active when first called to keep us from
110  // getting terminated prematurely before we get a chance to run
111  if (!firstDispatch)
112  {
113  this->activate(); // make sure this is marked as active
114  }
115  firstDispatch = false; // we need to activate every time after this
116  activityLevel = getActivationLevel();
117 
118  // if we have a dispatch message set, send it the send message to kick everything off
119  if (dispatchMessage != OREF_NULL)
120  {
122  run(dispatcher);
123  }
124  else
125  {
126 
127  // this is a reply message start, just dispatch the Rexx code
128  this->topStackFrame->dispatch();
129  }
130  }
131  catch (ActivityException) // we've had a termination event, raise an error
132  {
133  // it's possible that we might not have the kernel lock when
134  // control returns to here. Make sure we have it.
136  {
137  this->requestAccess();
138  }
139  this->error();
140  }
141 
142  // make sure we get restored to the same base activation level.
143  restoreActivationLevel(activityLevel);
144  memoryObject.runUninits(); /* run any needed UNINIT methods now */
145 
146  this->deactivate(); // no longer an active activity
147 
148  dispatchMessage = OREF_NULL; // we're done with the message object
149 
150  runsem.reset(); /* reset the run semaphore and the */
151  guardsem.reset(); /* guard semaphore */
152 
153  // try to pool this. If the ActivityManager doesn't take, we go into termination mode
154  if (!instance->poolActivity(this))
155  {
156  this->releaseAccess();
157  break;
158  }
159  // release the kernel lock and go wait for more work
160  this->releaseAccess();
161  }
162  // tell the activity manager we're going away
164  return; /* finished */
165 }
166 
167 
173 {
174  runsem.close();
175  guardsem.close();
177 }
178 
179 
185 {
186  // deactivate the nesting level
187  deactivate();
188  // if we're inactive, try to run any pending uninits
189  if (isInactive())
190  {
192  }
193  // this activity owned the kernel semaphore before entering here...release it
194  // now.
195  releaseAccess();
196 }
197 
202 {
203  /* Activity already existed for this */
204  /* get kernel semophore in activity */
205  requestAccess();
206  activate(); // let the activity know it's in use, potentially nested
207  // belt-and-braces. Make sure the current activity is explicitly set to
208  // this activity before leaving.
210 }
211 
212 
213 void *RexxActivity::operator new(size_t size)
214 /******************************************************************************/
215 /* Function: Create a new activity */
216 /******************************************************************************/
217 {
218  /* get the new activity storage */
219  return new_object(size, T_Activity);
220 }
221 
222 
230 RexxActivity::RexxActivity(bool createThread)
231 {
232  // we need to protect this from garbage collection while constructing.
233  // unfortunately, we can't use ProtectedObject because that requires an
234  // active activity, which we can't guarantee at this point.
235  GlobalProtectedObject p(this);
236 
237  this->clearObject(); /* globally clear the object */
238  /* create an activation stack */
240  this->frameStack.init(); /* initialize the frame stack */
241  this->runsem.create(); /* create the run and */
242  this->guardsem.create(); /* guard semaphores */
243  this->activationStackSize = ACT_STACK_SIZE; /* set the activation stack size */
244  this->stackcheck = true; /* start with stack checking enabled */
245  /* use default settings set */
246  /* set up current usage set */
248  this->generateRandomNumberSeed(); /* get a fresh random seed */
249  /* Create table for progream being */
250  this->requiresTable = new_table(); /*installed vial ::REQUIRES */
251  // create a stack frame for this running context
253 
254  if (createThread) /* need to create a thread? */
255  {
256  runsem.reset(); /* set the run semaphore */
257  // we need to enter this thread already marked as active, otherwise
258  // the main thread might shut us down before we get a chance to perform
259  // whatever function we're getting asked to run.
260  activate();
261  /* create a thread */
263  }
264  else /* thread already exists */
265  {
266  // run on the current thread
268  /* establish the stack base pointer */
270  }
271 }
272 
273 
279 {
280  /* Make sure any left over */
281  /* ::REQUIRES is cleared out. */
282  this->resetRunningRequires();
283 }
284 
285 
293 {
294  // recreate a new activiy in the same instance
295  return instance->spawnActivity(this);
296 }
297 
299 /******************************************************************************/
300 /* Function: Generate a fresh random number seed. */
301 /******************************************************************************/
302 {
303  // a good random value for a starting point would be the address of the
304  // activity.
305  uint64_t rnd = (uint64_t)(uintptr_t)this;
306  // flip the bits to generate a little more noise. This value is
307  // largely to ensure that the timestamp value doesn't produce similar
308  // seeds because of low timer resolution.
309  rnd = ~rnd;
310 
311  RexxDateTime timestamp; /* current timestamp */
312  SystemInterpreter::getCurrentTime(&timestamp); /* get a fresh time stamp */
313  /* take the seed from the time */
314  randomSeed = rnd + timestamp.getBaseTime();
315  for (int i = 0; i < 13; i++)
316  { /* randomize the seed number a bit */
317  /* scramble the seed a bit */
319  }
320 }
321 
322 
324 /******************************************************************************/
325 /* Function: Force error termination on an activity, returning the resulting */
326 /* REXX error code. */
327 /******************************************************************************/
328 {
329  // unwind to a base activation
330  while (!topStackFrame->isStackBase())
331  {
332  // if we're not to the stack very base of the stack, terminate the frame
333  this->topStackFrame->termination();
334  this->popStackFrame(false);
335  }
336 
337  // go display
338  return displayCondition(this->conditionobj);
339 }
340 
341 
343 /******************************************************************************/
344 /* Function: Force error termination on an activity, returning the resulting */
345 /* REXX error code. */
346 /******************************************************************************/
347 {
348  // if not passed an explicit error object, use whatever we have in our
349  // local holder.
350  if (errorInfo == OREF_NULL)
351  {
352  errorInfo = this->conditionobj;
353  }
354 
355  // unwind to a base activation
356  while (topStackFrame != activation)
357  {
358  // if we're not to the stack very base of the stack, terminate the frame
359  this->topStackFrame->termination();
360  this->popStackFrame(false);
361  }
362 
363  // go display
364  return displayCondition(errorInfo);
365 }
366 
377 {
378  // no condition object? This is a nop
379  if (errorInfo == OREF_NULL)
380  {
381  return 0; // no error condition to return
382  }
383 
384  RexxString *condition = (RexxString *)errorInfo->at(OREF_CONDITION);
385  // we only display syntax conditions
386  if (condition == OREF_NULL || !condition->isEqual(OREF_SYNTAX))
387  {
388  return 0; // no error condition to return
389  }
390  // display the information
391  this->display(errorInfo);
392 
393  wholenumber_t rc = Error_Interpretation/1000; /* set default return code */
394  // try to convert. Leaves unchanged if not value
395  errorInfo->at(OREF_RC)->numberValue(rc);
396  return rc; /* return the error code */
397 }
398 
399 
409 {
410  wholenumber_t rc = Error_Interpretation/1000; /* set default return code */
411  /* did we get a condtion object? */
412  if (conditionObject != OREF_NULL)
413  {
414  // try to convert. Leaves unchanged if not value
415  conditionObject->at(OREF_RC)->numberValue(rc);
416  }
417  return rc; /* return the error code */
418 }
419 
420 
434 bool RexxActivity::raiseCondition(RexxString *condition, RexxObject *rc, RexxString *description, RexxObject *additional, RexxObject *result)
435 {
436  // just create a condition object and process the traps.
437  RexxDirectory *conditionObj = createConditionObject(condition, rc, description, additional, result);
438  return raiseCondition(conditionObj);
439 }
440 
452 {
453  bool handled = false; /* condition not handled yet */
454  RexxString *condition = (RexxString *)conditionObj->at(OREF_CONDITION);
455 
456  /* invoke the error traps, on all */
457  /* nativeacts until reach 1st */
458  /* also give 1st activation a shot. */
459  for (RexxActivationBase *activation = this->getTopStackFrame() ; !activation->isStackBase(); activation = activation->getPreviousStackFrame())
460  {
461  handled = activation->trap(condition, conditionObj);
462  if (isOfClass(Activation, activation)) /* reached our 1st activation yet. */
463  {
464  break; /* yes, break out of loop */
465  }
466  }
467 
468  /* Control will not return here if the condition was trapped via*/
469  /* SIGNAL ON SYNTAX. For CALL ON conditions, handled will be */
470  /* true if a trap is pending. */
471 
472  return handled; /* this has been handled */
473 }
474 
475 
489 {
490  // condition objects are directories
491  RexxDirectory *conditionObj = new_directory();
492  ProtectedObject p(conditionObj);
493  /* put in the condition name */
494  conditionObj->put(condition, OREF_CONDITION);
495  /* fill in default description */
496  conditionObj->put(description == OREF_NULL ? OREF_NULLSTRING : description, OREF_DESCRIPTION);
497  /* fill in the propagation status */
498  conditionObj->put(TheFalseObject, OREF_PROPAGATED);
499  if (rc != OREF_NULL) /* have an RC value? */
500  {
501  conditionObj->put(rc, OREF_RC); /* add to the condition argument */
502  }
503  if (additional != OREF_NULL) /* or additional information */
504  {
505  conditionObj->put(additional, OREF_ADDITIONAL);
506  }
507  if (result != OREF_NULL) /* given a return result? */
508  {
509  conditionObj->put(result, OREF_RESULT);
510  }
511 
512  // add in all location-specific information
513  generateProgramInformation(conditionObj);
514  return conditionObj;
515 }
516 
518  wholenumber_t errcode ) /* REXX error code */
519 /******************************************************************************/
520 /* Function: Forward on an exception condition */
521 /******************************************************************************/
522 {
523  /* send along with nothing */
524  this->raiseException(errcode, OREF_NULL, OREF_NULL, OREF_NULL);
525 }
526 
528  wholenumber_t errcode, /* REXX error code */
529  RexxObject *substitution1 ) /* substitution information */
530 /******************************************************************************/
531 /* Function: Forward on an exception condition */
532 /******************************************************************************/
533 {
534  this->raiseException(errcode, OREF_NULL, new_array(substitution1), OREF_NULL);
535 }
536 
538  wholenumber_t errcode, /* REXX error code */
539  RexxObject *substitution1, /* substitution information */
540  RexxObject *substitution2 ) /* substitution information */
541 /******************************************************************************/
542 /* Function: Forward on an exception condition */
543 /******************************************************************************/
544 {
545  this->raiseException(errcode, OREF_NULL, new_array(substitution1, substitution2), OREF_NULL);
546 }
547 
549  wholenumber_t errcode, /* REXX error code */
550  RexxObject *substitution1, /* substitution information */
551  RexxObject *substitution2, /* substitution information */
552  RexxObject *substitution3 ) /* substitution information */
553 /******************************************************************************/
554 /* Function: Forward on an exception condition */
555 /******************************************************************************/
556 {
557  this->raiseException(errcode, OREF_NULL, new_array(substitution1, substitution2, substitution3), OREF_NULL);
558 }
559 
561  wholenumber_t errcode, /* REXX error code */
562  RexxObject *substitution1, /* substitution information */
563  RexxObject *substitution2, /* substitution information */
564  RexxObject *substitution3, /* substitution information */
565  RexxObject *substitution4 ) /* substitution information */
566 /******************************************************************************/
567 /* Function: Forward on an exception condition */
568 /******************************************************************************/
569 {
570  this->raiseException(errcode, OREF_NULL, new_array(substitution1, substitution2, substitution3, substitution4), OREF_NULL);
571 }
572 
574  wholenumber_t errcode, /* REXX error code */
575  const char *substitution1, /* substitution information */
576  RexxObject *substitution2, /* substitution information */
577  const char *substitution3, /* substitution information */
578  RexxObject *substitution4 ) /* substitution information */
579 /******************************************************************************/
580 /* Function: Forward on an exception condition */
581 /******************************************************************************/
582 {
583  this->raiseException(errcode, OREF_NULL, new_array(new_string(substitution1), substitution2, new_string(substitution3), substitution4), OREF_NULL);
584 }
585 
587  wholenumber_t errcode, /* REXX error code */
588  const char *string ) /* single string sustitution parm */
589 /******************************************************************************/
590 /* Function: Raise an error using a single REXX character string only */
591 /* as a substitution parameter */
592 /******************************************************************************/
593 {
594  /* convert and forward along */
595  this->reportAnException(errcode, new_string(string));
596 }
597 
598 
600  wholenumber_t errcode, /* REXX error code */
601  const char *string1,
602  const char *string2)
603 /******************************************************************************/
604 /* Function: Raise an error using a single REXX character string only */
605 /* as a substitution parameter */
606 /******************************************************************************/
607 {
608  /* convert and forward along */
609  this->reportAnException(errcode, new_string(string1), new_string(string2));
610 }
611 
613  wholenumber_t errcode, /* REXX error code */
614  const char *string, /* single string sustitution parm */
615  wholenumber_t integer ) /* single integer substitution parm */
616 /******************************************************************************/
617 /* Function: Raise an error using a single REXX character string only */
618 /* as a substitution parameter */
619 /******************************************************************************/
620 {
621  /* convert and forward along */
622  this->reportAnException(errcode, new_string(string), new_integer(integer));
623 }
624 
626  wholenumber_t errcode, /* REXX error code */
627  const char *string, /* string value sustitution parm */
628  wholenumber_t integer, /* single integer substitution parm */
629  RexxObject *obj) /* and object sub parm */
630 /******************************************************************************/
631 /* Function: Raise an error using a single REXX character string only */
632 /* as a substitution parameter */
633 /******************************************************************************/
634 {
635  /* convert and forward along */
636  this->reportAnException(errcode, new_string(string), new_integer(integer), obj);
637 }
638 
640  wholenumber_t errcode, /* REXX error code */
641  const char *string, /* string value sustitution parm */
642  RexxObject *obj, /* and object sub parm */
643  wholenumber_t integer) /* single integer substitution parm */
644 /******************************************************************************/
645 /* Function: Raise an error using a single REXX character string only */
646 /* as a substitution parameter */
647 /******************************************************************************/
648 {
649  /* convert and forward along */
650  this->reportAnException(errcode, new_string(string), obj, new_integer(integer));
651 }
652 
654  wholenumber_t errcode, /* REXX error code */
655  RexxObject *obj, /* and object sub parm */
656  wholenumber_t integer) /* single integer substitution parm */
657 /******************************************************************************/
658 /* Function: Raise an error using a single REXX character string only */
659 /* as a substitution parameter */
660 /******************************************************************************/
661 {
662  /* convert and forward along */
663  this->reportAnException(errcode, obj, new_integer(integer));
664 }
665 
667  wholenumber_t errcode, /* REXX error code */
668  RexxObject *obj, /* and object sub parm */
669  const char *string) /* string value sustitution parm */
670 /******************************************************************************/
671 /* Function: Raise an error using a single REXX character string only */
672 /* as a substitution parameter */
673 /******************************************************************************/
674 {
675  /* convert and forward along */
676  this->reportAnException(errcode, obj, new_string(string));
677 }
678 
680  wholenumber_t errcode, /* REXX error code */
681  const char *string, /* string value sustitution parm */
682  RexxObject *obj) /* and object sub parm */
683 /******************************************************************************/
684 /* Function: Raise an error using a single REXX character string only */
685 /* as a substitution parameter */
686 /******************************************************************************/
687 {
688  /* convert and forward along */
689  this->reportAnException(errcode, new_string(string), obj);
690 }
691 
693  wholenumber_t errcode, /* REXX error code */
694  wholenumber_t integer ) /* single integer substitution parm */
695 /******************************************************************************/
696 /* Function: Raise an error using a single REXX integer value only */
697 /* as a substitution parameter */
698 /******************************************************************************/
699 {
700  /* convert and forward along */
701  this->reportAnException(errcode, new_integer(integer));
702 }
703 
705  wholenumber_t errcode, /* REXX error code */
706  wholenumber_t integer, /* single integer substitution parm */
707  wholenumber_t integer2) /* single integer substitution parm */
708 /******************************************************************************/
709 /* Function: Raise an error using a single REXX integer value only */
710 /* as a substitution parameter */
711 /******************************************************************************/
712 {
713  /* convert and forward along */
714  this->reportAnException(errcode, new_integer(integer), new_integer(integer2));
715 }
716 
718  wholenumber_t errcode, /* REXX error code */
719  wholenumber_t a1, /* single integer substitution parm */
720  RexxObject * a2) /* single object substitution parm */
721 /******************************************************************************/
722 /* Function: Raise an error using a single REXX integer value only */
723 /* as a substitution parameter */
724 /******************************************************************************/
725 {
726  /* convert and forward along */
727  this->reportAnException(errcode, new_integer(a1), a2);
728 }
729 
730 
740 void RexxActivity::raiseException(wholenumber_t errcode, RexxString *description, RexxArray *additional, RexxObject *result)
741 /******************************************************************************/
742 /* This routine is used for SYNTAX conditions only. */
743 /* */
744 /* The inserts are passed as objects because that happens to be more */
745 /* convenient for the calling code in the two cases where this facility */
746 /* is used. */
747 /* */
748 /* NOTE: The building of the excepption obejct (EXOBJ) has been re-arranged */
749 /* so that a garbage collection in the middle of building traceBack/etc */
750 /* doesn't clean up the newly built objects. SO we create exobj early on */
751 /* save it, and add newlly built objects to exobj as we go. */
752 /******************************************************************************/
753 {
754  // during error processing, we need to request the string value of message
755  // substitution objects. It is possible that the string process will also
756  // cause a syntax error, resulting in a recursion loop. We snip that off here,
757  // by disallowing a nested error condition.
758  if (requestingString)
759  {
760  throw RecursiveStringError;
761  }
762 
763  RexxActivationBase *topFrame = this->getTopStackFrame();
764 
765  RexxActivation *activation = this->getCurrentRexxFrame(); /* get the current activation */
766  // if we're raised within a real Rexx context, we need to deal with forwarded
767  // frames
768  if (topFrame == activation)
769  {
770  // unwind the stack until we find
771  while (activation != OREF_NULL && activation->isForwarded())
772  {
773  // terminate and remove this stack frame
774  popStackFrame(activation);
775  // grab the new current frame
776  activation = this->getCurrentRexxFrame();
777  }
778  }
779  else {
780  activation = NULL; // raised from a native context, don't add to stack trace
781  }
782 
783  this->conditionobj = createExceptionObject(errcode, description, additional, result);
784 
785  /* process as common condition */
786  if (!this->raiseCondition(conditionobj))
787  {
788  /* fill in the propagation status */
789  conditionobj->put(TheTrueObject, OREF_PROPAGATED);
790  // if we have an Rexx context to work with, unwind to that point,
791  if (activation != OREF_NULL)
792  {
793  // unwind the frame to this point
794  unwindToFrame(activation);
795  popStackFrame(activation); // remove it from the stack
796  }
797  this->raisePropagate(conditionobj); /* pass on down the chain */
798  }
799 }
800 
801 
814  RexxString *description, RexxArray *additional, RexxObject *result )
815 /******************************************************************************/
816 /* This routine is used for SYNTAX conditions only. */
817 /* */
818 /* The inserts are passed as objects because that happens to be more */
819 /* convenient for the calling code in the two cases where this facility */
820 /* is used. */
821 /* */
822 /* NOTE: The building of the exception obejct (EXOBJ) has been re-arranged */
823 /* so that a garbage collection in the middle of building traceBack/etc */
824 /* doesn't clean up the newly built objects. SO we create exobj early on */
825 /* save it, and add newly built objects to exobj as we go. */
826 /******************************************************************************/
827 {
828  /* All error detection done. we can */
829  /* build and save exobj now. */
830  /* get an exception directory */
832  // this is the anchor for anything else
833  ProtectedObject p(exobj);
834 
835  wholenumber_t primary = (errcode / 1000) * 1000; /* get the primary message number */
836 
837  char work[32];
838  /* format the number (string) into */
839  /* work buffer. */
840  sprintf(work,"%d.%1d", errcode/1000, errcode - primary);
841  RexxString *code = new_string(work); /* get the formatted code */
842  exobj->put(code, OREF_CODE);
843 
844  wholenumber_t newVal = primary/1000;
845  RexxInteger *rc = new_integer(newVal); /* get the primary message number */
846  exobj->put(rc, OREF_RC); /* add the return code */
847  /* get the primary message text */
848  RexxString *errortext = SystemInterpreter::getMessageText(primary);
849  if (errortext == OREF_NULL) /* no corresponding message */
850  {
851  /* this is an error */
853  }
854  exobj->put(errortext, OREF_ERRORTEXT);
855 
856  // handle the message substitution values (raw form)
857  if (additional == OREF_NULL)
858  {
859  /* use a zero size array */
860  additional = new_array((size_t)0);
861  }
862  // add this in
863  exobj->put(additional, OREF_ADDITIONAL);
864 
865  if (primary != errcode) /* have a secondary message to issue?*/
866  {
867  /* retrieve the secondary message */
868  RexxString *message = buildMessage(errcode, additional);
869  /* replace the original message text */
870  exobj->put(message, OREF_NAME_MESSAGE);
871  }
872  else
873  {
874  /* don't give a secondary message */
875  /* fill in the decimal error code */
876  exobj->put(TheNilObject, OREF_NAME_MESSAGE);
877  }
878 
879  // the description string (rare for exceptions)
880  if (description == OREF_NULL) /* no description? */
881  {
882  // use an explicit null string
883  exobj->put(OREF_NULLSTRING, OREF_DESCRIPTION);
884  }
885  else
886  {
887  exobj->put(description, OREF_DESCRIPTION);
888  }
889 
890  if (result != OREF_NULL)
891  {
892  exobj->put(result, OREF_RESULT);
893  }
894 
895  // add in all location-specific information
897 
898  // the condition name is always SYNTAX
899  exobj->put(OREF_SYNTAX, OREF_CONDITION);
900  /* fill in the propagation status */
901  exobj->put(TheFalseObject, OREF_PROPAGATED);
902 
903  return exobj;
904 }
905 
906 
913 {
914  // create lists for both the stack frames and the traceback lines
915  RexxList *stackFrames = new_list();
916  /* add to the exception object */
917  exobj->put(stackFrames, OREF_STACKFRAMES);
918 
919  RexxList *traceback = new_list(); /* create a traceback list */
920  /* add to the exception object */
921  exobj->put(traceback, OREF_TRACEBACK);
922 
924 
925  RexxSource *source = OREF_NULL;
926  StackFrameClass *firstFrame = OREF_NULL;
927 
928  while (frame != NULL)
929  {
930  StackFrameClass *stackFrame = frame->createStackFrame();
931  // save the topmost source object we can find for error reporting
932  if (source == OREF_NULL && frame->getSource() != OREF_NULL)
933  {
934  firstFrame = stackFrame;
935  source = frame->getSource();
936  }
937  stackFrames->append(stackFrame);
938  traceback->append(stackFrame->getTraceLine());
939  frame = frame->next;
940  }
941 
942  if (firstFrame != OREF_NULL)
943  {
944  RexxObject *lineNumber = firstFrame->getLine();
945  if (lineNumber != TheNilObject)
946  {
947  // add the line number information
948  exobj->put(lineNumber, OREF_POSITION);
949  }
950  }
951 
952  // if we have source, and this is not part of the interpreter image,
953  // add program information
954  if (source != OREF_NULL && !source->isOldSpace()) /* have source for this? */
955  {
956  exobj->put(source->getProgramName(), OREF_PROGRAM);
957  exobj->put(source->getPackage(), OREF_PACKAGE);
958  }
959  else
960  {
961  // if not available, then this is explicitly a NULLSTRING.
962  exobj->put(OREF_NULLSTRING, OREF_PROGRAM);
963  }
964 }
965 
966 
977 {
978  // create lists for both the stack frames and the traceback lines
979  RexxArray *stackFrames = new_array((size_t)0);
980  ProtectedObject p(stackFrames);
981 
983 
984  while (frame != NULL)
985  {
986  // if asked to skip the first frame, just turn the flag off
987  // and go around again
988  if (skipFirst)
989  {
990  skipFirst = false;
991  }
992  else {
993  StackFrameClass *stackFrame = frame->createStackFrame();
994  stackFrames->append(stackFrame);
995  }
996  frame = frame->next;
997  }
998  return stackFrames;
999 }
1000 
1012 {
1013  /* retrieve the secondary message */
1014  RexxString *message = SystemInterpreter::getMessageText(messageCode);
1015  if (message == OREF_NULL) /* no corresponding message */
1016  {
1017  /* this is an error */
1019  }
1020  /* do required substitutions */
1021  return messageSubstitution(message, substitutions);
1022 }
1023 
1024 
1026  RexxString *message, /* REXX error message */
1027  RexxArray *additional ) /* substitution information */
1028 /******************************************************************************/
1029 /* Function: Perform any required message substitutions on the secondary */
1030 /* error message. */
1031 /******************************************************************************/
1032 {
1033  size_t substitutions = additional->size(); /* get the substitution count */
1034  RexxString *newmessage = OREF_NULLSTRING; /* start with a null string */
1035  /* loop through and substitute values*/
1036  for (size_t i = 1; i <= substitutions; i++)
1037  {
1038  /* search for a substitution */
1039  size_t subposition = message->pos(OREF_AND, 0);
1040  if (subposition == 0) /* not found? */
1041  {
1042  break; /* get outta here... */
1043  }
1044  /* get the leading part */
1045  RexxString *front = message->extract(0, subposition - 1);
1046  /* pull off the remainder */
1047  RexxString *back = message->extract(subposition + 1, message->getLength() - (subposition + 1));
1048  /* get the descriptor position */
1049  size_t selector = message->getChar(subposition);
1050  /* not a good number? */
1051  RexxString *stringVal = OREF_NULLSTRING;
1052  if (selector < '0' || selector > '9')
1053  {
1054  /* use a default message */
1055  stringVal = new_string("<BAD MESSAGE>"); /* must be stringValue, not value, otherwise trap */
1056  }
1057  else
1058  {
1059  selector -= '0'; /* convert to a number */
1060  // still in range?
1061  if (selector <= substitutions) /* out of our range? */
1062  {
1063  RexxObject *value = additional->get(selector);
1064  if (value != OREF_NULL) /* have a value? */
1065  {
1066  /* set the reentry flag */
1067  this->requestingString = true;
1068  this->stackcheck = false; /* disable the checking */
1069  // save the actitivation level in case there's an error unwind for an unhandled
1070  // exception;
1071  size_t activityLevel = getActivationLevel();
1072  /* now protect against reentry */
1073  try
1074  {
1075  /* force to character form */
1076  stringVal = value->stringValue();
1077  }
1078  catch (ActivityException)
1079  {
1080  stringVal = value->defaultName();
1081  }
1082 
1083  // make sure we get restored to the same base activation level.
1084  restoreActivationLevel(activityLevel);
1085  /* we're safe again */
1086  this->requestingString = false;
1087  this->stackcheck = true; // reenable the checking
1088  }
1089  }
1090  }
1091  /* accumulate the front part */
1092  newmessage = newmessage->concat(front->concat(stringVal));
1093  message = back; /* replace with the remainder */
1094  }
1095  /* add on any remainder */
1096  newmessage = newmessage->concat(message);
1097  return newmessage; /* return the message */
1098 }
1099 
1106 {
1107  RexxActivation *activation = this->getCurrentRexxFrame();/* get the current activation */
1108  /* have a target activation? */
1109  if (activation != OREF_NULL)
1110  {
1111  RexxSource *source = activation->getSourceObject();
1112  // set the position and program name
1113  exobj->put(new_integer(activation->currentLine()), OREF_POSITION);
1114  exobj->put(source->getProgramName(), OREF_PROGRAM);
1115  exobj->put(source->getPackage(), OREF_PACKAGE);
1116  }
1117  else
1118  {
1119  exobj->remove(OREF_POSITION); /* remove the position */
1120  exobj->remove(OREF_PROGRAM); /* remove the program name */
1121  exobj->remove(OREF_PACKAGE); /* remove the program name */
1122  }
1123 
1124  RexxObject *errorcode = exobj->at(OREF_CODE); /* get the error code */
1125  /* convert to a decimal */
1126  wholenumber_t errornumber = Interpreter::messageNumber((RexxString *)errorcode);
1127  /* get the primary message number */
1128  wholenumber_t primary = (errornumber / 1000) * 1000;
1129  if (errornumber != primary)
1130  { /* have an actual secondary message? */
1131  char work[10]; /* temp buffer for formatting */
1132  /* format the number (string) into */
1133  /* work buffer. */
1134  sprintf(work,"%1d%3.3d", errornumber/1000, errornumber - primary);
1135  errornumber = atol(work); /* convert to a long value */
1136  /* retrieve the secondary message */
1137  RexxString *message = SystemInterpreter::getMessageText(errornumber);
1138  /* Retrieve any additional parameters*/
1139  RexxArray *additional = (RexxArray *)exobj->at(OREF_ADDITIONAL);
1140  /* do required substitutions */
1141  message = this->messageSubstitution(message, additional);
1142  /* replace the original message text */
1143  exobj->put(message, OREF_NAME_MESSAGE);
1144  }
1145  this->raisePropagate(exobj); /* pass on down the chain */
1146 }
1147 
1149  RexxDirectory *conditionObj ) /* condition descriptive information */
1150 /******************************************************************************/
1151 /* Function: Propagate a condition down the chain of activations */
1152 /******************************************************************************/
1153 {
1154  /* get the condition */
1155  RexxString *condition = (RexxString *)conditionObj->at(OREF_CONDITION);
1156  RexxActivationBase *activation = getTopStackFrame(); /* get the current activation */
1157 
1158  /* loop to the top of the stack */
1159  while (activation != OREF_NULL)
1160  {
1161  /* give this one a chance to trap */
1162  /* (will never return for trapped */
1163  /* PROPAGATE conditions) */
1164  activation->trap(condition, conditionObj);
1165  /* this is a propagated condition */
1166  conditionObj->put(TheTrueObject, OREF_PROPAGATED);
1167  // if we've unwound to the stack base and not been trapped, we need
1168  // to fall through to the kill processing. The stackbase should have trapped
1169  // this. We never cleanup the stackbase activation though.
1170  if (activation->isStackBase())
1171  {
1172  break;
1173  }
1174  // clean up this stack frame
1175  popStackFrame(activation);
1176  activation = this->getTopStackFrame(); /* get the sender's sender */
1177  }
1178  /* now kill the activity, using the */
1179  this->kill(conditionObj); /* imbedded description object */
1180 }
1181 
1183  /* display exception object info */
1184  /* target exception object */
1185 /******************************************************************************/
1186 /* Function: Display information from an exception object */
1187 /******************************************************************************/
1188 {
1189  /* get the traceback info */
1190  RexxList *trace_backList = (RexxList *)exobj->at(OREF_TRACEBACK);
1191  if (trace_backList != OREF_NULL) /* have a traceback? */
1192  {
1193  /* convert to an array */
1194  RexxArray *trace_back = trace_backList->makeArray();
1195  ProtectedObject p(trace_back);
1196  /* get the traceback size */
1197  size_t tracebackSize = trace_back->size();
1198 
1199  for (size_t i = 1; i <= tracebackSize; i++) /* loop through the traceback starttrc */
1200  {
1201  RexxString *text = (RexxString *)trace_back->get(i);
1202  /* have a real line? */
1203  if (text != OREF_NULL && text != TheNilObject)
1204  {
1205  /* write out the line */
1206  this->traceOutput(currentRexxFrame, text);
1207  }
1208  }
1209  }
1210  RexxObject *rc = exobj->at(OREF_RC); /* get the error code */
1211  /* get the message number */
1213  /* get the header */
1215  if (text == OREF_NULL) /* no header available? */
1216  {
1217  /* get the leading part */
1219  }
1220  else /* add to the message text */
1221  {
1223  }
1224  /* get the name of the program */
1225  RexxString *programname = (RexxString *)exobj->at(OREF_PROGRAM);
1226  /* add on the error number */
1227  text = text->concatWith(REQUEST_STRING(rc), ' ');
1228  /* if program exists, add the name */
1229  /* of the program to the message */
1230  if (programname != OREF_NULL && programname != OREF_NULLSTRING)
1231  {
1232  /* add on the "running" part */
1234  /* add on the program name */
1235  text = text->concatWith(programname, ' ');
1236  /* Get the position/Line number info */
1237  RexxObject *position = exobj->at(OREF_POSITION);
1238  if (position != OREF_NULL) /* Do we have position/Line no info? */
1239  {
1240  /* Yes, add on the "line" part */
1242  /* add on the line number */
1243  text = text->concatWith(REQUEST_STRING(position), ' ');
1244  /* add on the ": " */
1245  }
1246  }
1247  text = text->concatWithCstring(": ");
1248  /* and finally the error message */
1249  text = text->concat((RexxString *)exobj->at(OREF_ERRORTEXT));
1250  /* write out the line */
1251  this->traceOutput(currentRexxFrame, text);
1252  /* get the secondary message */
1253  RexxString *secondary = (RexxString *)exobj->at(OREF_NAME_MESSAGE);
1254  /* have a real message? */
1255  if (secondary != OREF_NULL && secondary != (RexxString *)TheNilObject)
1256  {
1257  rc = exobj->at(OREF_CODE); /* get the error code */
1258  /* get the message number */
1259  errorCode = Interpreter::messageNumber((RexxString *)rc);
1260  /* get the header */
1261  text = SystemInterpreter::getMessageHeader(errorCode);
1262  if (text == OREF_NULL) /* no header available? */
1263  {
1264  /* get the leading part */
1266  }
1267  else /* add to the message text */
1268  {
1270  }
1271  /* add on the error number */
1272  text = text->concatWith((RexxString *)rc, ' ');
1273  /* add on the ": " */
1274  text = text->concatWithCstring(": ");
1275  /* and finally the error message */
1276  text = text->concat(secondary);
1277  /* write out the line */
1278  this->traceOutput(currentRexxFrame, text);
1279  }
1280  return TheNilObject; /* just return .nil */
1281 }
1282 
1284  /* display exception object info */
1285  /* target exception object */
1286 /******************************************************************************/
1287 /* Function: Display information from an exception object */
1288 /******************************************************************************/
1289 {
1290  RexxString *secondary; /* secondary message */
1291  RexxString *text; /* constructed final message */
1292 
1293  /* get the leading part */
1295  /* add on the error number */
1296  text = text->concatWith(REQUEST_STRING(exobj->at(OREF_RC)), ' ');
1297  /* add on the ": " */
1298  text = text->concatWithCstring(": ");
1299  /* and finally the error message */
1300  text = text->concatWith((RexxString *)exobj->at(OREF_ERRORTEXT), ' ');
1301  /* write out the line */
1302  this->traceOutput(currentRexxFrame, text);
1303  /* get the secondary message */
1304  secondary = (RexxString *)exobj->at(OREF_NAME_MESSAGE);
1305  /* have a real message? */
1306  if (secondary != OREF_NULL && secondary != (RexxString *)TheNilObject) {
1307  /* get the leading part */
1309  /* add on the error number */
1310  text = text->concatWith((RexxString *)exobj->at(OREF_CODE), ' ');
1311  /* add on the ": " */
1312  text = text->concatWithCstring(": ");
1313  /* and finally the error message */
1314  text = text->concat(secondary);
1315  /* write out the line */
1316  this->traceOutput(getCurrentRexxFrame(), text);
1317  }
1318  return TheNilObject; /* just return .nil */
1319 }
1320 
1321 void RexxActivity::live(size_t liveMark)
1322 /******************************************************************************/
1323 /* Function: Normal garbage collection live marking */
1324 /******************************************************************************/
1325 {
1326  memory_mark(this->activations);
1327  memory_mark(this->topStackFrame);
1329  memory_mark(this->conditionobj);
1330  memory_mark(this->requiresTable);
1331  memory_mark(this->waitingObject);
1333 
1334  /* have the frame stack do its own marking. */
1335  frameStack.live(liveMark);
1336  // mark any protected objects we've been watching over
1337 
1339  while (p != NULL)
1340  {
1342  p = p->next;
1343  }
1344 }
1346 /******************************************************************************/
1347 /* Function: Generalized object marking */
1348 /******************************************************************************/
1349 {
1357 
1358  /* have the frame stack do its own marking. */
1359  frameStack.liveGeneral(reason);
1360 
1362  while (p != NULL)
1363  {
1365  p = p->next;
1366  }
1367 }
1368 
1370 /******************************************************************************/
1371 /* Function: Flatten an object */
1372 /******************************************************************************/
1373 {
1374  /* Activities don't get moved, */
1375  /* we just return OREF_NULL. we may */
1376  /* create a special proxy for this */
1377  /* to re-establish an activation on */
1378  /* system. */
1379  return;
1380 }
1381 
1382 
1383 
1385 /******************************************************************************/
1386 /* Function: Release an activity to run */
1387 /******************************************************************************/
1388 {
1389  guardsem.post(); /* and the guard semaphore */
1390  runsem.post(); /* post the run semaphore */
1391  SysActivity::yield(); /* yield the thread */
1392 }
1393 
1394 
1395 
1402 {
1403  dispatchMessage = target;
1404 
1405  guardsem.post(); /* and the guard semaphore */
1406  runsem.post(); /* post the run semaphore */
1407  SysActivity::yield(); /* yield the thread */
1408 }
1409 
1410 
1415 {
1416  // no room for a new stack frame? need to expand the stack
1417  if (this->stackFrameDepth == this->activationStackSize)
1418  {
1419  // allocate a larger stack
1421  // now copy all of the entries over to the new frame stack
1422  for (size_t i = this->activationStackSize; i != 0; i--)
1423  {
1424  newstack->push(this->activations->peek(i-1));
1425  }
1426  // update the frame information
1427  this->activations = newstack;
1429  }
1430 }
1431 
1432 
1438 {
1439  // we have a new top entry...get this from the stack and adjust
1440  // the markers appropriately
1442  // the new activation is the new top and there may or may not be
1443  // a rexx context to deal with
1445 
1446  // update the numeric settings
1448  // this should be tree, but make sure we don't clobber the global settings accidentally
1450  {
1452  }
1453 }
1454 
1455 
1463 {
1464  checkActivationStack(); // make sure the stack is not filled
1465  // push on to the stack and bump the depth
1466  activations->push((RexxObject *)new_activation);
1467  stackFrameDepth++;
1468  // update the frame information.
1469  // if we're not creating a new frame set, link up the new frame with its predecessor
1470  if (!new_activation->isStackBase())
1471  {
1472  new_activation->setPreviousStackFrame(topStackFrame);
1473  }
1475 }
1476 
1477 
1487 {
1488  // make sure we have a new stack
1490  // This is a root activation that will allow API functions to be called
1491  // on this thread without having an active bit of ooRexx code first.
1493  new_activation->setStackBase();
1494  // create a new root element on the stack and bump the depth indicator
1495  activations->push((RexxObject *)new_activation);
1496  stackFrameDepth++;
1497  // update the frame information.
1499 }
1500 
1501 
1509 {
1510  // pop off the top elements and reduce the depth
1511  RexxActivationBase *poppedStackFrame = (RexxActivationBase *)activations->fastPop();
1512  stackFrameDepth--;
1513 
1514  // did we just pop off the last element of a stack frame? This should not happen, so
1515  // push it back on to the stack
1516  if (poppedStackFrame->isStackBase())
1517  {
1518  activations->push((RexxObject *)poppedStackFrame);
1519  stackFrameDepth++;
1520  }
1521  else
1522  {
1523  // update the frame information.
1525 
1526  // if this is not a reply operation and the frame we just removed is
1527  // a Rexx activation, we can just cache this.
1528  if (!reply)
1529  {
1530  // the popped stack frame might still be in the save stack, but can
1531  // also contain pointers back to locations on the C stack. Make sure
1532  // that this never tries to mark anything in case of a garbage collection
1533  poppedStackFrame->setHasNoReferences();
1534  }
1535  }
1536 }
1537 
1538 
1540 {
1541  // make sure this frame is terminated first
1542  poppedStackFrame->termination();
1543  // ensure this never marks anything
1544  poppedStackFrame->setHasNoReferences();
1545 }
1546 
1547 
1555 {
1556  RexxActivationBase *poppedStackFrame = (RexxActivationBase *)activations->fastPop();
1557  stackFrameDepth--;
1558  // pop off the top elements and reduce the depth
1559  while (poppedStackFrame != target)
1560  {
1561  // clean this up and potentially cache
1562  cleanupStackFrame(poppedStackFrame);
1563  poppedStackFrame = (RexxActivationBase *)activations->fastPop();
1564  stackFrameDepth--;
1565  }
1566 
1567  // clean this up and potentially cache
1568  cleanupStackFrame(poppedStackFrame);
1569  // update the frame information.
1571 }
1572 
1573 
1575 /******************************************************************************/
1576 /* Function: Remove an activation marker from the activity stack */
1577 /******************************************************************************/
1578 {
1579  // pop activations off until we find the one at the base of the stack.
1580  while (stackFrameDepth > 0)
1581  {
1582  // check the top activation. If it's a stack base item, then
1583  // we've reached the unwind point.
1584  RexxActivationBase *poppedActivation = (RexxActivationBase *)activations->fastPop();
1585  stackFrameDepth--;
1586  if (poppedActivation->isStackBase())
1587  {
1588  // at the very base of the activity, we keep a base item. If this
1589  // is the bottom stack frame here, then push it back on.
1590  if (stackFrameDepth == 0)
1591  {
1592  activations->push((RexxObject *)poppedActivation);
1593  stackFrameDepth++;
1594  }
1595  break;
1596  }
1597  }
1598 
1599  // update the frame information.
1601 }
1602 
1603 
1605 /******************************************************************************/
1606 /* Function: Remove an activation marker from the activity stack */
1607 /******************************************************************************/
1608 {
1609  // pop elements until we unwind to the target
1610  while (stackFrameDepth > depth)
1611  {
1612  activations->fastPop();
1613  stackFrameDepth--;
1614  }
1615 
1616  // update the frame information.
1618 }
1619 
1620 
1628 {
1629  RexxActivationBase *activation;
1630 
1631  /* unwind the activation stack */
1632  while ((activation = getTopStackFrame()) != frame)
1633  {
1634  activation->termination(); /* prepare the activation for termin */
1635  popStackFrame(false); /* pop the activation off the stack */
1636  }
1637 }
1638 
1639 
1648 {
1649  // associate this with the instance
1650  addToInstance(interpreter);
1651 
1652  // mark this as an attached activity
1653  attached = true;
1654  // This is a root activation that will allow API functions to be called
1655  // on this thread without having an active bit of ooRexx code first.
1657 }
1658 
1659 
1668 {
1669  // we're associated with this instance
1670  instance = interpreter;
1671  // create a thread context that we can hand out when needed.
1675 
1676  // go copy the exit definitions
1677  setupExits();
1678 }
1679 
1680 
1686 {
1687 
1688  // copy all of the system exits
1689  for (int i = 0; i < LAST_EXIT; i++)
1690  {
1691  sysexits[i] = instance->getExitHandler(i + 1);
1692  }
1693  // set the appropriate exit interlocks
1694  queryTrcHlt();
1695 }
1696 
1697 
1703 {
1708 }
1709 
1710 
1715 {
1716  instance->detachThread(this);
1717 }
1718 
1724 {
1725  // Undo this attached status
1726  instance = OREF_NULL;
1727  attached = false;
1728  // if there's a nesting situation, restore the activity to active state.
1729  if (nestedActivity != OREF_NULL)
1730  {
1731  nestedActivity->setSuspended(false);
1732  }
1733 }
1734 
1735 
1737 /******************************************************************************/
1738 /* Function: Release the kernel access because code is going to "leave" */
1739 /* the kernel. This prepares for this by adding a native */
1740 /* activation on to the stack to act as a server for the */
1741 /* external call. This way new native methods do not need to */
1742 /* be created just to get an activation created */
1743 /******************************************************************************/
1744 {
1745  // create new activation frame using the current Rexx frame (which can be null, but
1746  // is not likely to be).
1748  // this becomes the new top activation. We also turn on the variable pool for
1749  // this situation.
1750  this->pushStackFrame(new_activation);
1751  new_activation->enableVariablepool();
1752  // release the kernel in preparation for exiting
1753  releaseAccess();
1754 }
1755 
1756 
1758 /******************************************************************************/
1759 /* Function: Recover the kernel access and pop the native activation */
1760 /* created by activity_exit_kernel from the activity stack. */
1761 /******************************************************************************/
1762 {
1763  requestAccess(); /* get the kernel lock back */
1764  this->popStackFrame(false); /* pop the top activation */
1765 }
1766 
1767 
1769  RexxActivity *targetActivity) /* activity currently reserving */
1770 /******************************************************************************/
1771 /* Function: Check for a circular wait dead lock error */
1772 /******************************************************************************/
1773 {
1774  RexxActivity *owningActivity; /* activity owning the resource */
1775  /* currently waiting on something? */
1776  if (this->waitingObject != OREF_NULL) {
1777  /* waiting on a message object? */
1778  if (isOfClass(Message, this->waitingObject))
1779  /* get the activity message is on */
1780  owningActivity = ((RexxMessage *)this->waitingObject)->getActivity();
1781  else
1782  /* get the locking activity for vdict*/
1783  owningActivity = ((RexxVariableDictionary *)this->waitingObject)->getReservingActivity();
1784  /* have a circular wait */
1785  if (owningActivity == targetActivity)
1786  /* have a deaklock */
1788  if (owningActivity != OREF_NULL) /* have a real activity? */
1789  /* pass it along the chain */
1790  owningActivity->checkDeadLock(targetActivity);
1791  }
1792 }
1793 
1795  RexxObject *resource ) /* resource we are waiting on */
1796 /******************************************************************************/
1797 /* Function: Wait for a new run event to occur */
1798 /******************************************************************************/
1799 {
1800  runsem.reset(); /* clear the run semaphore */
1801  this->waitingObject = resource; /* save the waiting resource */
1802  releaseAccess(); /* release the kernel access */
1803  runsem.wait(); /* wait for the run to be posted */
1804  requestAccess(); /* reaquire the kernel access */
1805 }
1806 
1808 /******************************************************************************/
1809 /* Function: Wait for a guard post event */
1810 /******************************************************************************/
1811 {
1812  releaseAccess(); /* release kernel access */
1813  guardsem.wait(); /* wait on the guard semaphore */
1814  requestAccess(); /* reaquire the kernel lock */
1815 }
1816 
1818 /******************************************************************************/
1819 /* Function: Post a guard expression wake up notice */
1820 /******************************************************************************/
1821 {
1822  guardsem.post(); /* OK for it to already be posted */
1823 }
1824 
1826 /******************************************************************************/
1827 /* Function: Clear a guard expression semaphore in preparation to perform a */
1828 /* guard wait */
1829 /******************************************************************************/
1830 {
1831  guardsem.reset(); /* set up for guard call */
1832 }
1833 
1835 /******************************************************************************/
1836 /* Function: Post an activities run semaphore */
1837 /******************************************************************************/
1838 {
1839  this->waitingObject = OREF_NULL; /* no longer waiting */
1840  runsem.post(); /* OK for it to already be posted */
1841 }
1842 
1844  RexxDirectory *conditionObj) /* associated "kill" object */
1845 /******************************************************************************/
1846 /* Function: Kill a running activity, */
1847 /******************************************************************************/
1848 {
1849  this->conditionobj = conditionObj; /* save the condition object */
1850  throw UnhandledCondition; // we have a fatal error condition
1851 }
1852 
1854 /******************************************************************************/
1855 /* Function: Relinquish to other system processes */
1856 /******************************************************************************/
1857 {
1859 }
1860 
1866 {
1867  /* get the current activation */
1868  RexxActivation *activation = currentRexxFrame;
1869  // if we're in the context of Rexx code, request that it yield control
1870  if (activation != NULL)
1871  {
1872  activation->yield();
1873  }
1874 }
1875 
1876 
1887 {
1888  /* get the current activation */
1889  RexxActivation *activation = currentRexxFrame;
1890  /* got an activation? */
1891  if (activation != NULL)
1892  {
1893  // please make it stop :-)
1894  return activation->halt(d);
1895  }
1896  return true;
1897 }
1898 
1899 
1910 {
1911  /* get the current activation */
1912  RexxActivation *activation = currentRexxFrame;
1913  /* got an activation? */
1914  if (activation != NULL)
1915  {
1916  if (on) /* turning this on? */
1917  {
1918  /* turn tracing on */
1919  activation->externalTraceOn();
1920  }
1921  else
1922  {
1923  /* turn tracing off */
1924  activation->externalTraceOff();
1925  }
1926  return true;
1927  }
1928  return false;
1929 }
1930 
1932 /******************************************************************************/
1933 /* Function: Release exclusive access to the kernel */
1934 /******************************************************************************/
1935 {
1936  // make sure we're really the holder on this
1938  {
1939  // reset the numeric settings
1942  }
1943 }
1944 
1946 /******************************************************************************/
1947 /* Function: Acquire exclusive access to the kernel */
1948 /******************************************************************************/
1949 {
1950  /* only one there? */
1952  {
1953  ActivityManager::currentActivity = this; /* set new current activity */
1954  /* and new active settings */
1956  return; /* get out if we have it */
1957  }
1958  /* can't get it, go stand in line */
1960  // belt and braces to ensure this is done on this thread
1961  ActivityManager::currentActivity = this; /* set new current activity */
1962 }
1963 
1965 /******************************************************************************/
1966 /* Function: Make sure there is enough stack space to run a method */
1967 /******************************************************************************/
1968 {
1969 #ifdef STACKCHECK
1970  size_t temp; // if checking and there isn't room
1971  if (((char *)&temp - (char *)this->stackBase) < MIN_C_STACK && this->stackcheck == true)
1972  {
1973  // go raise an exception
1975  }
1976 #endif
1977 }
1978 
1979 
1981 /******************************************************************************/
1982 /* Function: Retrive the activities local environment */
1983 /******************************************************************************/
1984 {
1985  return instance->getLocal(); // just return the .local directory
1986 }
1987 
1989 /******************************************************************************/
1990 /* Function: Retrieve the activities threadid */
1991 /******************************************************************************/
1992 {
1993  return currentThread.getThreadID(); /* just return the thread id info */
1994 }
1995 
1997 /******************************************************************************/
1998 /* Function: Determine if Halt or Trace System exits are set */
1999 /* and set a flag to indicate this. */
2000 /******************************************************************************/
2001 { /* is HALT sys exit set */
2002  if (isExitEnabled(RXHLT))
2003  {
2004  this->clauseExitUsed = true; /* set flag to indicate one is found */
2005  return; /* and return */
2006  }
2007  /* is TRACE sys exit set */
2008  if (isExitEnabled(RXTRC))
2009  {
2010  this->clauseExitUsed = true; /* set flag to indicate one is found */
2011  return; /* and return */
2012  }
2013 
2014  this->clauseExitUsed = false; /* remember that none are set */
2015 }
2016 
2017 
2031  const char *exitName, int function,
2032  int subfunction, void *exitbuffer)
2033 {
2034  ExitHandler &handler = getExitHandler(function);
2035 
2036  int rc = handler.call(this, activation, function, subfunction, exitbuffer);
2037 
2038  /* got an error case? */
2039  if (rc == RXEXIT_RAISE_ERROR || rc < 0)
2040  {
2041  if (function == RXSIO) /* this the I/O function? */
2042  {
2043  /* disable the I/O exit from here to */
2044  /* prevent recursive error conditions */
2045  disableExit(RXSIO);
2046  }
2047  /* go raise an error */
2049  }
2050  return rc == RXEXIT_HANDLED; /* Did exit handle task? */
2051 }
2052 
2053 
2055  RexxActivation *activation) /* sending activation */
2056 /******************************************************************************/
2057 /* Function: Calls the SysExitHandler method on the System Object to run */
2058 /* the initialization system exit. */
2059 /******************************************************************************/
2060 {
2061  if (isExitEnabled(RXINI)) // is the exit enabled?
2062  {
2063  /* add the variable RXPROGRAMNAME to */
2064  /* the variable pool, it contains the*/
2065  /* script name that is currently run */
2066  /* call the handler */
2067  callExit(activation, "RXINI", RXINI, RXINIEXT, NULL);
2068  }
2069 }
2070 
2072  RexxActivation *activation) /* sending activation */
2073 /******************************************************************************/
2074 /* Function: Calls the SysExitHandler method on the System Object to run */
2075 /* the termination system exit. */
2076 /******************************************************************************/
2077 {
2078  if (isExitEnabled(RXTER)) // is the exit enabled?
2079  {
2080  callExit(activation, "RXTER", RXTER, RXTEREXT, NULL);
2081  }
2082 }
2083 
2085  RexxActivation *activation, /* sending activation */
2086  RexxString *sayoutput) /* line to write out */
2087 /******************************************************************************/
2088 /* Function: Calls the SysExitHandler method on the System Object to run */
2089 /* the I/O system exit. */
2090 /******************************************************************************/
2091 {
2092  if (isExitEnabled(RXSIO)) // is the exit enabled?
2093  {
2094  RXSIOSAY_PARM exit_parm; /* exit parameters */
2095 
2096  sayoutput->toRxstring(exit_parm.rxsio_string);
2097  return !callExit(activation, "RXSIO", RXSIO, RXSIOSAY, &exit_parm);
2098  }
2099  return true; /* exit didn't handle */
2100 }
2101 
2103  RexxActivation *activation, /* sending activation */
2104  RexxString *traceoutput) /* line to write out */
2105 /******************************************************************************/
2106 /* Function: Calls the SysExitHandler method on the System Object to run */
2107 /* the I/O system exit. */
2108 /******************************************************************************/
2109 {
2110  if (isExitEnabled(RXSIO)) // is the exit enabled?
2111  {
2112  RXSIOSAY_PARM exit_parm; /* exit parameters */
2113  traceoutput->toRxstring(exit_parm.rxsio_string);
2114  return !callExit(activation, "RXSIO", RXSIO, RXSIOTRC, &exit_parm);
2115  }
2116  return true; /* exit didn't handle */
2117 }
2118 
2120  RexxActivation *activation, /* sending activation */
2121  RexxString *&inputstring) /* returned input string */
2122 /******************************************************************************/
2123 /* Function: Calls the SysExitHandler method on the System Object to run */
2124 /* the I/O system exit. */
2125 /******************************************************************************/
2126 {
2127  if (isExitEnabled(RXSIO)) // is the exit enabled?
2128  {
2129  RXSIOTRD_PARM exit_parm; /* exit parameters */
2130  char retbuffer[DEFRXSTRING];/* Default result buffer */
2131 
2132  *retbuffer = '\0';
2133  /* Pass along default RXSTRING */
2134  MAKERXSTRING(exit_parm.rxsiotrd_retc, retbuffer, DEFRXSTRING);
2135  if (!callExit(activation, "RXSIO", RXSIO, RXSIOTRD, &exit_parm))
2136  {
2137  return true;
2138  }
2139  /* Get input string and return it */
2140  inputstring = new_string(exit_parm.rxsiotrd_retc);
2141  /* user give us a new buffer? */
2142  if (exit_parm.rxsiotrd_retc.strptr != retbuffer)
2143  {
2144  /* free it */
2146 
2147  }
2148  return false; /* this was handled */
2149  }
2150  return true; /* not handled */
2151 }
2152 
2154  RexxActivation *activation, /* sending activation */
2155  RexxString *&inputstring) /* returned input value */
2156 /******************************************************************************/
2157 /* Function: Calls the SysExitHandler method on the System Object to run */
2158 /* the I/O system exit. */
2159 /******************************************************************************/
2160 {
2161  if (isExitEnabled(RXSIO)) // is the exit enabled?
2162  {
2163  RXSIOTRD_PARM exit_parm; /* exit parameters */
2164  char retbuffer[DEFRXSTRING];/* Default result buffer */
2165 
2166  *retbuffer = '\0';
2167  /* Pass along default RXSTRING */
2168  MAKERXSTRING(exit_parm.rxsiotrd_retc, retbuffer, DEFRXSTRING);
2169  if (!callExit(activation, "RXSIO", RXSIO, RXSIODTR, &exit_parm))
2170  {
2171  return true;
2172  }
2173  /* Get input string and return it */
2174  inputstring = new_string(exit_parm.rxsiotrd_retc);
2175  /* user give us a new buffer? */
2176  if (exit_parm.rxsiotrd_retc.strptr != retbuffer)
2177  {
2178  /* free it */
2180 
2181  }
2182  return false; /* this was handled */
2183  }
2184  return true; /* not handled */
2185 }
2186 
2188  RexxActivation *activation, /* calling activation */
2189  RexxString *rname, /* routine name */
2190  RexxObject *calltype, /* type of call */
2191  ProtectedObject &funcresult, /* function result */
2192  RexxObject **arguments, /* argument array */
2193  size_t argcount) /* argument count */
2194 /******************************************************************************/
2195 /* Function: Calls the SysExitHandler method on the System Object to run */
2196 /* the function system exit. */
2197 /******************************************************************************/
2198 {
2199 
2200  if (isExitEnabled(RXFNC)) // is the exit enabled?
2201  {
2202  RXFNCCAL_PARM exit_parm; /* exit parameters */
2203  char retbuffer[DEFRXSTRING];/* Default result buffer */
2204  /* Start building the exit block */
2205  exit_parm.rxfnc_flags.rxfferr = 0; /* Initialize error codes to zero */
2206  exit_parm.rxfnc_flags.rxffnfnd = 0;
2207 
2208 
2209  exit_parm.rxfnc_flags.rxffsub = calltype == OREF_FUNCTIONNAME ? 0 : 1;
2210  /* fill in the name parameter */
2211  exit_parm.rxfnc_namel = (unsigned short)rname->getLength();
2212  exit_parm.rxfnc_name = rname->getStringData();
2213 
2214  /* Get current active queue name */
2216  /* fill in the name */
2217  exit_parm.rxfnc_que = stdqueue->getStringData();
2218  /* and the length */
2219  exit_parm.rxfnc_quel = (unsigned short)stdqueue->getLength();
2220  /* Build arg array of RXSTRINGs */
2221  /* get number of args */
2222  exit_parm.rxfnc_argc = (unsigned short)argcount;
2223 
2224 
2225  /* allocate enough memory for all arguments. */
2226  /* At least one item needs to be allocated in order to avoid an error */
2227  /* in the sysexithandler! */
2229  sizeof(CONSTRXSTRING) * Numerics::maxVal((size_t)exit_parm.rxfnc_argc, (size_t)1));
2230  if (argrxarray == OREF_NULL) /* memory error? */
2231  {
2233  }
2234  /* give the arg array pointer */
2235  exit_parm.rxfnc_argv = argrxarray;
2236  /* construct the arg array */
2237  for (size_t argindex=0; argindex < exit_parm.rxfnc_argc; argindex++)
2238  {
2239  // classic REXX style interface
2240  RexxString *temp = (RexxString *)arguments[argindex];
2241  if (temp != OREF_NULL) /* got a real argument? */
2242  {
2243  /* force the argument to a string */
2244  temp = (RexxString *)REQUEST_STRING(temp);
2245  /* point to the string */
2246  temp->toRxstring(argrxarray[argindex]);
2247  }
2248  else
2249  {
2250  /* empty argument */
2251  argrxarray[argindex].strlength = 0;
2252  argrxarray[argindex].strptr = (const char *)NULL;
2253  }
2254  }
2255  /* Pass default result RXSTRING */
2256  MAKERXSTRING(exit_parm.rxfnc_retc, retbuffer, DEFRXSTRING);
2257  /* call the handler */
2258  bool wasHandled = callExit(activation, "RXFNC", RXFNC, RXFNCCAL, (void *)&exit_parm);
2259 
2261 
2262  if (!wasHandled)
2263  {
2264  return true; /* this wasn't handled */
2265  }
2266 
2267 
2268  if (exit_parm.rxfnc_flags.rxfferr) /* function error? */
2269  {
2270  /* raise an error */
2272  }
2273  /* Did we find the function?? */
2274  else if (exit_parm.rxfnc_flags.rxffnfnd)
2275  {
2276  /* also an error */
2278  }
2279  /* Was it a function call?? */
2280  if (exit_parm.rxfnc_retc.strptr == OREF_NULL && calltype == OREF_FUNCTIONNAME)
2281  {
2282  /* Have to return data */
2284  }
2285 
2286  if (exit_parm.rxfnc_retc.strptr) /* If we have result, return it */
2287  {
2288  /* Get input string and return it */
2289  funcresult = new_string(exit_parm.rxfnc_retc);
2290  /* user give us a new buffer? */
2291  if (exit_parm.rxfnc_retc.strptr != retbuffer)
2292  {
2293  /* free it */
2294  SystemInterpreter::releaseResultMemory(exit_parm.rxfnc_retc.strptr);
2295  }
2296  }
2297  return false; /* this was handled */
2298  }
2299  return true; /* not handled */
2300 }
2301 
2302 
2304  RexxActivation *activation, /* calling activation */
2305  RexxString *rname, /* routine name */
2306  RexxObject *calltype, /* type of call */
2307  ProtectedObject &funcresult, /* function result */
2308  RexxObject **arguments, /* argument array */
2309  size_t argcount) /* argument count */
2310 /******************************************************************************/
2311 /* Function: Calls the SysExitHandler method on the System Object to run */
2312 /* the function system exit. */
2313 /******************************************************************************/
2314 {
2315  // give the security manager the first pass
2316  SecurityManager *manager = activation->getEffectiveSecurityManager();
2317  if (manager != OREF_NULL)
2318  {
2319  if (manager->checkFunctionCall(rname, argcount, arguments, funcresult))
2320  {
2321  return false;
2322  }
2323  }
2324 
2325  if (isExitEnabled(RXOFNC)) // is the exit enabled?
2326  {
2327  RXOFNCCAL_PARM exit_parm; /* exit parameters */
2328  /* Start building the exit block */
2329  exit_parm.rxfnc_flags.rxfferr = 0; /* Initialize error codes to zero */
2330  exit_parm.rxfnc_flags.rxffnfnd = 0;
2331 
2332 
2333  exit_parm.rxfnc_flags.rxffsub = calltype == OREF_FUNCTIONNAME ? 0 : 1;
2334  /* fill in the name parameter */
2335  rname->toRxstring(exit_parm.rxfnc_name);
2336 
2337  /* get number of args */
2338  exit_parm.rxfnc_argc = argcount;
2339  // the argument pointers get passed as is
2340  exit_parm.rxfnc_argv = (RexxObjectPtr *)arguments;
2341  // no result value
2342  exit_parm.rxfnc_retc = NULLOBJECT;
2343  /* call the handler */
2344  if (!callExit(activation, "RXOFNC", RXOFNC, RXOFNCCAL, (void *)&exit_parm))
2345  {
2346  return true; /* this wasn't handled */
2347  }
2348 
2349  if (exit_parm.rxfnc_flags.rxfferr) /* function error? */
2350  {
2351  /* raise an error */
2353  }
2354  /* Did we find the function?? */
2355  else if (exit_parm.rxfnc_flags.rxffnfnd)
2356  {
2357  /* also an error */
2359  }
2360  /* Was it a function call?? */
2361  if (exit_parm.rxfnc_retc == NULLOBJECT && calltype == OREF_FUNCTIONNAME)
2362  {
2363  /* Have to return data */
2365  }
2366  // set the function result back
2367  funcresult = (RexxObject *)exit_parm.rxfnc_retc;
2368  return false; /* this was handled */
2369  }
2370  return true; /* not handled */
2371 }
2372 
2373 
2375  RexxActivation *activation, /* calling activation */
2376  RexxString *rname, /* routine name */
2377  RexxObject *calltype, /* type of call */
2378  ProtectedObject &funcresult, /* function result */
2379  RexxObject **arguments, /* argument array */
2380  size_t argcount) /* argument count */
2381 /******************************************************************************/
2382 /* Function: Calls the SysExitHandler method on the System Object to run */
2383 /* the function system exit. */
2384 /******************************************************************************/
2385 {
2386  if (isExitEnabled(RXEXF)) // is the exit enabled?
2387  {
2388  RXEXFCAL_PARM exit_parm; /* exit parameters */
2389  /* Start building the exit block */
2390  exit_parm.rxfnc_flags.rxfferr = 0; /* Initialize error codes to zero */
2391  exit_parm.rxfnc_flags.rxffnfnd = 0;
2392 
2393 
2394  exit_parm.rxfnc_flags.rxffsub = calltype == OREF_FUNCTIONNAME ? 0 : 1;
2395  /* fill in the name parameter */
2396  rname->toRxstring(exit_parm.rxfnc_name);
2397 
2398  /* get number of args */
2399  exit_parm.rxfnc_argc = argcount;
2400  // the argument pointers get passed as is
2401  exit_parm.rxfnc_argv = (RexxObjectPtr *)arguments;
2402  // no result value
2403  exit_parm.rxfnc_retc = NULLOBJECT;
2404  /* call the handler */
2405  if (!callExit(activation, "RXEXF", RXEXF, RXEXFCAL, (void *)&exit_parm))
2406  {
2407  return true; /* this wasn't handled */
2408  }
2409 
2410  if (exit_parm.rxfnc_flags.rxfferr) /* function error? */
2411  {
2412  /* raise an error */
2414  }
2415  /* Did we find the function?? */
2416  else if (exit_parm.rxfnc_flags.rxffnfnd)
2417  {
2418  /* also an error */
2420  }
2421  /* Was it a function call?? */
2422  if (exit_parm.rxfnc_retc == NULLOBJECT && calltype == OREF_FUNCTIONNAME)
2423  {
2424  /* Have to return data */
2426  }
2427  // set the function result back
2428  funcresult = (RexxObject *)exit_parm.rxfnc_retc;
2429  return false; /* this was handled */
2430  }
2431  return true; /* not handled */
2432 }
2433 
2434 
2435 bool RexxActivity::callCommandExit(RexxActivation *activation, RexxString *address, RexxString *command, ProtectedObject &result, ProtectedObject &condition)
2436 {
2437  // give the security manager the first pass
2438  SecurityManager *manager = activation->getEffectiveSecurityManager();
2439  if (manager != OREF_NULL)
2440  {
2441  if (manager->checkCommand(this, address, command, result, condition))
2442  {
2443  return false;
2444  }
2445  }
2446 
2447  if (isExitEnabled(RXCMD)) // is the exit enabled?
2448  {
2449  RXCMDHST_PARM exit_parm; /* exit parameters */
2450  char retbuffer[DEFRXSTRING];/* Default result buffer */
2451  /* Start building the exit block */
2452  exit_parm.rxcmd_flags.rxfcfail = 0;/* Initialize failure/error to zero */
2453  exit_parm.rxcmd_flags.rxfcerr = 0;
2454  /* fill in the environment parm */
2455  exit_parm.rxcmd_addressl = (unsigned short)address->getLength();
2456  exit_parm.rxcmd_address = address->getStringData();
2457  /* make cmdaname into RXSTRING form */
2458  command->toRxstring(exit_parm.rxcmd_command);
2459 
2460  exit_parm.rxcmd_dll = NULL; /* Currently no DLL support */
2461  exit_parm.rxcmd_dll_len = 0; /* 0 means .EXE style */
2462  /* Pass default result RXSTRING */
2463  MAKERXSTRING(exit_parm.rxcmd_retc, retbuffer, DEFRXSTRING);
2464  /* call the handler */
2465  if (!callExit(activation, "RXCMD", RXCMD, RXCMDHST, (void *)&exit_parm))
2466  {
2467  return true; /* this wasn't handled */
2468  }
2469  if (exit_parm.rxcmd_flags.rxfcfail)/* need to raise failure condition? */
2470  {
2471  // raise the condition when things are done
2472  condition = createConditionObject(OREF_FAILURENAME, (RexxObject *)result, command, OREF_NULL, OREF_NULL);
2473  }
2474 
2475  /* Did we find the function?? */
2476  else if (exit_parm.rxcmd_flags.rxfcerr)
2477  {
2478  // raise the condition when things are done
2479  condition = createConditionObject(OREF_ERRORNAME, (RexxObject *)result, command, OREF_NULL, OREF_NULL);
2480  }
2481  /* Get input string and return it */
2482  result = new_string(exit_parm.rxcmd_retc);
2483  /* user give us a new buffer? */
2484  if (exit_parm.rxcmd_retc.strptr != retbuffer)
2485  {
2486  /* free it */
2487  SystemInterpreter::releaseResultMemory(exit_parm.rxcmd_retc.strptr);
2488  }
2489  return false; /* this was handled */
2490  }
2491  return true; /* not handled */
2492 }
2493 
2494 
2496  RexxActivation *activation, /* sending activation */
2497  RexxString *&inputstring) /* returned input string */
2498 /******************************************************************************/
2499 /* Function: Calls the SysExitHandler method on the System Object to run */
2500 /* the External Data queue system exit. */
2501 /******************************************************************************/
2502 {
2503  if (isExitEnabled(RXMSQ)) // is the exit enabled?
2504  {
2505  RXMSQPLL_PARM exit_parm; /* exit parameters */
2506  char retbuffer[DEFRXSTRING];/* Default result buffer */
2507 
2508  /* Pass along default RXSTRING */
2509  MAKERXSTRING(exit_parm.rxmsq_retc, retbuffer, DEFRXSTRING);
2510  /* call the handler */
2511  if (!callExit(activation, "RXMSQ", RXMSQ, RXMSQPLL, (void *)&exit_parm))
2512  {
2513  return true; /* this wasn't handled */
2514  }
2515  if (exit_parm.rxmsq_retc.strptr == NULL)/* if rxstring not null */
2516  {
2517  /* no value returned, */
2518  /* return NIL to note empty stack */
2519  inputstring = (RexxString *)TheNilObject;
2520  }
2521  else /* return resulting object */
2522  {
2523  inputstring = new_string(exit_parm.rxmsq_retc);
2524  /* user give us a new buffer? */
2525  if (exit_parm.rxmsq_retc.strptr != retbuffer)
2526  {
2527  /* free it */
2528  SystemInterpreter::releaseResultMemory(exit_parm.rxmsq_retc.strptr);
2529  }
2530  }
2531  return false; /* this was handled */
2532  }
2533  return true; /* not handled */
2534 }
2535 
2537  RexxActivation *activation, /* sending activation */
2538  RexxString *inputstring, /* string to be placed on the queue */
2539  int lifo_flag) /* flag to indicate LIFO or FIFO */
2540 /******************************************************************************/
2541 /* Function: Calls the SysExitHandler method on the System Object to run */
2542 /* the External Data queue system exit. */
2543 /******************************************************************************/
2544 {
2545  if (isExitEnabled(RXMSQ)) // is the exit enabled?
2546  {
2547  RXMSQPSH_PARM exit_parm; /* exit parameters */
2548 
2549  /* get the exit handler */
2550  if (lifo_flag == QUEUE_LIFO) /* LIFO queuing requested? */
2551  {
2552  /* set the flag appropriately */
2553  exit_parm.rxmsq_flags.rxfmlifo = 1;
2554  }
2555  else
2556  {
2557  /* this is a FIFO request */
2558  exit_parm.rxmsq_flags.rxfmlifo = 0;
2559  }
2560  /* make into RXSTRING form */
2561  inputstring->toRxstring(exit_parm.rxmsq_value);
2562  /* call the handler */
2563  if (!callExit(activation, "RXMSQ", RXMSQ, RXMSQPSH, (void *)&exit_parm))
2564  {
2565  return true; /* this wasn't handled */
2566  }
2567  return false; /* this was handled */
2568  }
2569  return true; /* not handled */
2570 }
2571 
2572 
2574  RexxActivation *activation, /* sending activation */
2575  RexxInteger *&returnsize) /* returned queue size */
2576 /******************************************************************************/
2577 /* Function: Calls the SysExitHandler method on the System Object to run */
2578 /* the External Data queue system exit. */
2579 /******************************************************************************/
2580 {
2581  if (isExitEnabled(RXMSQ)) // is the exit enabled?
2582  {
2583  RXMSQSIZ_PARM exit_parm; /* exit parameters */
2584  /* call the handler */
2585  if (!callExit(activation, "RXMSQ", RXMSQ, RXMSQSIZ, (void *)&exit_parm))
2586  {
2587  return true; /* this wasn't handled */
2588  }
2589  /* Get queue size and return it */
2590  returnsize = new_integer(exit_parm.rxmsq_size);
2591 
2592  return false; /* this was handled */
2593  }
2594  return true; /* not handled */
2595 }
2596 
2597 
2599  RexxActivation *activation, /* sending activation */
2600  RexxString *&inputstring ) /* name of external queue */
2601 /******************************************************************************/
2602 /* Function: Calls the SysExitHandler method on the System Object to run */
2603 /* the External Data queue system exit. */
2604 /******************************************************************************/
2605 {
2606  if (isExitEnabled(RXMSQ)) // is the exit enabled?
2607  {
2608  RXMSQNAM_PARM exit_parm; /* exit parameters */
2609  char retbuffer[DEFRXSTRING];/* Default result buffer */
2610 
2611  MAKERXSTRING(exit_parm.rxmsq_name, retbuffer, inputstring->getLength());
2612  memcpy(exit_parm.rxmsq_name.strptr, inputstring->getStringData(), inputstring->getLength());
2613  /* call the handler */
2614  if (!callExit(activation, "RXMSQ", RXMSQ, RXMSQNAM, (void *)&exit_parm))
2615  {
2616  return true; /* this wasn't handled */
2617  }
2618  inputstring = new_string(exit_parm.rxmsq_name);
2619  /* user give us a new buffer? */
2620  if (exit_parm.rxmsq_name.strptr != retbuffer)
2621  {
2622  /* free it */
2623  SystemInterpreter::releaseResultMemory(exit_parm.rxmsq_name.strptr);
2624  }
2625  return false; /* this was handled */
2626  }
2627  return true; /* not handled */
2628 }
2629 
2630 
2632  RexxActivation *activation) /* sending activation */
2633 /******************************************************************************/
2634 /* Function: Calls the SysExitHandler method on the System Object to run */
2635 /* the Test Halt system exit. */
2636 /******************************************************************************/
2637 {
2638  if (isExitEnabled(RXHLT)) // is the exit enabled?
2639  {
2640  RXHLTTST_PARM exit_parm; /* exit parameters */
2641 
2642  /* Clear halt so as not to be sloppy */
2643  exit_parm.rxhlt_flags.rxfhhalt = 0;
2644  /* call the handler */
2645  if (!callExit(activation, "RXHLT", RXHLT, RXHLTTST, (void *)&exit_parm))
2646  {
2647  return true; /* this wasn't handled */
2648  }
2649  /* Was halt requested? */
2650  if (exit_parm.rxhlt_flags.rxfhhalt == 1)
2651  {
2652  /* Then honor the halt request */
2653  activation->halt(OREF_NULL);
2654  }
2655  return false; /* this was handled */
2656  }
2657  return true; /* not handled */
2658 }
2659 
2660 
2662  RexxActivation *activation) /* sending activation */
2663 /******************************************************************************/
2664 /* Function: Calls the SysExitHandler method on the System Object to run */
2665 /* the Clear Halt system exit. */
2666 /******************************************************************************/
2667 {
2668  if (isExitEnabled(RXHLT)) // is the exit enabled?
2669  {
2670  RXHLTTST_PARM exit_parm; /* exit parameters */
2671  /* call the handler */
2672  if (!callExit(activation, "RXHLT", RXHLT, RXHLTCLR, (void *)&exit_parm))
2673  {
2674  return true; /* this wasn't handled */
2675  }
2676  return false; /* this was handled */
2677  }
2678  return true; /* not handled */
2679 }
2680 
2681 
2683  RexxActivation *activation, /* sending activation */
2684  bool currentsetting) /* sending activation */
2685 /******************************************************************************/
2686 /* Function: Calls the SysExitHandler method on the System Object to run */
2687 /* the Test external trace indicator system exit. */
2688 /******************************************************************************/
2689 {
2690  if (isExitEnabled(RXTRC)) // is the exit enabled?
2691  {
2692  RXTRCTST_PARM exit_parm; /* exit parameters */
2693  /* Clear Trace bit before call */
2694  exit_parm.rxtrc_flags.rxftrace = 0;
2695  /* call the handler */
2696  if (!callExit(activation, "RXTRC", RXTRC, RXTRCTST, (void *)&exit_parm))
2697  {
2698  return true; /* this wasn't handled */
2699  }
2700  /* if not tracing, and now it is */
2701  /* requsted */
2702  if (!currentsetting && (exit_parm.rxtrc_flags.rxftrace == 1))
2703  {
2704  /* call routine to handle this */
2705  activation->externalTraceOn();
2706  return false; /* this was handled */
2707  }
2708  // this could be a request to stop tracing
2709  else if (currentsetting && (exit_parm.rxtrc_flags.rxftrace != 1))
2710  {
2711  /* call routine to handle this */
2712  activation->externalTraceOff();
2713  return false; /* this was handled */
2714  }
2715  }
2716  return true; /* not handled */
2717 }
2718 
2719 
2721  RexxActivation *activation, /* sending activation */
2722  RexxString *variableName, /* name to look up */
2723  RexxObject *&value) /* the returned value */
2724 /******************************************************************************/
2725 /* Function: Calls the novalue handler for uninitialized variables */
2726 /******************************************************************************/
2727 {
2728  if (isExitEnabled(RXNOVAL)) // is the exit enabled?
2729  {
2730  RXVARNOVALUE_PARM exit_parm; /* exit parameters */
2731  // the name is passed as a RexxStringObject
2732  exit_parm.variable_name = (RexxStringObject)variableName;
2733  // the value is returned as an object
2734  exit_parm.value = NULLOBJECT; /* no value at the start */
2735  /* call the handler */
2736  if (callExit(activation, "RXNOVAL", RXNOVAL, RXNOVALCALL, (void *)&exit_parm))
2737  {
2738  value = (RexxObject *)exit_parm.value;
2739  return false;
2740  }
2741  }
2742  return true; /* exit didn't handle */
2743 }
2744 
2745 
2747  RexxActivation *activation, /* sending activation */
2748  RexxString *selector, /* the variable set selector */
2749  RexxString *variableName, /* name to look up */
2750  RexxObject *newValue, // new value for the variable
2751  RexxObject *&value) /* the returned value */
2752 /******************************************************************************/
2753 /* Function: Calls the exit for the VALUE() BIF */
2754 /******************************************************************************/
2755 {
2756  if (isExitEnabled(RXVALUE)) // is the exit enabled?
2757  {
2758  RXVALCALL_PARM exit_parm; /* exit parameters */
2759  // copy the selector and variable parts
2760  exit_parm.selector = (RexxStringObject)selector;
2761  exit_parm.variable_name = (RexxStringObject)variableName;
2762  // the value is returned as an object, and the old value is
2763  // also passed that way
2764  exit_parm.value = (RexxObjectPtr)newValue;
2765  /* call the handler */
2766  if (callExit(activation, "RXVALUE", RXVALUE, RXVALUECALL, (void *)&exit_parm))
2767  {
2768  value = (RexxObject *)exit_parm.value;
2769  return false;
2770  }
2771  }
2772  return true; /* exit didn't handle */
2773 }
2774 
2775 
2783 {
2784  // get the security manager for the top stack frame. If there is none defined, default to
2785  // ghe global security manager.
2787 
2788  if (manager != OREF_NULL)
2789  {
2790  return manager;
2791  }
2792 
2793  // return the manager from the instance
2794  return instance->getSecurityManager();
2795 }
2796 
2797 
2804 {
2805  // return the manager from the instance
2806  return instance->getSecurityManager();
2807 }
2808 
2809 
2810 
2811 void RexxActivity::traceOutput( /* write a line of trace information */
2812  RexxActivation *activation, /* sending activation */
2813  RexxString *line) /* line to write out */
2814 /******************************************************************************/
2815 /* Function: Write a line of trace output to the .ERROR stream */
2816 /******************************************************************************/
2817 {
2818  line = line->stringTrace(); /* get traceable form of this */
2819  /* if exit declines the call */
2820  if (this->callTraceExit(activation, line))
2821  {
2822  /* get the default output stream */
2823  RexxObject *stream = getLocalEnvironment(OREF_TRACEOUTPUT);
2824  /* have .local set up yet? */
2825  if (stream != OREF_NULL && stream != TheNilObject)
2826  {
2827  stream->sendMessage(OREF_LINEOUT, line);
2828  }
2829  /* do the lineout */
2830  else /* use the "real" default stream */
2831  {
2832  this->lineOut(line);
2833  }
2834  }
2835 }
2836 
2837 void RexxActivity::sayOutput( /* write a line of say information */
2838  RexxActivation *activation, /* sending activation */
2839  RexxString *line) /* line to write out */
2840 /******************************************************************************/
2841 /* Function: Write a line of SAY output to the .OUTPUT stream */
2842 /******************************************************************************/
2843 {
2844  if (this->callSayExit(activation, line))
2845  {
2846  /* get the default output stream */
2847  RexxObject *stream = getLocalEnvironment(OREF_OUTPUT);
2848  /* have .local set up yet? */
2849  if (stream != OREF_NULL && stream != TheNilObject)
2850  {
2851  /* do the lineout */
2852  stream->sendMessage(OREF_SAY, line);
2853  }
2854  else /* use the "real" default stream */
2855  {
2856  this->lineOut(line);
2857  }
2858  }
2859 }
2860 
2861 RexxString *RexxActivity::traceInput( /* read a line of trace input */
2862  RexxActivation *activation) /* sending activation */
2863 /******************************************************************************/
2864 /* Function: Read a line for interactive debug input */
2865 /******************************************************************************/
2866 {
2867  RexxString *value;
2868 
2869  /* if exit declines the call */
2870  if (this->callDebugInputExit(activation, value))
2871  {
2872  /* get the input stream */
2873  RexxObject *stream = getLocalEnvironment(OREF_DEBUGINPUT);
2874  if (stream != OREF_NULL) /* have a stream? */
2875  {
2876  /* read from it */
2877  value = (RexxString *)stream->sendMessage(OREF_LINEIN);
2878  /* get something real? */
2879  if (value == (RexxString *)TheNilObject)
2880  {
2881  value = OREF_NULLSTRING; /* just us a null string if not */
2882  }
2883  }
2884  else
2885  {
2886  value = OREF_NULLSTRING; /* default to a null string */
2887  }
2888  }
2889  return value; /* return value from exit */
2890 }
2891 
2892 
2893 RexxString *RexxActivity::pullInput( /* read a line of pull input */
2894  RexxActivation *activation) /* sending activation */
2895 /******************************************************************************/
2896 /* Function: Read a line for the PULL instruction */
2897 /******************************************************************************/
2898 {
2899  RexxString *value;
2900 
2901  /* if exit declines call */
2902  if (this->callPullExit(activation, value))
2903  {
2904  /* get the external data queue */
2905  RexxObject *stream = getLocalEnvironment(OREF_REXXQUEUE);
2906  if (stream != OREF_NULL) /* have a data queue? */
2907  {
2908  /* pull from the queue */
2909  value = (RexxString *)stream->sendMessage(OREF_PULL);
2910  /* get something real? */
2911  if (value == (RexxString *)TheNilObject)
2912  {
2913  /* read from the linein stream */
2914  value = this->lineIn(activation);
2915  }
2916  }
2917  }
2918  return value; /* return the read value */
2919 }
2920 
2922  RexxString *line) /* line to write out */
2923 /******************************************************************************/
2924 /* Function: Write a line out to the real default I/O stream */
2925 /******************************************************************************/
2926 {
2927  size_t length; /* length to write out */
2928  const char *data; /* data pointer */
2929 
2930  length = line->getLength(); /* get the string length and the */
2931  data = line->getStringData(); /* data pointer */
2932  printf("%.*s\n",length, data); /* print it */
2933  return (RexxObject *)IntegerZero; /* return on residual count */
2934 }
2935 
2937  RexxActivation *activation) /* sending activation */
2938 /******************************************************************************/
2939 /* Function: Read a line for the PARSE LINEIN instruction */
2940 /******************************************************************************/
2941 {
2942  RexxString *value;
2943 
2944  /* if exit declines call */
2945  if (this->callTerminalInputExit(activation, value))
2946  {
2947  /* get the input stream */
2948  RexxObject *stream = getLocalEnvironment(OREF_INPUT);
2949  if (stream != OREF_NULL) /* have a stream? */
2950  {
2951  /* read from it */
2952  value = (RexxString *)stream->sendMessage(OREF_LINEIN);
2953  /* get something real? */
2954  if (value == (RexxString *)TheNilObject)
2955  {
2956  value = OREF_NULLSTRING; /* just use a null string if not */
2957  }
2958  }
2959  else
2960  {
2961  value = OREF_NULLSTRING; /* default to a null string */
2962  }
2963  }
2964  return value; /* return value from exit */
2965 }
2966 
2967 
2968 void RexxActivity::queue( /* write a line to the queue */
2969  RexxActivation *activation, /* sending activation */
2970  RexxString *line, /* line to write */
2971  int order) /* LIFO or FIFO order */
2972 /******************************************************************************/
2973 /* Function: Write a line to the external data queue */
2974 /******************************************************************************/
2975 {
2976  /* if exit declines call */
2977  if (this->callPushExit(activation, line, order))
2978  {
2979  /* get the default queue */
2980  RexxObject *targetQueue = getLocalEnvironment(OREF_REXXQUEUE);
2981  if (targetQueue != OREF_NULL) /* have a data queue? */
2982  {
2983  /* pull from the queue */
2984  if (order == QUEUE_LIFO) /* push instruction? */
2985  {
2986  /* push a line */
2987  targetQueue->sendMessage(OREF_PUSH, (RexxObject *)line);
2988 
2989  }
2990  else
2991  {
2992  /* queue a line */
2993  targetQueue->sendMessage(OREF_QUEUENAME, (RexxObject *)line);
2994  }
2995  }
2996  }
2997 }
2998 
3000 /******************************************************************************/
3001 /* Function: Mark this FREE activity for termination. Set its exit flag to 1 */
3002 /* and POST its run semaphore. */
3003 /******************************************************************************/
3004 {
3005  this->exit = true; /* Activity should exit */
3006  this->runsem.post(); /* let him run so he knows to exi*/
3007 }
3008 
3009 
3019 {
3020  size_t startDepth; /* starting depth of activation stack*/
3021 
3022  /* make sure we have the stack base */
3024  this->generateRandomNumberSeed(); /* get a fresh random seed */
3025  startDepth = stackFrameDepth; /* Remember activation stack depth */
3026  /* Push marker onto stack so we know */
3027  this->createNewActivationStack(); /* what level we entered. */
3028 
3029  // save the actitivation level in case there's an error unwind for an unhandled
3030  // exception;
3031  size_t activityLevel = getActivationLevel();
3032  // create a new native activation
3034  pushStackFrame(newNActa); /* push it on the activity stack */
3035 
3036  try
3037  {
3038  // go run the target under the new activation
3039  newNActa->run(target);
3040  }
3041  catch (ActivityException)
3042  {
3043  // if we're not the current kernel holder when things return, make sure we
3044  // get the lock before we continue
3046  {
3047  requestAccess();
3048  }
3049 
3050  // now do error processing
3051  wholenumber_t rc = this->error(); /* do error cleanup */
3052  target.handleError(rc, conditionobj);
3053  }
3054 
3055  // make sure we get restored to the same base activation level.
3056  restoreActivationLevel(activityLevel);
3057  // give uninit objects a chance to run
3059  // unwind to the same stack depth as the start, removing all new entries
3060  unwindToDepth(startDepth);
3061  // if a condition occurred, make sure we inject this into the API-level
3062  // native activation so the caller can check to see if an error occurred.
3063  if (target.conditionData != OREF_NULL)
3064  {
3066  }
3067  // make sure we clear this from the activity
3069 }
3070 
3071 
3080 {
3081  // create new activation frame using the current Rexx frame (which can be null, but
3082  // is not likely to be).
3084  // this becomes the new top activation. We also turn on the variable pool for
3085  // this situation.
3086  this->pushStackFrame(new_activation);
3087  new_activation->enableVariablepool();
3088 
3089  // go run this
3090  new_activation->run(target);
3091  this->popStackFrame(new_activation); /* pop the top activation */
3092 }
3093 
3094 
3103 {
3104  // create new activation frame using the current Rexx frame (which can be null, but
3105  // is not likely to be).
3107  // this becomes the new top activation.
3108  this->pushStackFrame(new_activation);
3109  // go run this
3110  new_activation->run(target);
3111  // and pop the activation when we're done.
3112  this->popStackFrame(new_activation);
3113 }
3114 
3115 
3122 {
3123  // copy all of the system exits
3124  for (int i = 0; i < LAST_EXIT; i++)
3125  {
3126  sysexits[i] = parent->sysexits[i];
3127  }
3128  clauseExitUsed = parent->clauseExitUsed;
3129 }
3130 
3131 
3139 {
3140  // hook this up with the activity
3143  context.context = owner;
3144 }
3145 
3146 
3154 {
3155  // hook this up with the activity
3158  context.context = owner;
3159 }
3160 
3162 
3163 
3169 {
3170  // hook this up with the activity
3173  context.context = owner;
3174 }
3175 
3176 
3188 {
3189  return instance->resolveProgramName(name, dir, ext);
3190 }
3191 
3192 
3201 {
3202  return instance->getLocalEnvironment(name);
3203 }
3204 
3205 
3216 {
3217  return instance->resolveCommandHandler(name);
3218 }
3219 
3220 
3225 {
3227  {
3229  }
3230 
3231 }
3232 
3233 
3240 {
3241  return activationFrames->messageName();
3242 }
3243 
3244 
3251 {
3252  return activationFrames->method();
3253 }
RexxActivity::traceInput
RexxString * traceInput(RexxActivation *)
Definition: RexxActivity.cpp:2861
RexxActivity::nestedActivity
RexxActivity * nestedActivity
Definition: RexxActivity.hpp:388
RexxActivity::callInitializationExit
void callInitializationExit(RexxActivation *)
Definition: RexxActivity.cpp:2054
RexxActivity::callExit
bool callExit(RexxActivation *activation, const char *exitName, int function, int subfunction, void *exitbuffer)
Definition: RexxActivity.cpp:2030
RXCMD
#define RXCMD
Definition: rexxapidefs.h:173
MethodContext::threadContext
RexxMethodContext threadContext
Definition: ActivationApiContexts.hpp:74
RexxNativeActivation::enableVariablepool
void enableVariablepool()
Definition: RexxNativeActivation.cpp:2265
RexxActivity::queue
void queue(RexxActivation *, RexxString *, int)
Definition: RexxActivity.cpp:2968
CallbackDispatcher
Definition: CallbackDispatcher.hpp:47
RexxActivity::createNewActivationStack
void createNewActivationStack()
Definition: RexxActivity.cpp:1486
Error_Interpretation
#define Error_Interpretation
Definition: RexxErrorCodes.h:400
_RXHLTTST_PARM::rxhlt_flags
RXHLT_FLAGS rxhlt_flags
Definition: rexx.h:599
RexxActivity::runThread
void runThread()
Definition: RexxActivity.cpp:85
SysActivity::validateThread
bool validateThread()
Definition: SysActivity.cpp:140
RXSIOSAY
#define RXSIOSAY
Definition: rexxapidefs.h:181
SystemInterpreter::releaseResultMemory
static void releaseResultMemory(void *)
Definition: MemorySupport.cpp:75
RexxObject::sendMessage
void sendMessage(RexxString *, RexxArray *, ProtectedObject &)
Definition: ObjectClass.cpp:668
new_array
RexxArray * new_array(size_t s)
Definition: ArrayClass.hpp:250
RexxActivity::setupExits
void setupExits()
Definition: RexxActivity.cpp:1685
InterpreterInstance::getExitHandler
ExitHandler & getExitHandler(int exitNum)
Definition: InterpreterInstance.hpp:98
MethodContext::context
RexxNativeActivation * context
Definition: ActivationApiContexts.hpp:75
RexxActivity::clauseExitUsed
bool clauseExitUsed
Definition: RexxActivity.hpp:383
RexxArray
Definition: ArrayClass.hpp:100
InterpreterInstance::spawnActivity
RexxActivity * spawnActivity(RexxActivity *parent)
Definition: InterpreterInstance.cpp:287
RexxActivity::updateFrameMarkers
void updateFrameMarkers()
Definition: RexxActivity.cpp:1437
Message_Translations_error
#define Message_Translations_error
Definition: RexxErrorCodes.h:601
SysActivity::getThreadID
thread_id_t getThreadID()
Definition: SysActivity.hpp:84
RexxActivity::guardsem
SysSemaphore guardsem
Definition: RexxActivity.hpp:370
RexxActivation::currentLine
size_t currentLine()
Definition: RexxActivation.cpp:1184
RexxActivity::deactivate
void deactivate()
Definition: RexxActivity.hpp:256
SysSemaphore::reset
void reset()
Definition: SysSemaphore.cpp:213
RexxActivity::getApiContext
RexxNativeActivation * getApiContext()
Definition: RexxActivity.hpp:297
RexxMethodContext_::functions
MethodContextInterface * functions
Definition: oorexxapi.h:1407
_RXFNCCAL_PARM::rxfnc_quel
unsigned short rxfnc_quel
Definition: rexx.h:470
_RXMSQPLL_PARM::rxmsq_retc
RXSTRING rxmsq_retc
Definition: rexx.h:532
RexxActivity::requestingString
bool requestingString
Definition: RexxActivity.hpp:376
RexxActivationBase::getNumericSettings
virtual NumericSettings * getNumericSettings()
Definition: ObjectClass.hpp:582
_RXEXFCAL_PARM::rxfnc_name
CONSTRXSTRING rxfnc_name
Definition: rexx.h:505
RexxActivity::getLocal
RexxDirectory * getLocal()
Definition: RexxActivity.cpp:1980
RXSIO
#define RXSIO
Definition: rexxapidefs.h:180
_RXMSQPSH_PARM::rxmsq_value
CONSTRXSTRING rxmsq_value
Definition: rexx.h:545
RexxActivation::yield
void yield()
Definition: RexxActivation.cpp:3652
InterpreterInstance::getSecurityManager
SecurityManager * getSecurityManager()
Definition: InterpreterInstance.hpp:107
RexxActivity::topStackFrame
RexxActivationBase * topStackFrame
Definition: RexxActivity.hpp:366
ActivityManager::relinquish
static void relinquish(RexxActivity *activity)
Definition: ActivityManager.cpp:798
Numerics::setDefaultSettings
static NumericSettings * setDefaultSettings()
Definition: Numerics.hpp:113
TheFalseObject
#define TheFalseObject
Definition: RexxCore.h:184
RXOFNCCAL
#define RXOFNCCAL
Definition: rexxapidefs.h:203
RexxActivity::callPullExit
bool callPullExit(RexxActivation *, RexxString *&)
Definition: RexxActivity.cpp:2495
CommandHandler
Definition: CommandHandler.hpp:52
_RXSIOTRD_PARM::rxsiotrd_retc
RXSTRING rxsiotrd_retc
Definition: rexx.h:581
RexxActivity::callQueueSizeExit
bool callQueueSizeExit(RexxActivation *, RexxInteger *&)
Definition: RexxActivity.cpp:2573
RexxActivity::relinquish
void relinquish()
Definition: RexxActivity.cpp:1853
_RXEXF_FLAGS::rxffnfnd
unsigned rxffnfnd
Definition: rexx.h:499
RXMSQPSH
#define RXMSQPSH
Definition: rexxapidefs.h:177
RexxActivity::stackBase
char * stackBase
Definition: RexxActivity.hpp:382
ActivityDispatcher
Definition: ActivityDispatcher.hpp:47
RexxActivity::threadContext
ActivityContext threadContext
Definition: RexxActivity.hpp:342
PackageClass.hpp
_RXFNCCAL_PARM::rxfnc_namel
unsigned short rxfnc_namel
Definition: rexx.h:468
RexxActivity::getEffectiveSecurityManager
SecurityManager * getEffectiveSecurityManager()
Definition: RexxActivity.cpp:2782
ActivationFrame
Definition: ActivationFrame.hpp:49
RexxActivity::requiresTable
RexxTable * requiresTable
Definition: RexxActivity.hpp:346
new_integer
RexxInteger * new_integer(wholenumber_t v)
Definition: IntegerClass.hpp:198
RexxActivity::callObjectFunctionExit
bool callObjectFunctionExit(RexxActivation *, RexxString *, RexxObject *, ProtectedObject &, RexxObject **, size_t)
Definition: RexxActivity.cpp:2303
RexxObject::defaultName
virtual RexxString * defaultName()
Definition: ObjectClass.cpp:1520
memory_mark_general
#define memory_mark_general(oref)
Definition: RexxMemory.hpp:437
memoryObject
RexxMemory memoryObject
Definition: RexxMemory.cpp:84
RexxActivity::enterKernel
void enterKernel()
Definition: RexxActivity.cpp:1757
RexxActivity::instance
InterpreterInstance * instance
Definition: RexxActivity.hpp:341
RexxActivity::createCallContext
void createCallContext(CallContext &context, RexxNativeActivation *owner)
Definition: RexxActivity.cpp:3153
SecurityManager::checkCommand
bool checkCommand(RexxActivity *, RexxString *address, RexxString *command, ProtectedObject &result, ProtectedObject &condition)
Definition: SecurityManager.cpp:233
RexxActivation::getSourceObject
RexxSource * getSourceObject()
Definition: RexxActivation.hpp:325
_RXMSQNAM_PARM
Definition: rexx.h:558
RexxActivation.hpp
RexxActivationStack::liveGeneral
void liveGeneral(int reason)
Definition: RexxActivationStack.cpp:98
RexxActivity::enterCurrentThread
void enterCurrentThread()
Definition: RexxActivity.cpp:201
StackFrameClass
Definition: StackFrameClass.hpp:59
RexxActivity::checkActivationStack
void checkActivationStack()
Definition: RexxActivity.cpp:1414
ActivityDispatcher::handleError
virtual void handleError(wholenumber_t, RexxDirectory *)
Definition: ActivityDispatcher.cpp:62
RexxActivity::stackcheck
bool stackcheck
Definition: RexxActivity.hpp:374
RexxActivationStack::init
void init()
Definition: RexxActivationStack.cpp:107
RexxActivity::unwindToFrame
void unwindToFrame(RexxActivation *frame)
Definition: RexxActivity.cpp:1627
RXVALUE
#define RXVALUE
Definition: rexxapidefs.h:200
RexxActivity::exitCurrentThread
void exitCurrentThread()
Definition: RexxActivity.cpp:184
RXMSQSIZ
#define RXMSQSIZ
Definition: rexxapidefs.h:178
RXFNC
#define RXFNC
Definition: rexxapidefs.h:171
RexxActivity::traceOutput
void traceOutput(RexxActivation *, RexxString *)
Definition: RexxActivity.cpp:2811
RexxActivity::disableExit
void disableExit(int exitNum)
Definition: RexxActivity.hpp:338
Error_System_service_service
#define Error_System_service_service
Definition: RexxErrorCodes.h:398
RexxActivationBase::getSecurityManager
virtual SecurityManager * getSecurityManager()=0
RXCMDHST
#define RXCMDHST
Definition: rexxapidefs.h:174
RXHLT
#define RXHLT
Definition: rexxapidefs.h:186
_CONSTRXSTRING::strptr
const char * strptr
Definition: rexx.h:163
Numerics::getDefaultSettings
static NumericSettings * getDefaultSettings()
Definition: Numerics.hpp:114
RexxActivity::detachThread
void detachThread()
Definition: RexxActivity.cpp:1714
RexxActivity::halt
bool halt(RexxString *)
Definition: RexxActivity.cpp:1886
RexxActivity::callDebugInputExit
bool callDebugInputExit(RexxActivation *, RexxString *&)
Definition: RexxActivity.cpp:2153
CallContext::threadContext
RexxCallContext threadContext
Definition: ActivationApiContexts.hpp:80
_RXVARNOVALUE_PARM
Definition: rexx.h:615
RexxNativeActivation.hpp
GlobalProtectedObject.hpp
PointerClass.hpp
ActivationFrame::getSource
virtual RexxSource * getSource()=0
RexxActivity::buildMessage
RexxString * buildMessage(wholenumber_t, RexxArray *)
Definition: RexxActivity.cpp:1011
_RXTRCTST_PARM::rxtrc_flags
RXTRC_FLAGS rxtrc_flags
Definition: rexx.h:611
SystemInterpreter::allocateResultMemory
static void * allocateResultMemory(size_t)
Definition: MemorySupport.cpp:63
RexxNativeActivation::run
void run(RexxMethod *_method, RexxNativeMethod *_code, RexxObject *_receiver, RexxString *_msgname, RexxObject **_arglist, size_t _argcount, ProtectedObject &resultObj)
Definition: RexxNativeActivation.cpp:1211
RexxString::pos
size_t pos(RexxString *, size_t)
Definition: StringClassMisc.cpp:721
_RXMSQPSH_PARM::rxmsq_flags
RXMSQ_FLAGS rxmsq_flags
Definition: rexx.h:544
RexxActivity::run
void run()
Definition: RexxActivity.cpp:1384
Numerics::maxVal
static wholenumber_t maxVal(wholenumber_t n1, wholenumber_t n2)
Definition: Numerics.hpp:118
_RXFNCCAL_PARM::rxfnc_name
CSTRING rxfnc_name
Definition: rexx.h:467
RexxActivity::frameStack
RexxActivationStack frameStack
Definition: RexxActivity.hpp:344
RexxActivity::activations
RexxInternalStack * activations
Definition: RexxActivity.hpp:354
RexxActivity::postDispatch
void postDispatch()
Definition: RexxActivity.cpp:1834
RexxString::getLength
size_t getLength()
Definition: StringClass.hpp:330
ActivationFrame::method
virtual RexxMethod * method()=0
SysActivity::yield
static void yield()
Definition: SysActivity.hpp:88
_RXSTRING::strptr
char * strptr
Definition: rexx.h:158
RANDOMIZE
uint64_t RANDOMIZE(uint64_t seed)
Definition: RexxActivation.hpp:72
ProtectedObject::protectedObject
RexxObject * protectedObject
Definition: ProtectedObject.hpp:164
RexxActivation::externalTraceOff
void externalTraceOff()
Definition: RexxActivation.cpp:3675
RexxArray::size
size_t size()
Definition: ArrayClass.hpp:200
RexxActivity::threadIdMethod
thread_id_t threadIdMethod()
Definition: RexxActivity.cpp:1988
RexxNativeActivation::setStackBase
void setStackBase()
Definition: RexxNativeActivation.hpp:153
new_internalstack
RexxInternalStack * new_internalstack(size_t s)
Definition: RexxInternalStack.hpp:86
InterpreterInstance::detachThread
bool detachThread()
Definition: InterpreterInstance.cpp:272
_RXMSQPSH_PARM
Definition: rexx.h:543
RexxActivity::createExitContext
void createExitContext(ExitContext &context, RexxNativeActivation *owner)
Definition: RexxActivity.cpp:3161
RexxActivity::guardWait
void guardWait()
Definition: RexxActivity.cpp:1807
_RXOFNC_FLAGS::rxffsub
unsigned rxffsub
Definition: rexx.h:482
RexxActivity::exitContextFunctions
static ExitContextInterface exitContextFunctions
Definition: RexxActivity.hpp:394
Message_Translations_debug_error
#define Message_Translations_debug_error
Definition: RexxErrorCodes.h:604
_RXVARNOVALUE_PARM::variable_name
RexxStringObject variable_name
Definition: rexx.h:616
RexxActivity::raisePropagate
void raisePropagate(RexxDirectory *)
Definition: RexxActivity.cpp:1148
RexxVariableDictionary
Definition: RexxVariableDictionary.hpp:55
RexxActivity::requestAccess
void requestAccess()
Definition: RexxActivity.cpp:1945
RexxActivity::checkStackSpace
void checkStackSpace()
Definition: RexxActivity.cpp:1964
ActivationFrame.hpp
RexxActivity::releaseAccess
void releaseAccess()
Definition: RexxActivity.cpp:1931
RexxDirectory::at
RexxObject * at(RexxString *)
Definition: DirectoryClass.cpp:567
TableClass.hpp
_RXEXFCAL_PARM::rxfnc_argv
RexxObjectPtr * rxfnc_argv
Definition: rexx.h:507
ExitHandler
Definition: ExitHandler.hpp:52
reportException
void reportException(wholenumber_t error)
Definition: ActivityManager.hpp:136
RXNOVALCALL
#define RXNOVALCALL
Definition: rexxapidefs.h:199
InterpreterInstance::poolActivity
bool poolActivity(RexxActivity *activity)
Definition: InterpreterInstance.cpp:311
RexxActivity::guardPost
void guardPost()
Definition: RexxActivity.cpp:1817
ActivityManager::newNativeActivation
static RexxNativeActivation * newNativeActivation(RexxActivity *activity, RexxActivation *parent)
Definition: ActivityManager.cpp:308
RexxActivity::runsem
SysSemaphore runsem
Definition: RexxActivity.hpp:369
RXSIOTRC
#define RXSIOTRC
Definition: rexxapidefs.h:182
RXTRC
#define RXTRC
Definition: rexxapidefs.h:189
_RXVALCALL_PARM::variable_name
RexxStringObject variable_name
Definition: rexx.h:623
RexxActivity::reportAnException
void reportAnException(wholenumber_t, const char *)
Definition: RexxActivity.cpp:586
Error_Execution_deadlock
#define Error_Execution_deadlock
Definition: RexxErrorCodes.h:526
RexxInstruction.hpp
PCONSTRXSTRING
CONSTRXSTRING * PCONSTRXSTRING
Definition: rexx.h:186
RecursiveStringError
Definition: RexxActivity.hpp:110
InterpreterInstance::getLocal
RexxDirectory * getLocal()
Definition: InterpreterInstance.hpp:112
_RXOFNCCAL_PARM::rxfnc_argv
RexxObjectPtr * rxfnc_argv
Definition: rexx.h:489
_RXFNCCAL_PARM::rxfnc_argv
PCONSTRXSTRING rxfnc_argv
Definition: rexx.h:472
RexxString::isEqual
bool isEqual(RexxObject *)
Definition: StringClass.cpp:482
TheTrueObject
#define TheTrueObject
Definition: RexxCore.h:185
RexxActivity::setTrace
bool setTrace(bool)
Definition: RexxActivity.cpp:1909
RexxString::getStringData
const char * getStringData()
Definition: StringClass.hpp:333
ExitContext::context
RexxNativeActivation * context
Definition: ActivationApiContexts.hpp:87
RexxActivity::flatten
void flatten(RexxEnvelope *)
Definition: RexxActivity.cpp:1369
SystemInterpreter::getMessageHeader
static RexxString * getMessageHeader(wholenumber_t code)
Definition: ErrorMessages.cpp:180
RexxString::getChar
char getChar(size_t p)
Definition: StringClass.hpp:338
RexxActivationBase
Definition: ObjectClass.hpp:574
MessageDispatcher.hpp
RexxActivity::reraiseException
void reraiseException(RexxDirectory *)
Definition: RexxActivity.cpp:1105
_RXCMD_FLAGS::rxfcfail
unsigned rxfcfail
Definition: rexx.h:514
work
char work[256]
Definition: rxqueue.cpp:82
RexxEnvelope
Definition: RexxEnvelope.hpp:53
RexxInternalObject::clearObject
void clearObject()
Definition: ObjectClass.hpp:231
ProtectedObject::next
ProtectedObject * next
Definition: ProtectedObject.hpp:165
RexxActivity::getLastMethod
RexxMethod * getLastMethod()
Definition: RexxActivity.cpp:3250
CallContext::context
RexxNativeActivation * context
Definition: ActivationApiContexts.hpp:81
IntegerZero
#define IntegerZero
Definition: RexxCore.h:188
RexxInternalStack
Definition: RexxInternalStack.hpp:48
TrappingDispatcher
Definition: TrappingDispatcher.hpp:47
RexxArray::get
RexxObject * get(size_t pos)
Definition: ArrayClass.hpp:201
RexxActivity::addToInstance
void addToInstance(InterpreterInstance *interpreter)
Definition: RexxActivity.cpp:1667
thread_id_t
pthread_t thread_id_t
Definition: rexxapitypes.h:65
RexxMemory.hpp
_RXVARNOVALUE_PARM::value
RexxObjectPtr value
Definition: rexx.h:617
RexxActivity::unwindStackFrame
void unwindStackFrame()
Definition: RexxActivity.cpp:1574
Error_Function_no_data_function
#define Error_Function_no_data_function
Definition: RexxErrorCodes.h:386
RexxActivity::error
wholenumber_t error()
Definition: RexxActivity.cpp:323
RexxActivity::setupAttachedActivity
void setupAttachedActivity(InterpreterInstance *interpreter)
Definition: RexxActivity.cpp:1647
RexxActivity::pushStackFrame
void pushStackFrame(RexxActivationBase *new_activation)
Definition: RexxActivity.cpp:1462
Interpreter.hpp
Error_Control_stack_full
#define Error_Control_stack_full
Definition: RexxErrorCodes.h:93
isOfClass
#define isOfClass(t, r)
Definition: RexxCore.h:211
Message_Translations_line
#define Message_Translations_line
Definition: RexxErrorCodes.h:603
RexxActivity::displayCondition
wholenumber_t displayCondition(RexxDirectory *conditionObject)
Definition: RexxActivity.cpp:376
RexxActivity::getTopStackFrame
RexxActivationBase * getTopStackFrame()
Definition: RexxActivity.hpp:281
ACT_STACK_SIZE
const size_t ACT_STACK_SIZE
Definition: RexxActivity.cpp:80
RexxInternalStack::push
void push(RexxObject *value)
Definition: RexxInternalStack.hpp:60
_RXEXFCAL_PARM
Definition: rexx.h:503
Interpreter::messageNumber
static wholenumber_t messageNumber(RexxString *)
Definition: Interpreter.cpp:562
RexxActivity::createExceptionObject
RexxDirectory * createExceptionObject(wholenumber_t, RexxString *, RexxArray *, RexxObject *)
Definition: RexxActivity.cpp:813
RexxActivity::raiseException
void raiseException(wholenumber_t, RexxString *, RexxArray *, RexxObject *)
Definition: RexxActivity.cpp:740
RexxActivity::generateRandomNumberSeed
void generateRandomNumberSeed()
Definition: RexxActivity.cpp:298
_RXCMDHST_PARM::rxcmd_retc
RXSTRING rxcmd_retc
Definition: rexx.h:525
RexxActivity::reset
void reset()
Definition: RexxActivity.cpp:278
SysSemaphore::close
void close()
Definition: SysSemaphore.cpp:153
_RXEXFCAL_PARM::rxfnc_argc
size_t rxfnc_argc
Definition: rexx.h:506
SysSemaphore::create
void create()
Definition: SysSemaphore.cpp:89
_RXEXFCAL_PARM::rxfnc_flags
RXEXF_FLAGS rxfnc_flags
Definition: rexx.h:504
RexxSource
Definition: SourceFile.hpp:131
_RXFNCCAL_PARM::rxfnc_retc
RXSTRING rxfnc_retc
Definition: rexx.h:473
RexxActivity::getCurrentRexxFrame
RexxActivation * getCurrentRexxFrame()
Definition: RexxActivity.hpp:280
CallContext
Definition: ActivationApiContexts.hpp:78
RXINI
#define RXINI
Definition: rexxapidefs.h:191
RexxNativeActivation::setConditionInfo
void setConditionInfo(RexxDirectory *info)
Definition: RexxNativeActivation.hpp:132
RexxActivity::yield
void yield()
Definition: RexxActivity.cpp:1865
new_string
RexxString * new_string(const char *s, stringsize_t l)
Definition: StringClass.hpp:524
LAST_EXIT
#define LAST_EXIT
Definition: RexxActivity.hpp:116
RexxDateTime
Definition: RexxDateTime.hpp:110
MAKERXSTRING
#define MAKERXSTRING(r, p, l)
Definition: rexx.h:182
RexxActivity::callSayExit
bool callSayExit(RexxActivation *, RexxString *)
Definition: RexxActivity.cpp:2084
RexxActivity::callValueExit
bool callValueExit(RexxActivation *, RexxString *, RexxString *, RexxObject *, RexxObject *&)
Definition: RexxActivity.cpp:2746
SystemInterpreter.hpp
TOTAL_STACK_SIZE
#define TOTAL_STACK_SIZE
Definition: PlatformDefinitions.h:59
RexxActivity::inheritSettings
void inheritSettings(RexxActivity *parent)
Definition: RexxActivity.cpp:3121
RexxActivity::callCommandExit
bool callCommandExit(RexxActivation *, RexxString *, RexxString *, ProtectedObject &result, ProtectedObject &condition)
Definition: RexxActivity.cpp:2435
RexxActivity::errorNumber
wholenumber_t errorNumber(RexxDirectory *conditionObject)
Definition: RexxActivity.cpp:408
_RXEXF_FLAGS::rxffsub
unsigned rxffsub
Definition: rexx.h:500
ActivityDispatcher::conditionData
RexxDirectory * conditionData
Definition: ActivityDispatcher.hpp:63
RexxActivity::protectedObjects
ProtectedObject * protectedObjects
Definition: RexxActivity.hpp:386
RexxActivity::waitingObject
RexxObject * waitingObject
Definition: RexxActivity.hpp:368
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
RexxActivity::activationStackSize
size_t activationStackSize
Definition: RexxActivity.hpp:355
RexxActivity::liveGeneral
void liveGeneral(int reason)
Definition: RexxActivity.cpp:1345
ArrayClass.hpp
_RXOFNC_FLAGS::rxfferr
unsigned rxfferr
Definition: rexx.h:480
RexxActivity::unwindToDepth
void unwindToDepth(size_t depth)
Definition: RexxActivity.cpp:1604
SysActivity::getStackBase
char * getStackBase(size_t stackSize)
Definition: SysActivity.cpp:163
RexxThreadContext_::functions
RexxThreadInterface * functions
Definition: oorexxapi.h:713
Error_Incorrect_call_external
#define Error_Incorrect_call_external
Definition: RexxErrorCodes.h:327
RXMSQ
#define RXMSQ
Definition: rexxapidefs.h:175
RexxActivity
Definition: RexxActivity.hpp:127
_RXOFNCCAL_PARM::rxfnc_retc
RexxObjectPtr rxfnc_retc
Definition: rexx.h:490
Error_System_resources
#define Error_System_resources
Definition: RexxErrorCodes.h:67
RXEXIT_HANDLED
#define RXEXIT_HANDLED
Definition: rexxapidefs.h:145
RXNOVAL
#define RXNOVAL
Definition: rexxapidefs.h:198
RexxDirectory
Definition: DirectoryClass.hpp:49
RexxList::append
RexxObject * append(RexxObject *)
Definition: ListClass.cpp:537
RXSIOTRD
#define RXSIOTRD
Definition: rexxapidefs.h:183
SysActivity::useCurrentThread
void useCurrentThread()
Definition: SysActivity.cpp:150
MethodContext
Definition: ActivationApiContexts.hpp:72
RexxActivity::currentRexxFrame
RexxActivation * currentRexxFrame
Definition: RexxActivity.hpp:365
RexxActivity::raiseCondition
bool raiseCondition(RexxString *, RexxObject *, RexxString *, RexxObject *, RexxObject *)
Definition: RexxActivity.cpp:434
ProtectedObject.hpp
Numerics::setCurrentSettings
static void setCurrentSettings(NumericSettings *s)
Definition: Numerics.hpp:112
RexxActivity::callTraceTestExit
bool callTraceTestExit(RexxActivation *, bool)
Definition: RexxActivity.cpp:2682
RexxActivity::callFunctionExit
bool callFunctionExit(RexxActivation *, RexxString *, RexxObject *, ProtectedObject &, RexxObject **, size_t)
Definition: RexxActivity.cpp:2187
RexxActivity::lineOut
RexxObject * lineOut(RexxString *)
Definition: RexxActivity.cpp:2921
RexxActivity::generateProgramInformation
void generateProgramInformation(RexxDirectory *exObj)
Definition: RexxActivity.cpp:912
_RXEXFCAL_PARM::rxfnc_retc
RexxObjectPtr rxfnc_retc
Definition: rexx.h:508
_RXCMDHST_PARM::rxcmd_dll
CSTRING rxcmd_dll
Definition: rexx.h:522
RexxActivity::checkDeadLock
void checkDeadLock(RexxActivity *)
Definition: RexxActivity.cpp:1768
RexxActivity::callPushExit
bool callPushExit(RexxActivation *, RexxString *, int)
Definition: RexxActivity.cpp:2536
ProtectedObject
Definition: ProtectedObject.hpp:46
MessageClass.hpp
StringClass.hpp
_CONSTRXSTRING::strlength
size_t strlength
Definition: rexx.h:162
SystemInterpreter::getMessageText
static RexxString * getMessageText(wholenumber_t code)
Definition: ErrorMessages.cpp:99
RXTEREXT
#define RXTEREXT
Definition: rexxapidefs.h:194
RXMSQNAM
#define RXMSQNAM
Definition: rexxapidefs.h:179
ActivationFrame::next
ActivationFrame * next
Definition: ActivationFrame.hpp:75
RexxThreadInterface::RexxNil
RexxObjectPtr RexxNil
Definition: oorexxapi.h:597
StackFrameClass.hpp
RexxInternalStack::getTop
RexxObject * getTop()
Definition: RexxInternalStack.hpp:65
RexxInternalObject::isOldSpace
bool isOldSpace()
Definition: ObjectClass.hpp:252
RexxActivity::resolveCommandHandler
CommandHandler * resolveCommandHandler(RexxString *)
Definition: RexxActivity.cpp:3215
_RXFNCCAL_PARM::rxfnc_flags
RXFNC_FLAGS rxfnc_flags
Definition: rexx.h:466
RXSIODTR
#define RXSIODTR
Definition: rexxapidefs.h:184
SysActivity::close
void close()
Definition: SysActivity.cpp:69
RexxActivity::guardSet
void guardSet()
Definition: RexxActivity.cpp:1825
RexxMemory::runUninits
void runUninits()
Definition: RexxMemory.cpp:507
RexxActivity::popStackFrame
void popStackFrame(bool reply)
Definition: RexxActivity.cpp:1508
RexxActivity::methodContextFunctions
static MethodContextInterface methodContextFunctions
Definition: RexxActivity.hpp:392
_RXCMD_FLAGS::rxfcerr
unsigned rxfcerr
Definition: rexx.h:515
InterpreterInstance::resolveProgramName
RexxString * resolveProgramName(RexxString *name, RexxString *dir, RexxString *ext)
Definition: InterpreterInstance.hpp:106
MIN_C_STACK
#define MIN_C_STACK
Definition: PlatformDefinitions.h:58
_RXCMDHST_PARM::rxcmd_command
CONSTRXSTRING rxcmd_command
Definition: rexx.h:524
RexxActivity::callScriptingExit
bool callScriptingExit(RexxActivation *, RexxString *, RexxObject *, ProtectedObject &, RexxObject **, size_t)
Definition: RexxActivity.cpp:2374
_RXSIOTRD_PARM
Definition: rexx.h:580
StackFrameClass::getLine
RexxObject * getLine()
Definition: StackFrameClass.cpp:211
RexxActivity::pullInput
RexxString * pullInput(RexxActivation *)
Definition: RexxActivity.cpp:2893
ActivityManager::addWaitingActivity
static void addWaitingActivity(RexxActivity *a, bool release)
Definition: ActivityManager.cpp:125
_RXOFNCCAL_PARM
Definition: rexx.h:485
UnhandledCondition
Definition: RexxActivity.hpp:112
RexxActivity::callTerminationExit
void callTerminationExit(RexxActivation *)
Definition: RexxActivity.cpp:2071
RexxString::concatWith
RexxString * concatWith(RexxString *, char)
Definition: StringClass.cpp:1743
RexxActivity::stackFrameDepth
size_t stackFrameDepth
Definition: RexxActivity.hpp:356
ActivityManager::lockKernelImmediate
static bool lockKernelImmediate()
Definition: ActivityManager.cpp:593
_RXCMDHST_PARM::rxcmd_address
CSTRING rxcmd_address
Definition: rexx.h:520
_RXHLT_FLAGS::rxfhhalt
unsigned rxfhhalt
Definition: rexx.h:595
RexxActivity::resetRunningRequires
void resetRunningRequires()
Definition: RexxActivity.hpp:287
RXVALUECALL
#define RXVALUECALL
Definition: rexxapidefs.h:201
_RXCMDHST_PARM::rxcmd_flags
RXCMD_FLAGS rxcmd_flags
Definition: rexx.h:519
RexxMessage
Definition: MessageClass.hpp:54
RexxActivity::cleanupStackFrame
void cleanupStackFrame(RexxActivationBase *poppedStackFrame)
Definition: RexxActivity.cpp:1539
InterpreterInstance::getInstanceContext
RexxInstance * getInstanceContext()
Definition: InterpreterInstance.hpp:109
_RXCMDHST_PARM::rxcmd_dll_len
unsigned short rxcmd_dll_len
Definition: rexx.h:523
RexxArray::append
size_t append(RexxObject *)
Definition: ArrayClass.cpp:482
RexxActivity::exitKernel
void exitKernel()
Definition: RexxActivity.cpp:1736
RexxDirectory::put
RexxObject * put(RexxObject *, RexxString *)
Definition: DirectoryClass.cpp:636
RexxActivity::validateThread
void validateThread()
Definition: RexxActivity.cpp:3224
RexxInternalStack::fastPop
RexxObject * fastPop()
Definition: RexxInternalStack.hpp:62
StackClass.hpp
RexxActivity::kill
void kill(RexxDirectory *)
Definition: RexxActivity.cpp:1843
RexxActivity::isInactive
bool isInactive()
Definition: RexxActivity.hpp:258
RexxString::extract
RexxString * extract(size_t offset, size_t sublength)
Definition: StringClass.hpp:229
RXHLTCLR
#define RXHLTCLR
Definition: rexxapidefs.h:187
_RXFNCCAL_PARM::rxfnc_argc
unsigned short rxfnc_argc
Definition: rexx.h:471
memory_mark
#define memory_mark(oref)
Definition: RexxMemory.hpp:436
_RXCMDHST_PARM
Definition: rexx.h:518
RexxCode.hpp
RexxActivity::displayDebug
RexxObject * displayDebug(RexxDirectory *)
Definition: RexxActivity.cpp:1283
RexxThreadInterface::RexxFalse
RexxObjectPtr RexxFalse
Definition: oorexxapi.h:599
new_table
RexxTable * new_table()
Definition: TableClass.hpp:76
RexxSource::getProgramName
RexxString * getProgramName()
Definition: SourceFile.hpp:290
RXEXF
#define RXEXF
Definition: rexxapidefs.h:196
_RXHLTTST_PARM
Definition: rexx.h:598
RXTER
#define RXTER
Definition: rexxapidefs.h:193
SecurityManager
Definition: SecurityManager.hpp:52
RexxActivity::messageSubstitution
RexxString * messageSubstitution(RexxString *, RexxArray *)
Definition: RexxActivity.cpp:1025
RXTRCTST
#define RXTRCTST
Definition: rexxapidefs.h:190
_RXTRCTST_PARM
Definition: rexx.h:610
RexxActivation::getEffectiveSecurityManager
SecurityManager * getEffectiveSecurityManager()
Definition: RexxActivation.cpp:4271
QUEUE_LIFO
Definition: ServiceMessage.hpp:195
RexxActivity::setSuspended
void setSuspended(bool s)
Definition: RexxActivity.hpp:262
REQUEST_STRING
RexxString * REQUEST_STRING(RexxObject *object)
Definition: RexxCore.h:276
RexxActivity::attached
bool attached
Definition: RexxActivity.hpp:379
RexxActivity::callContextFunctions
static CallContextInterface callContextFunctions
Definition: RexxActivity.hpp:393
RexxObject::numberValue
virtual bool numberValue(wholenumber_t &result, size_t precision)
Definition: ObjectClass.cpp:963
SysSemaphore::post
void post()
Definition: SysSemaphore.cpp:164
RexxActivity::generateStackFrames
RexxArray * generateStackFrames(bool skipFirst)
Definition: RexxActivity.cpp:976
RexxThreadInterface::RexxTrue
RexxObjectPtr RexxTrue
Definition: oorexxapi.h:598
RexxActivation
Definition: RexxActivation.hpp:156
RexxActivity::getInstanceSecurityManager
SecurityManager * getInstanceSecurityManager()
Definition: RexxActivity.cpp:2803
RexxInternalObject::setHasNoReferences
void setHasNoReferences()
Definition: ObjectClass.hpp:240
RexxString::toRxstring
void toRxstring(CONSTRXSTRING &r)
Definition: StringClass.hpp:351
SecurityManager::checkFunctionCall
bool checkFunctionCall(RexxString *functionName, size_t count, RexxObject **arguments, ProtectedObject &result)
Definition: SecurityManager.cpp:199
_RXFNCCAL_PARM::rxfnc_que
CSTRING rxfnc_que
Definition: rexx.h:469
SysSemaphore::wait
void wait()
Definition: SysSemaphore.cpp:174
RexxInternalStack::peek
RexxObject * peek(size_t v)
Definition: RexxInternalStack.hpp:68
_RXFNC_FLAGS::rxfferr
unsigned rxfferr
Definition: rexx.h:460
RexxActivation::halt
bool halt(RexxString *)
Definition: RexxActivation.cpp:3632
RexxString::concatWithCstring
RexxString * concatWithCstring(const char *)
Definition: StringClass.cpp:1271
new_directory
RexxDirectory * new_directory()
Definition: DirectoryClass.hpp:101
wholenumber_t
ssize_t wholenumber_t
Definition: rexx.h:229
_RXOFNCCAL_PARM::rxfnc_argc
size_t rxfnc_argc
Definition: rexx.h:488
RexxActivity::getLastMessageName
RexxString * getLastMessageName()
Definition: RexxActivity.cpp:3239
RexxActivationBase::trap
virtual bool trap(RexxString *, RexxDirectory *)
Definition: ObjectClass.hpp:588
GlobalProtectedObject
Definition: GlobalProtectedObject.hpp:46
Error_Execution_invalid_thread
#define Error_Execution_invalid_thread
Definition: RexxErrorCodes.h:560
_RXOFNCCAL_PARM::rxfnc_name
CONSTRXSTRING rxfnc_name
Definition: rexx.h:487
InterpreterInstance
Definition: InterpreterInstance.hpp:55
Interpreter::getCurrentQueue
static RexxString * getCurrentQueue()
Definition: Interpreter.cpp:540
RXMSQPLL
#define RXMSQPLL
Definition: rexxapidefs.h:176
RexxActivationBase::dispatch
virtual RexxObject * dispatch()
Definition: ObjectClass.hpp:578
ActivityManager::unlockKernel
static void unlockKernel()
Definition: ActivityManager.cpp:551
ActivityContext::owningActivity
RexxActivity * owningActivity
Definition: ActivationApiContexts.hpp:68
RXHLTTST
#define RXHLTTST
Definition: rexxapidefs.h:188
RexxActivity::isExitEnabled
bool isExitEnabled(int exitNum)
Definition: RexxActivity.hpp:337
RexxDateTime::getBaseTime
int64_t getBaseTime()
Definition: RexxDateTime.cpp:213
RXOFNC
#define RXOFNC
Definition: rexxapidefs.h:202
new_list
RexxList * new_list()
Definition: ListClass.hpp:147
_RXTRC_FLAGS::rxftrace
unsigned rxftrace
Definition: rexx.h:606
Message_Translations_running
#define Message_Translations_running
Definition: RexxErrorCodes.h:602
RexxActivity::callHaltClearExit
bool callHaltClearExit(RexxActivation *)
Definition: RexxActivity.cpp:2661
RexxActivity::clearCurrentCondition
void clearCurrentCondition()
Definition: RexxActivity.hpp:320
RexxActivity::callQueueNameExit
bool callQueueNameExit(RexxActivation *, RexxString *&)
Definition: RexxActivity.cpp:2598
RexxActivity::restoreActivationLevel
void restoreActivationLevel(size_t l)
Definition: RexxActivity.hpp:260
_RXMSQSIZ_PARM
Definition: rexx.h:551
RexxActivationStack::live
void live(size_t)
Definition: RexxActivationStack.cpp:89
_RXSIOSAY_PARM::rxsio_string
CONSTRXSTRING rxsio_string
Definition: rexx.h:567
MessageDispatcher
Definition: MessageDispatcher.hpp:47
RexxActivity::callHaltTestExit
bool callHaltTestExit(RexxActivation *)
Definition: RexxActivity.cpp:2631
RexxActivity::callTerminalInputExit
bool callTerminalInputExit(RexxActivation *, RexxString *&)
Definition: RexxActivity.cpp:2119
RexxNativeActivation
Definition: RexxNativeActivation.hpp:62
ActivityException
ActivityException
Definition: RexxActivity.hpp:108
DEFRXSTRING
#define DEFRXSTRING
Definition: PlatformDefinitions.h:172
RexxActivity::sysexits
ExitHandler sysexits[(RXNOOFEXITS - 1)]
Definition: RexxActivity.hpp:385
TheNilObject
#define TheNilObject
Definition: RexxCore.h:180
ActivityManager::currentActivity
static RexxActivity *volatile currentActivity
Definition: ActivityManager.hpp:95
InterpreterInstance::resolveCommandHandler
CommandHandler * resolveCommandHandler(RexxString *name)
Definition: InterpreterInstance.cpp:796
RexxActivity::cleanupActivityResources
void cleanupActivityResources()
Definition: RexxActivity.cpp:172
_RXVALCALL_PARM::value
RexxObjectPtr value
Definition: rexx.h:624
_RXOFNCCAL_PARM::rxfnc_flags
RXOFNC_FLAGS rxfnc_flags
Definition: rexx.h:486
_RXCMDHST_PARM::rxcmd_addressl
unsigned short rxcmd_addressl
Definition: rexx.h:521
Error_Routine_not_found_name
#define Error_Routine_not_found_name
Definition: RexxErrorCodes.h:382
RexxActivity::callTraceExit
bool callTraceExit(RexxActivation *, RexxString *)
Definition: RexxActivity.cpp:2102
RexxActivity::getLocalEnvironment
RexxObject * getLocalEnvironment(RexxString *name)
Definition: RexxActivity.cpp:3200
RexxSource::getPackage
PackageClass * getPackage()
Definition: SourceFile.cpp:6156
RexxActivity::activationFrames
ActivationFrame * activationFrames
Definition: RexxActivity.hpp:387
RexxActivity.hpp
RexxActivity::detachInstance
void detachInstance()
Definition: RexxActivity.cpp:1723
T_Activity
Definition: ClassTypeCodes.h:186
RexxActivationBase::termination
virtual void termination()
Definition: ObjectClass.hpp:590
RexxThreadInterface::RexxNullString
RexxStringObject RexxNullString
Definition: oorexxapi.h:600
RexxDirectory::remove
RexxObject * remove(RexxString *)
Definition: DirectoryClass.cpp:433
_RXMSQPLL_PARM
Definition: rexx.h:531
RexxActivity::waitReserve
void waitReserve(RexxObject *)
Definition: RexxActivity.cpp:1794
RexxExitContext_::threadContext
RexxThreadContext * threadContext
Definition: oorexxapi.h:2908
_RXFNC_FLAGS::rxffsub
unsigned rxffsub
Definition: rexx.h:462
RexxActivity::numericSettings
NumericSettings * numericSettings
Definition: RexxActivity.hpp:372
RXINIEXT
#define RXINIEXT
Definition: rexxapidefs.h:192
_RXMSQNAM_PARM::rxmsq_name
RXSTRING rxmsq_name
Definition: rexx.h:559
ExitContext
Definition: ActivationApiContexts.hpp:84
SysActivity::create
void create(RexxActivity *activity, size_t stackSize)
Definition: SysActivity.cpp:80
ActivationFrame::messageName
virtual RexxString * messageName()=0
InterpreterInstance.hpp
RexxCallContext_::functions
CallContextInterface * functions
Definition: oorexxapi.h:2157
SystemInterpreter::getCurrentTime
static void getCurrentTime(RexxDateTime *Date)
Definition: TimeSupport.cpp:58
RexxActivity::initializeThreadContext
static void initializeThreadContext()
Definition: RexxActivity.cpp:1702
RexxActivationBase::findRexxContext
virtual RexxActivation * findRexxContext()
Definition: ObjectClass.hpp:584
_RXMSQ_FLAGS::rxfmlifo
unsigned rxfmlifo
Definition: rexx.h:539
RexxMethodContext_::threadContext
RexxThreadContext * threadContext
Definition: oorexxapi.h:1406
RexxActivity::display
RexxObject * display(RexxDirectory *)
Definition: RexxActivity.cpp:1182
RexxActivity::getExitHandler
ExitHandler & getExitHandler(int exitNum)
Definition: RexxActivity.hpp:336
RexxCore.h
RexxActivity::spawnReply
RexxActivity * spawnReply()
Definition: RexxActivity.cpp:292
_RXSIOSAY_PARM
Definition: rexx.h:566
RexxList
Definition: ListClass.hpp:63
RexxActivity::exit
bool exit
Definition: RexxActivity.hpp:375
DirectoryClass.hpp
RexxActivity::activate
void activate()
Definition: RexxActivity.hpp:255
RexxActivity::terminatePoolActivity
void terminatePoolActivity()
Definition: RexxActivity.cpp:2999
RexxCallContext_::threadContext
RexxThreadContext * threadContext
Definition: oorexxapi.h:2156
RexxActivity::conditionobj
RexxDirectory * conditionobj
Definition: RexxActivity.hpp:345
RexxActivity::randomSeed
uint64_t randomSeed
Definition: RexxActivity.hpp:384
ActivityContext::threadContext
RexxThreadContext threadContext
Definition: ActivationApiContexts.hpp:67
RexxActivity::live
void live(size_t)
Definition: RexxActivity.cpp:1321
RexxMethod
Definition: MethodClass.hpp:101
C_STACK_SIZE
#define C_STACK_SIZE
Definition: PlatformDefinitions.h:60
RexxThreadContext_::instance
RexxInstance * instance
Definition: oorexxapi.h:712
RXEXIT_RAISE_ERROR
#define RXEXIT_RAISE_ERROR
Definition: rexxapidefs.h:147
Error_Execution_error_condition
#define Error_Execution_error_condition
Definition: RexxErrorCodes.h:544
_RXEXF_FLAGS::rxfferr
unsigned rxfferr
Definition: rexx.h:498
new_object
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:422
RexxObject::stringValue
RexxString * stringValue()
Definition: ObjectClass.cpp:1036
RexxStringObject
struct _RexxStringObject * RexxStringObject
Definition: rexx.h:128
RexxExitContext_::functions
ExitContextInterface * functions
Definition: oorexxapi.h:2909
RexxActivity::createMethodContext
void createMethodContext(MethodContext &context, RexxNativeActivation *owner)
Definition: RexxActivity.cpp:3138
ActivityDispatcher.hpp
RexxInteger
Definition: IntegerClass.hpp:56
_RXOFNC_FLAGS::rxffnfnd
unsigned rxffnfnd
Definition: rexx.h:481
RexxActivation::externalTraceOn
void externalTraceOn()
Definition: RexxActivation.cpp:3663
_RXVALCALL_PARM
Definition: rexx.h:621
RexxActivity::createConditionObject
RexxDirectory * createConditionObject(RexxString *, RexxObject *, RexxString *, RexxObject *, RexxObject *)
Definition: RexxActivity.cpp:488
RexxActivity::RexxActivity
RexxActivity()
line
char line[65472]
Definition: rxqueue.cpp:81
RexxVariableDictionary.hpp
RexxActivationBase::isStackBase
virtual bool isStackBase()
Definition: ObjectClass.hpp:593
RexxActivity::lineIn
RexxString * lineIn(RexxActivation *)
Definition: RexxActivity.cpp:2936
RexxActivity::callNovalueExit
bool callNovalueExit(RexxActivation *, RexxString *, RexxObject *&)
Definition: RexxActivity.cpp:2720
RexxList::makeArray
RexxArray * makeArray()
Definition: ListClass.cpp:872
RXFNCCAL
#define RXFNCCAL
Definition: rexxapidefs.h:172
RexxString::concat
RexxString * concat(RexxString *)
Definition: StringClass.cpp:1172
ActivityManager::activityEnded
static void activityEnded(RexxActivity *)
Definition: ActivityManager.cpp:642
RexxActivation::isForwarded
bool isForwarded()
Definition: RexxActivation.hpp:409
RexxActivity::queryTrcHlt
void queryTrcHlt()
Definition: RexxActivity.cpp:1996
NULLOBJECT
#define NULLOBJECT
Definition: rexx.h:147
RexxActivity::dispatchMessage
RexxMessage * dispatchMessage
Definition: RexxActivity.hpp:347
_CONSTRXSTRING
Definition: rexx.h:161
SourceFile.hpp
RexxObject
Definition: ObjectClass.hpp:311
RexxActivity::getActivationLevel
size_t getActivationLevel()
Definition: RexxActivity.hpp:259
RexxActivity::resolveProgramName
RexxString * resolveProgramName(RexxString *, RexxString *, RexxString *)
Definition: RexxActivity.cpp:3187
InterpreterInstance::getLocalEnvironment
RexxDirectory * getLocalEnvironment()
RexxActivity::currentThread
SysActivity currentThread
Definition: RexxActivity.hpp:371
RexxActivity::threadContextFunctions
static RexxThreadInterface threadContextFunctions
Definition: RexxActivity.hpp:391
StackFrameClass::getTraceLine
RexxString * getTraceLine()
Definition: StackFrameClass.cpp:186
ExitHandler::call
int call(RexxActivity *activity, RexxActivation *activation, int major, int minor, void *parms)
Definition: ExitHandler.cpp:59
RXEXFCAL
#define RXEXFCAL
Definition: rexxapidefs.h:197
ActivationFrame::createStackFrame
virtual StackFrameClass * createStackFrame()=0
_RXFNCCAL_PARM
Definition: rexx.h:465
RexxString
Definition: StringClass.hpp:119
RexxActivity::sayOutput
void sayOutput(RexxActivation *, RexxString *)
Definition: RexxActivity.cpp:2837
RexxObjectPtr
struct _RexxObjectPtr * RexxObjectPtr
Definition: rexx.h:127
_RXFNC_FLAGS::rxffnfnd
unsigned rxffnfnd
Definition: rexx.h:461
_RXVALCALL_PARM::selector
RexxStringObject selector
Definition: rexx.h:622
ExitContext::threadContext
RexxExitContext threadContext
Definition: ActivationApiContexts.hpp:86