globle long long FactIndexFunction( void *theEnv) { DATA_OBJECT item; /*============================================*/ /* Check for the correct number of arguments. */ /*============================================*/ if (EnvArgCountCheck(theEnv,(char*)"fact-index",EXACTLY,1) == -1) return(-1LL); /*========================*/ /* Evaluate the argument. */ /*========================*/ EnvRtnUnknown(theEnv,1,&item); /*======================================*/ /* The argument must be a fact address. */ /*======================================*/ if (GetType(item) != FACT_ADDRESS) { ExpectedTypeError1(theEnv,(char*)"fact-index",1,(char*)"fact-address"); return(-1L); } /*================================================*/ /* Return the fact index associated with the fact */ /* address. If the fact has been retracted, then */ /* return -1 for the fact index. */ /*================================================*/ if (((struct fact *) GetValue(item))->garbage) return(-1LL); return (EnvFactIndex(theEnv,GetValue(item))); }
long long __declspec(dllexport) CALL_CONV __EnvFactIndex( void *theEnv, void *theFact) { return EnvFactIndex(theEnv,theFact); }
long int Fact::index() const { if ( m_cobj ) return EnvFactIndex( m_environment.cobj(), m_cobj ); return -1; }