/******************************************************************** NAME : DisplayCore DESCRIPTION : Gives a schematic "printout" of the core framework for a message showing arounds, primaries, shadows etc. This routine uses recursion to print indentation to indicate shadowing and where handlers begin and end execution wrt one another. INPUTS : 1) Logical name of output 2) The remaining core 3) The number of handlers this (partial) core shadows RETURNS : Nothing useful SIDE EFFECTS : None NOTES : Expects that the core was created in PREVIEW mode, i.e. implicit handlers are SLOT_DESC addresses (in PERFORM mode they are INSTANCE_SLOT addresses) Assumes (partial) core is not empty ********************************************************************/ globle void DisplayCore( void *theEnv, EXEC_STATUS, char *logicalName, HANDLER_LINK *core, int sdepth) { if (core->hnd->type == MAROUND) { PrintPreviewHandler(theEnv,execStatus,logicalName,core,sdepth,BEGIN_TRACE); if (core->nxt != NULL) DisplayCore(theEnv,execStatus,logicalName,core->nxt,sdepth+1); PrintPreviewHandler(theEnv,execStatus,logicalName,core,sdepth,END_TRACE); } else { while ((core != NULL) ? (core->hnd->type == MBEFORE) : FALSE) { PrintPreviewHandler(theEnv,execStatus,logicalName,core,sdepth,BEGIN_TRACE); PrintPreviewHandler(theEnv,execStatus,logicalName,core,sdepth,END_TRACE); core = core->nxt; } if ((core != NULL) ? (core->hnd->type == MPRIMARY) : FALSE) core = DisplayPrimaryCore(theEnv,execStatus,logicalName,core,sdepth); while ((core != NULL) ? (core->hnd->type == MAFTER) : FALSE) { PrintPreviewHandler(theEnv,execStatus,logicalName,core,sdepth,BEGIN_TRACE); PrintPreviewHandler(theEnv,execStatus,logicalName,core,sdepth,END_TRACE); core = core->nxt; } } }
/******************************************************************** NAME : PreviewSend DESCRIPTION : Displays a list of the core for a message describing shadows,etc. INPUTS : 1) Logical name of output 2) Class pointer 3) Message name-string RETURNS : Nothing useful SIDE EFFECTS : Temporary core created and destroyed NOTES : None ********************************************************************/ globle void PreviewSend( char *logicalName, void *clsptr, char *msgname) { HANDLER_LINK *core; SYMBOL_HN *msym; msym = FindSymbol(msgname); if (msym == NULL) return; core = FindPreviewApplicableHandlers((DEFCLASS *) clsptr,msym); if (core != NULL) { DisplayCore(logicalName,core,0); DestroyHandlerLinks(core); } }