Exemple #1
0
int __declspec(dllexport) CALL_CONV __EnvGetFactSlot(
  void *theEnv,
  void *theFact,
  char *slotName,
  void *returnValue)
  {
   return EnvGetFactSlot(theEnv,theFact,slotName,returnValue);  
  }  
Exemple #2
0
Values Fact::slot_value( const std::string & name )
	{
		DATA_OBJECT data_object;
		int result;

		if ( !m_cobj )
			return Values();

    if ( name == "" ) {
      result = EnvGetFactSlot( m_environment.cobj(), m_cobj, NULL, &data_object );
//       result = EnvGetFactSlot( m_environment.cobj(), m_cobj, "", &data_object );
    }
    else
  		result = EnvGetFactSlot( m_environment.cobj(), m_cobj, const_cast<char*>(name.c_str()), &data_object );
		if (result)
			return data_object_to_values( data_object );
    else
			return Values();
	}
Exemple #3
0
globle void FactSlotValue(
  void *theEnv,
  void *vTheFact,
  const char *theSlotName,
  DATA_OBJECT *returnValue)
  {
   struct fact *theFact = (struct fact *) vTheFact;
   short position;

   /*==================================================*/
   /* Make sure the slot exists (the symbol implied is */
   /* used for the implied slot of an ordered fact).   */
   /*==================================================*/

   if (theFact->whichDeftemplate->implied)
     {
      if (strcmp(theSlotName,"implied") != 0)
        {
         EnvSetEvaluationError(theEnv,TRUE);
         InvalidDeftemplateSlotMessage(theEnv,theSlotName,
                                       ValueToString(theFact->whichDeftemplate->header.name),FALSE);
         return;
        }
     }

   else if (FindSlot(theFact->whichDeftemplate,(SYMBOL_HN *) EnvAddSymbol(theEnv,theSlotName),&position) == NULL)
     {
      EnvSetEvaluationError(theEnv,TRUE);
      InvalidDeftemplateSlotMessage(theEnv,theSlotName,
                                    ValueToString(theFact->whichDeftemplate->header.name),FALSE);
      return;
     }

   /*==========================*/
   /* Return the slot's value. */
   /*==========================*/

   if (theFact->whichDeftemplate->implied)
     { EnvGetFactSlot(theEnv,theFact,NULL,returnValue); }
   else
     { EnvGetFactSlot(theEnv,theFact,theSlotName,returnValue); }
  }