?? objrtfnx.c
字號:
{ theVar.type = theSegment->theFields[theSegment->multifieldLength - (hack->offset + 1)].type; theVar.value = theSegment->theFields[theSegment->multifieldLength - (hack->offset + 1)].value; } } else { theVar.type = (unsigned short) ObjectReteData(theEnv)->CurrentPatternObjectSlot->type; theVar.value = ObjectReteData(theEnv)->CurrentPatternObjectSlot->value; } } if (theVar.type != constantExp->type) rv = hack->fail; else if (theVar.value != constantExp->value) rv = hack->fail; else rv = hack->pass; theResult->type = SYMBOL; theResult->value = rv ? EnvTrueSymbol(theEnv) : EnvFalseSymbol(theEnv); return(rv); }/* ========================================= ***************************************** INTERNALLY VISIBLE FUNCTIONS ========================================= ***************************************** */#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintObjectGetVarJN1( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectMatchVar1 *hack; hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue); if (hack->objectAddress) { EnvPrintRouter(theEnv,logicalName,"(obj-ptr "); PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern); } else if (hack->allFields) { EnvPrintRouter(theEnv,logicalName,"(obj-slot-contents "); PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern); EnvPrintRouter(theEnv,logicalName," "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot))); } else { EnvPrintRouter(theEnv,logicalName,"(obj-slot-var "); PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern); EnvPrintRouter(theEnv,logicalName," "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot))); EnvPrintRouter(theEnv,logicalName," "); PrintLongInteger(theEnv,logicalName,(long long) hack->whichField); } EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif }static intBool ObjectGetVarJNFunction1( void *theEnv, void *theValue, DATA_OBJECT *theResult) { struct ObjectMatchVar1 *hack; INSTANCE_TYPE *theInstance; struct multifieldMarker *theMarks; hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue); GetPatternObjectAndMarks(theEnv,((int) hack->whichPattern),hack->lhs,hack->rhs,&theInstance,&theMarks); GetObjectValueGeneral(theEnv,theResult,theInstance,theMarks,hack); return(TRUE); }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintObjectGetVarJN2( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectMatchVar2 *hack; hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue); EnvPrintRouter(theEnv,logicalName,"(obj-slot-quick-var "); PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern); EnvPrintRouter(theEnv,logicalName," "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot))); if (hack->fromBeginning) { EnvPrintRouter(theEnv,logicalName," B"); PrintLongInteger(theEnv,logicalName,(long long) (hack->beginningOffset + 1)); } if (hack->fromEnd) { EnvPrintRouter(theEnv,logicalName," E"); PrintLongInteger(theEnv,logicalName,(long long) (hack->endOffset + 1)); } EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif }static intBool ObjectGetVarJNFunction2( void *theEnv, void *theValue, DATA_OBJECT *theResult) { struct ObjectMatchVar2 *hack; INSTANCE_TYPE *theInstance; struct multifieldMarker *theMarks; hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue); GetPatternObjectAndMarks(theEnv,((int) hack->whichPattern),hack->lhs,hack->rhs,&theInstance,&theMarks); GetObjectValueSimple(theEnv,theResult,theInstance,hack); return(TRUE); }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintObjectGetVarPN1( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectMatchVar1 *hack; hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue); if (hack->objectAddress) EnvPrintRouter(theEnv,logicalName,"(ptn-obj-ptr "); else if (hack->allFields) { EnvPrintRouter(theEnv,logicalName,"(ptn-obj-slot-contents "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot))); } else { EnvPrintRouter(theEnv,logicalName,"(ptn-obj-slot-var "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot))); EnvPrintRouter(theEnv,logicalName," "); PrintLongInteger(theEnv,logicalName,(long long) hack->whichField); } EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif }static intBool ObjectGetVarPNFunction1( void *theEnv, void *theValue, DATA_OBJECT *theResult) { struct ObjectMatchVar1 *hack; hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue); GetObjectValueGeneral(theEnv,theResult,ObjectReteData(theEnv)->CurrentPatternObject,ObjectReteData(theEnv)->CurrentPatternObjectMarks,hack); return(TRUE); }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintObjectGetVarPN2( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectMatchVar2 *hack; hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue); EnvPrintRouter(theEnv,logicalName,"(ptn-obj-slot-quick-var "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->whichSlot))); if (hack->fromBeginning) { EnvPrintRouter(theEnv,logicalName," B"); PrintLongInteger(theEnv,logicalName,(long long) (hack->beginningOffset + 1)); } if (hack->fromEnd) { EnvPrintRouter(theEnv,logicalName," E"); PrintLongInteger(theEnv,logicalName,(long long) (hack->endOffset + 1)); } EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif }static intBool ObjectGetVarPNFunction2( void *theEnv, void *theValue, DATA_OBJECT *theResult) { struct ObjectMatchVar2 *hack; hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue); GetObjectValueSimple(theEnv,theResult,ObjectReteData(theEnv)->CurrentPatternObject,hack); return(TRUE); }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintObjectCmpConstant( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectCmpPNConstant *hack; hack = (struct ObjectCmpPNConstant *) ValueToBitMap(theValue); EnvPrintRouter(theEnv,logicalName,"(obj-const "); EnvPrintRouter(theEnv,logicalName,hack->pass ? "p " : "n "); if (hack->general) PrintExpression(theEnv,logicalName,GetFirstArgument()); else { EnvPrintRouter(theEnv,logicalName,hack->fromBeginning ? "B" : "E"); PrintLongInteger(theEnv,logicalName,(long long) hack->offset); EnvPrintRouter(theEnv,logicalName," "); PrintExpression(theEnv,logicalName,GetFirstArgument()); } EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintSlotLengthTest( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectMatchLength *hack; hack = (struct ObjectMatchLength *) ValueToBitMap(theValue); EnvPrintRouter(theEnv,logicalName,"(obj-slot-len "); if (hack->exactly) EnvPrintRouter(theEnv,logicalName,"= "); else EnvPrintRouter(theEnv,logicalName,">= "); PrintLongInteger(theEnv,logicalName,(long long) hack->minLength); EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif }static intBool SlotLengthTestFunction( void *theEnv, void *theValue, DATA_OBJECT *theResult) { struct ObjectMatchLength *hack; theResult->type = SYMBOL; theResult->value = EnvFalseSymbol(theEnv); hack = (struct ObjectMatchLength *) ValueToBitMap(theValue); if (ObjectReteData(theEnv)->CurrentObjectSlotLength < hack->minLength) return(FALSE); if (hack->exactly && (ObjectReteData(theEnv)->CurrentObjectSlotLength > hack->minLength)) return(FALSE); theResult->value = EnvTrueSymbol(theEnv); return(TRUE); }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic void PrintPNSimpleCompareFunction1( void *theEnv, char *logicalName, void *theValue) {#if DEVELOPER struct ObjectCmpPNSingleSlotVars1 *hack; hack = (struct ObjectCmpPNSingleSlotVars1 *) ValueToBitMap(theValue); EnvPrintRouter(theEnv,logicalName,"(pslot-cmp1 "); EnvPrintRouter(theEnv,logicalName,hack->pass ? "p " : "n "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->firstSlot))); EnvPrintRouter(theEnv,logicalName," "); EnvPrintRouter(theEnv,logicalName,ValueToString(FindIDSlotName(theEnv,(unsigned) hack->secondSlot))); EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -