📄 rulebsc.c
字号:
/******************************************//* UndefruleCommand: H/L access routine *//* for the undefrule command. *//******************************************/globle void UndefruleCommand( void *theEnv) { UndefconstructCommand(theEnv,"undefrule",DefruleData(theEnv)->DefruleConstruct); }/**********************************//* EnvUndefrule: C access routine *//* for the undefrule command. *//**********************************/globle intBool EnvUndefrule( void *theEnv, void *theDefrule) { return(Undefconstruct(theEnv,theDefrule,DefruleData(theEnv)->DefruleConstruct)); }/************************************************//* GetDefruleListFunction: H/L access routine *//* for the get-defrule-list function. *//************************************************/globle void GetDefruleListFunction( void *theEnv, DATA_OBJECT_PTR returnValue) { GetConstructListFunction(theEnv,"get-defrule-list",returnValue,DefruleData(theEnv)->DefruleConstruct); }/****************************************//* EnvGetDefruleList: C access routine *//* for the get-defrule-list function. *//****************************************/globle void EnvGetDefruleList( void *theEnv, DATA_OBJECT_PTR returnValue, void *theModule) { GetConstructList(theEnv,returnValue,DefruleData(theEnv)->DefruleConstruct,(struct defmodule *) theModule); }/*********************************************//* DefruleModuleFunction: H/L access routine *//* for the defrule-module function. *//*********************************************/globle void *DefruleModuleFunction( void *theEnv) { return(GetConstructModuleCommand(theEnv,"defrule-module",DefruleData(theEnv)->DefruleConstruct)); }#if DEBUGGING_FUNCTIONS/******************************************//* PPDefruleCommand: H/L access routine *//* for the ppdefrule command. *//******************************************/globle void PPDefruleCommand( void *theEnv) { PPConstructCommand(theEnv,"ppdefrule",DefruleData(theEnv)->DefruleConstruct); }/***********************************//* PPDefrule: C access routine for *//* the ppdefrule command. *//***********************************/globle int PPDefrule( void *theEnv, char *defruleName, char *logicalName) { return(PPConstruct(theEnv,defruleName,logicalName,DefruleData(theEnv)->DefruleConstruct)); }/*********************************************//* ListDefrulesCommand: H/L access routine *//* for the list-defrules command. *//*********************************************/globle void ListDefrulesCommand( void *theEnv) { ListConstructCommand(theEnv,"list-defrules",DefruleData(theEnv)->DefruleConstruct); }/*************************************//* EnvListDefrules: C access routine *//* for the list-defrules command. *//*************************************/globle void EnvListDefrules( void *theEnv, char *logicalName, void *theModule) { ListConstruct(theEnv,DefruleData(theEnv)->DefruleConstruct,logicalName,(struct defmodule *) theModule); }/*******************************************************//* EnvGetDefruleWatchActivations: C access routine for *//* retrieving the current watch value of a defrule's *//* activations. *//*******************************************************/#if IBM_TBC#pragma argsused#endifgloble unsigned EnvGetDefruleWatchActivations( void *theEnv, void *rulePtr) { struct defrule *thePtr;#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#endif for (thePtr = (struct defrule *) rulePtr; thePtr != NULL; thePtr = thePtr->disjunct) { if (thePtr->watchActivation) return(TRUE); } return(FALSE); }/***********************************************//* EnvGetDefruleWatchFirings: C access routine *//* for retrieving the current watch value of *//* a defrule's firings. *//***********************************************/#if IBM_TBC#pragma argsused#endifgloble unsigned EnvGetDefruleWatchFirings( void *theEnv, void *rulePtr) { struct defrule *thePtr;#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#endif for (thePtr = (struct defrule *) rulePtr; thePtr != NULL; thePtr = thePtr->disjunct) { if (thePtr->watchFiring) return(TRUE); } return(FALSE); }/***************************************************//* EnvSetDefruleWatchActivations: C access routine *//* for setting the current watch value of a *//* defrule's activations. *//***************************************************/#if IBM_TBC#pragma argsused#endifgloble void EnvSetDefruleWatchActivations( void *theEnv, unsigned newState, void *rulePtr) { struct defrule *thePtr;#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#endif for (thePtr = (struct defrule *) rulePtr; thePtr != NULL; thePtr = thePtr->disjunct) { thePtr->watchActivation = newState; } }/****************************************************//* EnvSetDefruleWatchFirings: C access routine for *//* setting the current watch value of a defrule's */ /* firings. *//****************************************************/#if IBM_TBC#pragma argsused#endifgloble void EnvSetDefruleWatchFirings( void *theEnv, unsigned newState, void *rulePtr) { struct defrule *thePtr;#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#endif for (thePtr = (struct defrule *) rulePtr; thePtr != NULL; thePtr = thePtr->disjunct) { thePtr->watchFiring = newState; } }/*******************************************************************//* DefruleWatchAccess: Access function for setting the watch flags *//* associated with rules (activations and rule firings). *//*******************************************************************/globle unsigned DefruleWatchAccess( void *theEnv, int code, unsigned newState, struct expr *argExprs) { if (code) return(ConstructSetWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,newState,argExprs, EnvGetDefruleWatchActivations,EnvSetDefruleWatchActivations)); else return(ConstructSetWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,newState,argExprs, EnvGetDefruleWatchFirings,EnvSetDefruleWatchFirings)); }/*****************************************************************//* DefruleWatchPrint: Access routine for printing which defrules *//* have their watch flag set via the list-watch-items command. *//*****************************************************************/globle unsigned DefruleWatchPrint( void *theEnv, char *logName, int code, struct expr *argExprs) { if (code) return(ConstructPrintWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,logName,argExprs, EnvGetDefruleWatchActivations,EnvSetDefruleWatchActivations)); else return(ConstructPrintWatchAccess(theEnv,DefruleData(theEnv)->DefruleConstruct,logName,argExprs, EnvGetDefruleWatchActivations,EnvSetDefruleWatchActivations)); }#endif /* DEBUGGING_FUNCTIONS */#endif /* DEFTEMPLATE_CONSTRUCT */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -