00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "setup.h"
00035
00036 #if OBJECT_SYSTEM
00037
00038 #include "classcom.h"
00039 #include "classfun.h"
00040 #include "memalloc.h"
00041 #include "envrnmnt.h"
00042 #include "extnfunc.h"
00043 #include "insfun.h"
00044 #include "msgcom.h"
00045 #include "prccode.h"
00046 #include "router.h"
00047
00048 #define _MSGFUN_SOURCE_
00049 #include "msgfun.h"
00050
00051
00052
00053
00054
00055
00056
00057 #if DEBUGGING_FUNCTIONS
00058 static HANDLER_LINK *DisplayPrimaryCore(void *,char *,HANDLER_LINK *,int);
00059 static void PrintPreviewHandler(void *,char *,HANDLER_LINK *,int,char *);
00060 #endif
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 globle void UnboundHandlerErr(
00079 void *theEnv)
00080 {
00081 EnvPrintRouter(theEnv,WERROR,"message-handler ");
00082 PrintHandler(theEnv,WERROR,MessageHandlerData(theEnv)->CurrentCore->hnd,TRUE);
00083 }
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 globle void PrintNoHandlerError(
00094 void *theEnv,
00095 char *msg)
00096 {
00097 PrintErrorID(theEnv,"MSGFUN",1,FALSE);
00098 EnvPrintRouter(theEnv,WERROR,"No applicable primary message-handlers found for ");
00099 EnvPrintRouter(theEnv,WERROR,msg);
00100 EnvPrintRouter(theEnv,WERROR,".\n");
00101 }
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 globle int CheckHandlerArgCount(
00114 void *theEnv)
00115 {
00116 HANDLER *hnd;
00117
00118 hnd = MessageHandlerData(theEnv)->CurrentCore->hnd;
00119 if ((hnd->maxParams == -1) ? (ProceduralPrimitiveData(theEnv)->ProcParamArraySize < hnd->minParams) :
00120 (ProceduralPrimitiveData(theEnv)->ProcParamArraySize != hnd->minParams))
00121 {
00122 SetEvaluationError(theEnv,TRUE);
00123 PrintErrorID(theEnv,"MSGFUN",2,FALSE);
00124 EnvPrintRouter(theEnv,WERROR,"Message-handler ");
00125 EnvPrintRouter(theEnv,WERROR,ValueToString(hnd->name));
00126 EnvPrintRouter(theEnv,WERROR," ");
00127 EnvPrintRouter(theEnv,WERROR,MessageHandlerData(theEnv)->hndquals[hnd->type]);
00128 EnvPrintRouter(theEnv,WERROR," in class ");
00129 EnvPrintRouter(theEnv,WERROR,EnvGetDefclassName(theEnv,(void *) hnd->cls));
00130 EnvPrintRouter(theEnv,WERROR," expected ");
00131 if (hnd->maxParams == -1)
00132 EnvPrintRouter(theEnv,WERROR,"at least ");
00133 else
00134 EnvPrintRouter(theEnv,WERROR,"exactly ");
00135 PrintLongInteger(theEnv,WERROR,(long long) (hnd->minParams-1));
00136 EnvPrintRouter(theEnv,WERROR," argument(s).\n");
00137 return(FALSE);
00138 }
00139 return(TRUE);
00140 }
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 globle void SlotAccessViolationError(
00157 void *theEnv,
00158 char *slotName,
00159 intBool instanceFlag,
00160 void *theInstanceOrClass)
00161 {
00162 PrintErrorID(theEnv,"MSGFUN",3,FALSE);
00163 EnvPrintRouter(theEnv,WERROR,slotName);
00164 EnvPrintRouter(theEnv,WERROR," slot in ");
00165 if (instanceFlag)
00166 PrintInstanceNameAndClass(theEnv,WERROR,(INSTANCE_TYPE *) theInstanceOrClass,FALSE);
00167 else
00168 {
00169 EnvPrintRouter(theEnv,WERROR,"class ");
00170 PrintClassName(theEnv,WERROR,(DEFCLASS *) theInstanceOrClass,FALSE);
00171 }
00172 EnvPrintRouter(theEnv,WERROR,": write access denied.\n");
00173 }
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186 globle void SlotVisibilityViolationError(
00187 void *theEnv,
00188 SLOT_DESC *sd,
00189 DEFCLASS *theDefclass)
00190 {
00191 PrintErrorID(theEnv,"MSGFUN",6,FALSE);
00192 EnvPrintRouter(theEnv,WERROR,"Private slot ");
00193 EnvPrintRouter(theEnv,WERROR,ValueToString(sd->slotName->name));
00194 EnvPrintRouter(theEnv,WERROR," of class ");
00195 PrintClassName(theEnv,WERROR,sd->cls,FALSE);
00196 EnvPrintRouter(theEnv,WERROR," cannot be accessed directly\n by handlers attached to class ");
00197 PrintClassName(theEnv,WERROR,theDefclass,TRUE);
00198 }
00199
00200 #if ! RUN_TIME
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223 globle void NewSystemHandler(
00224 void *theEnv,
00225 char *cname,
00226 char *mname,
00227 char *fname,
00228 int extraargs)
00229 {
00230 DEFCLASS *cls;
00231 HANDLER *hnd;
00232
00233 cls = LookupDefclassInScope(theEnv,cname);
00234 hnd = InsertHandlerHeader(theEnv,cls,(SYMBOL_HN *) EnvAddSymbol(theEnv,mname),MPRIMARY);
00235 IncrementSymbolCount(hnd->name);
00236 hnd->system = 1;
00237 hnd->minParams = hnd->maxParams = (short) (extraargs + 1);
00238 hnd->localVarCount = 0;
00239 hnd->actions = get_struct(theEnv,expr);
00240 hnd->actions->argList = NULL;
00241 hnd->actions->type = FCALL;
00242 hnd->actions->value = (void *) FindFunction(theEnv,fname);
00243 hnd->actions->nextArg = NULL;
00244 }
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260 globle HANDLER *InsertHandlerHeader(
00261 void *theEnv,
00262 DEFCLASS *cls,
00263 SYMBOL_HN *mname,
00264 int mtype)
00265 {
00266 HANDLER *nhnd,*hnd;
00267 unsigned *narr,*arr;
00268 long i;
00269 long j,ni = -1;
00270
00271 hnd = cls->handlers;
00272 arr = cls->handlerOrderMap;
00273 nhnd = (HANDLER *) gm2(theEnv,(sizeof(HANDLER) * (cls->handlerCount+1)));
00274 narr = (unsigned *) gm2(theEnv,(sizeof(unsigned) * (cls->handlerCount+1)));
00275 GenCopyMemory(HANDLER,cls->handlerCount,nhnd,hnd);
00276 for (i = 0 , j = 0 ; i < cls->handlerCount ; i++ , j++)
00277 {
00278 if (ni == -1)
00279 {
00280 if ((hnd[arr[i]].name->bucket > mname->bucket) ? TRUE :
00281 (hnd[arr[i]].name == mname))
00282 {
00283 ni = i;
00284 j++;
00285 }
00286 }
00287 narr[j] = arr[i];
00288 }
00289 if (ni == -1)
00290 ni = (int) cls->handlerCount;
00291 narr[ni] = cls->handlerCount;
00292 nhnd[cls->handlerCount].system = 0;
00293 nhnd[cls->handlerCount].type = mtype;
00294 nhnd[cls->handlerCount].busy = 0;
00295 nhnd[cls->handlerCount].mark = 0;
00296 #if DEBUGGING_FUNCTIONS
00297 nhnd[cls->handlerCount].trace = MessageHandlerData(theEnv)->WatchHandlers;
00298 #endif
00299 nhnd[cls->handlerCount].name = mname;
00300 nhnd[cls->handlerCount].cls = cls;
00301 nhnd[cls->handlerCount].minParams = 0;
00302 nhnd[cls->handlerCount].maxParams = 0;
00303 nhnd[cls->handlerCount].localVarCount = 0;
00304 nhnd[cls->handlerCount].actions = NULL;
00305 nhnd[cls->handlerCount].ppForm = NULL;
00306 nhnd[cls->handlerCount].usrData = NULL;
00307 if (cls->handlerCount != 0)
00308 {
00309 rm(theEnv,(void *) hnd,(sizeof(HANDLER) * cls->handlerCount));
00310 rm(theEnv,(void *) arr,(sizeof(unsigned) * cls->handlerCount));
00311 }
00312 cls->handlers = nhnd;
00313 cls->handlerOrderMap = narr;
00314 cls->handlerCount++;
00315 return(&nhnd[cls->handlerCount-1]);
00316 }
00317
00318 #endif
00319
00320 #if (! BLOAD_ONLY) && (! RUN_TIME)
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332 globle int HandlersExecuting(
00333 DEFCLASS *cls)
00334 {
00335 long i;
00336
00337 for (i = 0 ; i < cls->handlerCount ; i++)
00338 if (cls->handlers[i].busy > 0)
00339 return(TRUE);
00340 return(FALSE);
00341 }
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 globle int DeleteHandler(
00364 void *theEnv,
00365 DEFCLASS *cls,
00366 SYMBOL_HN *mname,
00367 int mtype,
00368 int indicate_missing)
00369 {
00370 long i;
00371 HANDLER *hnd;
00372 int found,success = 1;
00373
00374 if (cls->handlerCount == 0)
00375 {
00376 if (indicate_missing)
00377 {
00378 HandlerDeleteError(theEnv,EnvGetDefclassName(theEnv,(void *) cls));
00379 return(0);
00380 }
00381 return(1);
00382 }
00383 if (HandlersExecuting(cls))
00384 {
00385 HandlerDeleteError(theEnv,EnvGetDefclassName(theEnv,(void *) cls));
00386 return(0);
00387 }
00388 if (mtype == -1)
00389 {
00390 found = FALSE;
00391 for (i = MAROUND ; i <= MAFTER ; i++)
00392 {
00393 hnd = FindHandlerByAddress(cls,mname,(unsigned) i);
00394 if (hnd != NULL)
00395 {
00396 found = TRUE;
00397 if (hnd->system == 0)
00398 hnd->mark = 1;
00399 else
00400 {
00401 PrintErrorID(theEnv,"MSGPSR",3,FALSE);
00402 EnvPrintRouter(theEnv,WERROR,"System message-handlers may not be modified.\n");
00403 success = 0;
00404 }
00405 }
00406 }
00407 if ((found == FALSE) ? (strcmp(ValueToString(mname),"*") == 0) : FALSE)
00408 {
00409 for (i = 0 ; i < cls->handlerCount ; i++)
00410 if (cls->handlers[i].system == 0)
00411 cls->handlers[i].mark = 1;
00412 }
00413 }
00414 else
00415 {
00416 hnd = FindHandlerByAddress(cls,mname,(unsigned) mtype);
00417 if (hnd == NULL)
00418 {
00419 if (strcmp(ValueToString(mname),"*") == 0)
00420 {
00421 for (i = 0 ; i < cls->handlerCount ; i++)
00422 if ((cls->handlers[i].type == (unsigned) mtype) &&
00423 (cls->handlers[i].system == 0))
00424 cls->handlers[i].mark = 1;
00425 }
00426 else
00427 {
00428 if (indicate_missing)
00429 HandlerDeleteError(theEnv,EnvGetDefclassName(theEnv,(void *) cls));
00430 success = 0;
00431 }
00432 }
00433 else if (hnd->system == 0)
00434 hnd->mark = 1;
00435 else
00436 {
00437 if (indicate_missing)
00438 {
00439 PrintErrorID(theEnv,"MSGPSR",3,FALSE);
00440 EnvPrintRouter(theEnv,WERROR,"System message-handlers may not be modified.\n");
00441 }
00442 success = 0;
00443 }
00444 }
00445 DeallocateMarkedHandlers(theEnv,cls);
00446 return(success);
00447 }
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461 globle void DeallocateMarkedHandlers(
00462 void *theEnv,
00463 DEFCLASS *cls)
00464 {
00465 short count;
00466 HANDLER *hnd,*nhnd;
00467 unsigned *arr,*narr;
00468 long i,j;
00469
00470 for (i = 0 , count = 0 ; i < cls->handlerCount ; i++)
00471 {
00472 hnd = &cls->handlers[i];
00473 if (hnd->mark == 1)
00474 {
00475 count++;
00476 DecrementSymbolCount(theEnv,hnd->name);
00477 ExpressionDeinstall(theEnv,hnd->actions);
00478 ReturnPackedExpression(theEnv,hnd->actions);
00479 ClearUserDataList(theEnv,hnd->usrData);
00480 if (hnd->ppForm != NULL)
00481 rm(theEnv,(void *) hnd->ppForm,
00482 (sizeof(char) * (strlen(hnd->ppForm)+1)));
00483 }
00484 else
00485
00486
00487
00488
00489 hnd->busy = count;
00490 }
00491 if (count == 0)
00492 return;
00493 if (count == cls->handlerCount)
00494 {
00495 rm(theEnv,(void *) cls->handlers,(sizeof(HANDLER) * cls->handlerCount));
00496 rm(theEnv,(void *) cls->handlerOrderMap,(sizeof(unsigned) * cls->handlerCount));
00497 cls->handlers = NULL;
00498 cls->handlerOrderMap = NULL;
00499 cls->handlerCount = 0;
00500 }
00501 else
00502 {
00503 count = (short) (cls->handlerCount - count);
00504 hnd = cls->handlers;
00505 arr = cls->handlerOrderMap;
00506 nhnd = (HANDLER *) gm2(theEnv,(sizeof(HANDLER) * count));
00507 narr = (unsigned *) gm2(theEnv,(sizeof(unsigned) * count));
00508 for (i = 0 , j = 0 ; j < count ; i++)
00509 {
00510 if (hnd[arr[i]].mark == 0)
00511 {
00512
00513
00514
00515
00516
00517 narr[j] = arr[i] - hnd[arr[i]].busy;
00518 j++;
00519 }
00520 }
00521 for (i = 0 , j = 0 ; j < count ; i++)
00522 {
00523 if (hnd[i].mark == 0)
00524 {
00525 hnd[i].busy = 0;
00526 GenCopyMemory(HANDLER,1,&nhnd[j],&hnd[i]);
00527 j++;
00528 }
00529 }
00530 rm(theEnv,(void *) hnd,(sizeof(HANDLER) * cls->handlerCount));
00531 rm(theEnv,(void *) arr,(sizeof(unsigned) * cls->handlerCount));
00532 cls->handlers = nhnd;
00533 cls->handlerOrderMap = narr;
00534 cls->handlerCount = count;
00535 }
00536 }
00537
00538 #endif
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553 globle unsigned HandlerType(
00554 void *theEnv,
00555 char *func,
00556 char *str)
00557 {
00558 register unsigned i;
00559
00560 for (i = MAROUND ; i <= MAFTER ; i++)
00561 if (strcmp(str,MessageHandlerData(theEnv)->hndquals[i]) == 0)
00562 {
00563 return(i);
00564 }
00565
00566 PrintErrorID(theEnv,"MSGFUN",7,FALSE);
00567 EnvPrintRouter(theEnv,"werror","Unrecognized message-handler type in ");
00568 EnvPrintRouter(theEnv,"werror",func);
00569 EnvPrintRouter(theEnv,"werror",".\n");
00570 return(MERROR);
00571 }
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585 globle int CheckCurrentMessage(
00586 void *theEnv,
00587 char *func,
00588 int ins_reqd)
00589 {
00590 register DATA_OBJECT *activeMsgArg;
00591
00592 if (!MessageHandlerData(theEnv)->CurrentCore || (MessageHandlerData(theEnv)->CurrentCore->hnd->actions != ProceduralPrimitiveData(theEnv)->CurrentProcActions))
00593 {
00594 PrintErrorID(theEnv,"MSGFUN",4,FALSE);
00595 EnvPrintRouter(theEnv,WERROR,func);
00596 EnvPrintRouter(theEnv,WERROR," may only be called from within message-handlers.\n");
00597 SetEvaluationError(theEnv,TRUE);
00598 return(FALSE);
00599 }
00600 activeMsgArg = GetNthMessageArgument(theEnv,0);
00601 if ((ins_reqd == TRUE) ? (activeMsgArg->type != INSTANCE_ADDRESS) : FALSE)
00602 {
00603 PrintErrorID(theEnv,"MSGFUN",5,FALSE);
00604 EnvPrintRouter(theEnv,WERROR,func);
00605 EnvPrintRouter(theEnv,WERROR," operates only on instances.\n");
00606 SetEvaluationError(theEnv,TRUE);
00607 return(FALSE);
00608 }
00609 if ((activeMsgArg->type == INSTANCE_ADDRESS) ?
00610 (((INSTANCE_TYPE *) activeMsgArg->value)->garbage == 1) : FALSE)
00611 {
00612 StaleInstanceAddress(theEnv,func,0);
00613 SetEvaluationError(theEnv,TRUE);
00614 return(FALSE);
00615 }
00616 return(TRUE);
00617 }
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630 globle void PrintHandler(
00631 void *theEnv,
00632 char *logName,
00633 HANDLER *theHandler,
00634 int crtn)
00635 {
00636 EnvPrintRouter(theEnv,logName,ValueToString(theHandler->name));
00637 EnvPrintRouter(theEnv,logName," ");
00638 EnvPrintRouter(theEnv,logName,MessageHandlerData(theEnv)->hndquals[theHandler->type]);
00639 EnvPrintRouter(theEnv,logName," in class ");
00640 PrintClassName(theEnv,logName,theHandler->cls,crtn);
00641 }
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657 globle HANDLER *FindHandlerByAddress(
00658 DEFCLASS *cls,
00659 SYMBOL_HN *name,
00660 unsigned type)
00661 {
00662 register int b;
00663 long i;
00664 HANDLER *hnd;
00665 unsigned *arr;
00666
00667 if ((b = FindHandlerNameGroup(cls,name)) == -1)
00668 return(NULL);
00669 arr = cls->handlerOrderMap;
00670 hnd = cls->handlers;
00671 for (i = (unsigned) b ; i < cls->handlerCount ; i++)
00672 {
00673 if (hnd[arr[i]].name != name)
00674 return(NULL);
00675 if (hnd[arr[i]].type == type)
00676 return(&hnd[arr[i]]);
00677 }
00678 return(NULL);
00679 }
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695 globle int FindHandlerByIndex(
00696 DEFCLASS *cls,
00697 SYMBOL_HN *name,
00698 unsigned type)
00699 {
00700 register int b;
00701 long i;
00702 HANDLER *hnd;
00703 unsigned *arr;
00704
00705 if ((b = FindHandlerNameGroup(cls,name)) == -1)
00706 return(-1);
00707 arr = cls->handlerOrderMap;
00708 hnd = cls->handlers;
00709 for (i = (unsigned) b ; i < cls->handlerCount ; i++)
00710 {
00711 if (hnd[arr[i]].name != name)
00712 return(-1);
00713 if (hnd[arr[i]].type == type)
00714 return((int) arr[i]);
00715 }
00716 return(-1);
00717 }
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731 globle int FindHandlerNameGroup(
00732 DEFCLASS *cls,
00733 SYMBOL_HN *name)
00734 {
00735 register int b,e,i,j;
00736 HANDLER *hnd;
00737 unsigned *arr;
00738 int start;
00739
00740 if (cls->handlerCount == 0)
00741 return(-1);
00742 hnd = cls->handlers;
00743 arr = cls->handlerOrderMap;
00744 b = 0;
00745 e = (int) (cls->handlerCount-1);
00746 start = -1;
00747 do
00748 {
00749 i = (b+e)/2;
00750 if (name->bucket == hnd[arr[i]].name->bucket)
00751 {
00752 for (j = i ; j >= b ; j--)
00753 {
00754 if (hnd[arr[j]].name == name)
00755 start = j;
00756 if (hnd[arr[j]].name->bucket != name->bucket)
00757 break;
00758 }
00759 if (start != -1)
00760 return(start);
00761 for (j = i+1 ; j <= e ; j++)
00762 {
00763 if (hnd[arr[j]].name == name)
00764 return(j);
00765 if (hnd[arr[j]].name->bucket != name->bucket)
00766 return(-1);
00767 }
00768 return(-1);
00769 }
00770 else if (name->bucket < hnd[arr[i]].name->bucket)
00771 e = i-1;
00772 else
00773 b = i+1;
00774 }
00775 while (b <= e);
00776 return(-1);
00777 }
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788 globle void HandlerDeleteError(
00789 void *theEnv,
00790 char *cname)
00791 {
00792 PrintErrorID(theEnv,"MSGFUN",8,FALSE);
00793 EnvPrintRouter(theEnv,WERROR,"Unable to delete message-handler(s) from class ");
00794 EnvPrintRouter(theEnv,WERROR,cname);
00795 EnvPrintRouter(theEnv,WERROR,".\n");
00796 }
00797
00798 #if DEBUGGING_FUNCTIONS
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819 globle void DisplayCore(
00820 void *theEnv,
00821 char *logicalName,
00822 HANDLER_LINK *core,
00823 int sdepth)
00824 {
00825 if (core->hnd->type == MAROUND)
00826 {
00827 PrintPreviewHandler(theEnv,logicalName,core,sdepth,BEGIN_TRACE);
00828 if (core->nxt != NULL)
00829 DisplayCore(theEnv,logicalName,core->nxt,sdepth+1);
00830 PrintPreviewHandler(theEnv,logicalName,core,sdepth,END_TRACE);
00831 }
00832 else
00833 {
00834 while ((core != NULL) ? (core->hnd->type == MBEFORE) : FALSE)
00835 {
00836 PrintPreviewHandler(theEnv,logicalName,core,sdepth,BEGIN_TRACE);
00837 PrintPreviewHandler(theEnv,logicalName,core,sdepth,END_TRACE);
00838 core = core->nxt;
00839 }
00840 if ((core != NULL) ? (core->hnd->type == MPRIMARY) : FALSE)
00841
00842 core = DisplayPrimaryCore(theEnv,logicalName,core,sdepth);
00843
00844 while ((core != NULL) ? (core->hnd->type == MAFTER) : FALSE)
00845 {
00846 PrintPreviewHandler(theEnv,logicalName,core,sdepth,BEGIN_TRACE);
00847 PrintPreviewHandler(theEnv,logicalName,core,sdepth,END_TRACE);
00848 core = core->nxt;
00849 }
00850
00851 }
00852 }
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865 globle HANDLER_LINK *FindPreviewApplicableHandlers(
00866 void *theEnv,
00867 DEFCLASS *cls,
00868 SYMBOL_HN *mname)
00869 {
00870 register int i;
00871 HANDLER_LINK *tops[4],*bots[4];
00872
00873 for (i = MAROUND ; i <= MAFTER ; i++)
00874 tops[i] = bots[i] = NULL;
00875
00876 for (i = 0 ; i < cls->allSuperclasses.classCount ; i++)
00877 FindApplicableOfName(theEnv,cls->allSuperclasses.classArray[i],tops,bots,mname);
00878 return(JoinHandlerLinks(theEnv,tops,bots,mname));
00879 }
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892 globle void WatchMessage(
00893 void *theEnv,
00894 char *logName,
00895 char *tstring)
00896 {
00897 EnvPrintRouter(theEnv,logName,"MSG ");
00898 EnvPrintRouter(theEnv,logName,tstring);
00899 EnvPrintRouter(theEnv,logName," ");
00900 EnvPrintRouter(theEnv,logName,ValueToString(MessageHandlerData(theEnv)->CurrentMessageName));
00901 EnvPrintRouter(theEnv,logName," ED:");
00902 PrintLongInteger(theEnv,logName,(long long) EvaluationData(theEnv)->CurrentEvaluationDepth);
00903 PrintProcParamArray(theEnv,logName);
00904 }
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918 globle void WatchHandler(
00919 void *theEnv,
00920 char *logName,
00921 HANDLER_LINK *hndl,
00922 char *tstring)
00923 {
00924 HANDLER *hnd;
00925
00926 EnvPrintRouter(theEnv,logName,"HND ");
00927 EnvPrintRouter(theEnv,logName,tstring);
00928 EnvPrintRouter(theEnv,logName," ");
00929 hnd = hndl->hnd;
00930 PrintHandler(theEnv,WTRACE,hnd,TRUE);
00931 EnvPrintRouter(theEnv,logName," ED:");
00932 PrintLongInteger(theEnv,logName,(long long) EvaluationData(theEnv)->CurrentEvaluationDepth);
00933 PrintProcParamArray(theEnv,logName);
00934 }
00935
00936 #endif
00937
00938
00939
00940
00941
00942
00943
00944 #if DEBUGGING_FUNCTIONS
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965 static HANDLER_LINK *DisplayPrimaryCore(
00966 void *theEnv,
00967 char *logicalName,
00968 HANDLER_LINK *core,
00969 int pdepth)
00970 {
00971 register HANDLER_LINK *rtn;
00972
00973 PrintPreviewHandler(theEnv,logicalName,core,pdepth,BEGIN_TRACE);
00974 if ((core->nxt != NULL) ? (core->nxt->hnd->type == MPRIMARY) : FALSE)
00975 rtn = DisplayPrimaryCore(theEnv,logicalName,core->nxt,pdepth+1);
00976 else
00977 rtn = core->nxt;
00978 PrintPreviewHandler(theEnv,logicalName,core,pdepth,END_TRACE);
00979 return(rtn);
00980 }
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993 static void PrintPreviewHandler(
00994 void *theEnv,
00995 char *logicalName,
00996 HANDLER_LINK *cptr,
00997 int sdepth,
00998 char *tstr)
00999 {
01000 register int i;
01001
01002 for (i = 0 ; i < sdepth ; i++)
01003 EnvPrintRouter(theEnv,logicalName,"| ");
01004 EnvPrintRouter(theEnv,logicalName,tstr);
01005 EnvPrintRouter(theEnv,logicalName," ");
01006 PrintHandler(theEnv,logicalName,cptr->hnd,TRUE);
01007 }
01008
01009 #endif
01010
01011 #endif
01012