/*************************************************** NAME : PrintHandlerWatchFlag DESCRIPTION : Displays trace value for handler INPUTS : 1) The logical name of the output 2) The class 3) The handler index RETURNS : Nothing useful SIDE EFFECTS : None NOTES : None ***************************************************/ static void PrintHandlerWatchFlag( char *log, void *theClass, unsigned theHandler) { PrintRouter(log,GetDefclassName(theClass)); PrintRouter(log," "); PrintRouter(log,GetDefmessageHandlerName(theClass,theHandler)); PrintRouter(log," "); PrintRouter(log,GetDefmessageHandlerType(theClass,theHandler)); PrintRouter(log,GetDefmessageHandlerWatch(theClass,theHandler) ? " = on\n" : " = off\n"); }
/****************************************************************** NAME : PrintMethod DESCRIPTION : Lists a brief description of methods for a method INPUTS : 1) Buffer for method info 2) Size of buffer (not including space for '\0') 3) The method address RETURNS : Nothing useful SIDE EFFECTS : None NOTES : A terminating newline is NOT included ******************************************************************/ globle void PrintMethod( char *buf, int buflen, DEFMETHOD *meth) { register int j,k; register RESTRICTION *rptr; char numbuf[15]; buf[0] = '\0'; if (meth->system) strncpy(buf,"SYS",(STD_SIZE) buflen); sprintf(numbuf,"%-2d ",meth->index); strncat(buf,numbuf,(STD_SIZE) buflen-3); for (j = 0 ; j < meth->restrictionCount ; j++) { rptr = &meth->restrictions[j]; if ((j == meth->restrictionCount-1) && (meth->maxRestrictions == -1)) { if ((rptr->tcnt == 0) && (rptr->query == NULL)) { strncat(buf,"$?",buflen-strlen(buf)); break; } strncat(buf,"($? ",buflen-strlen(buf)); } else strncat(buf,"(",buflen-strlen(buf)); for (k = 0 ; k < rptr->tcnt ; k++) { #if OBJECT_SYSTEM strncat(buf,GetDefclassName(rptr->types[k]),buflen-strlen(buf)); #else strncat(buf,TypeName(ValueToInteger(rptr->types[k])),buflen-strlen(buf)); #endif if (k < (rptr->tcnt - 1)) strncat(buf," ",buflen-strlen(buf)); } if (rptr->query != NULL) { if (rptr->tcnt != 0) strncat(buf," ",buflen-strlen(buf)); strncat(buf,"<qry>",buflen-strlen(buf)); } strncat(buf,")",buflen-strlen(buf)); if (j != (meth->restrictionCount-1)) strncat(buf," ",buflen-strlen(buf)); } }
/*********************************************************** NAME : UndefmessageHandler DESCRIPTION : Deletes a handler from a class INPUTS : 1) Class address (Can be NULL) 2) Handler index (can be 0) RETURNS : 1 if successful, 0 otherwise SIDE EFFECTS : Handler deleted if possible NOTES : None ***********************************************************/ globle int UndefmessageHandler( void *vptr, unsigned mhi) { #if (MAC_MPW || MAC_MCW) && (RUN_TIME || BLOAD_ONLY) #pragma unused(vptr) #pragma unused(mhi) #endif #if RUN_TIME || BLOAD_ONLY PrintErrorID("MSGCOM",3,FALSE); PrintRouter(WERROR,"Unable to delete message-handlers.\n"); return(0); #else DEFCLASS *cls; #if BLOAD || BLOAD_AND_BSAVE if (Bloaded()) { PrintErrorID("MSGCOM",3,FALSE); PrintRouter(WERROR,"Unable to delete message-handlers.\n"); return(0); } #endif if (vptr == NULL) { if (mhi != 0) { PrintErrorID("MSGCOM",1,FALSE); PrintRouter(WERROR,"Incomplete message-handler specification for deletion.\n"); return(0); } return(WildDeleteHandler(NULL,NULL,NULL)); } if (mhi == 0) return(WildDeleteHandler((DEFCLASS *) vptr,NULL,NULL)); cls = (DEFCLASS *) vptr; if (HandlersExecuting(cls)) { HandlerDeleteError(GetDefclassName((void *) cls)); return(0); } cls->handlers[mhi-1].mark = 1; DeallocateMarkedHandlers(cls); return(1); #endif }
/********************************************************** NAME : PrintOPNLevel DESCRIPTION : Recursivley prints object pattern network INPUTS : 1) The current object pattern network node 2) A buffer holding preceding indentation text showing the level in the tree 3) The length of the indentation text RETURNS : Nothing useful SIDE EFFECTS : Pattern nodes recursively printed NOTES : None **********************************************************/ static void PrintOPNLevel( OBJECT_PATTERN_NODE *pptr, char *indentbuf, int ilen) { CLASS_BITMAP *cbmp; SLOT_BITMAP *sbmp; register unsigned i; OBJECT_PATTERN_NODE *uptr; OBJECT_ALPHA_NODE *alphaPtr; while (pptr != NULL) { PrintRouter(WDISPLAY,indentbuf); if (pptr->alphaNode != NULL) PrintRouter(WDISPLAY,"+"); PrintRouter(WDISPLAY,ValueToString(FindIDSlotName(pptr->slotNameID))); PrintRouter(WDISPLAY," ("); PrintLongInteger(WDISPLAY,(long) pptr->slotNameID); PrintRouter(WDISPLAY,") "); PrintRouter(WDISPLAY,pptr->endSlot ? "EPF#" : "PF#"); PrintLongInteger(WDISPLAY,(long) pptr->whichField); PrintRouter(WDISPLAY," "); PrintRouter(WDISPLAY,pptr->multifieldNode ? "$? " : "? "); if (pptr->networkTest != NULL) PrintExpression(WDISPLAY,pptr->networkTest); PrintRouter(WDISPLAY,"\n"); alphaPtr = pptr->alphaNode; while (alphaPtr != NULL) { PrintRouter(WDISPLAY,indentbuf); PrintRouter(WDISPLAY," Classes:"); cbmp = (CLASS_BITMAP *) ValueToBitMap(alphaPtr->classbmp); for (i = 0 ; i <= cbmp->maxid ; i++) if (TestBitMap(cbmp->map,i)) { PrintRouter(WDISPLAY," "); PrintRouter(WDISPLAY,GetDefclassName((void *) ClassIDMap[i])); } if (alphaPtr->slotbmp != NULL) { sbmp = (SLOT_BITMAP *) ValueToBitMap(pptr->alphaNode->slotbmp); PrintRouter(WDISPLAY," *** Slots:"); for (i = NAME_ID ; i <= sbmp->maxid ; i++) if (TestBitMap(sbmp->map,i)) { for (uptr = pptr ; uptr != NULL ; uptr = uptr->lastLevel) if (uptr->slotNameID == i) break; if (uptr == NULL) { PrintRouter(WDISPLAY," "); PrintRouter(WDISPLAY,ValueToString(FindIDSlotName(i))); } } } PrintRouter(WDISPLAY,"\n"); alphaPtr = alphaPtr->nxtInGroup; } indentbuf[ilen++] = (char) (pptr->rightNode != NULL) ? '|' : ' '; indentbuf[ilen++] = ' '; indentbuf[ilen++] = ' '; indentbuf[ilen] = '\0'; PrintOPNLevel(pptr->nextLevel,indentbuf,ilen); ilen -= 3; indentbuf[ilen] = '\0'; pptr = pptr->rightNode; } }