Beispiel #1
0
static void RestoreExecutionInformation()
  {
   HKEY hKey;
   DWORD lpdwDisposition;
   struct ExecutionInformation executionInfo;
   DWORD type = REG_BINARY;
   DWORD size = sizeof(struct ExecutionInformation);
   
   if (RegCreateKeyEx(HKEY_CURRENT_USER,TEXT("Software\\CLIPS\\CLIPSWin"),0,"",0,
                      KEY_READ | KEY_WRITE,NULL,&hKey,&lpdwDisposition) != ERROR_SUCCESS)
     { return; }

   if (RegQueryValueEx(hKey,"Execution",0,&type,(BYTE *) &executionInfo,
                       &size) != ERROR_SUCCESS)
     {
      RegCloseKey(hKey);
      return;
     }

   EnvSetSalienceEvaluation(GlobalEnv,executionInfo.salienceEvaluation);
   EnvSetStrategy(GlobalEnv,executionInfo.strategy);
   EnvSetStaticConstraintChecking(GlobalEnv,executionInfo.staticConstraintChecking);
   EnvSetDynamicConstraintChecking(GlobalEnv,executionInfo.dynamicConstraintChecking);
   EnvSetAutoFloatDividend(GlobalEnv,executionInfo.autoFloatDividend);
   EnvSetResetGlobals(GlobalEnv,executionInfo.resetGlobals);
   EnvSetFactDuplication(GlobalEnv,executionInfo.factDuplication);
   EnvSetIncrementalReset(GlobalEnv,executionInfo.incrementalReset);
   EnvSetSequenceOperatorRecognition(GlobalEnv,executionInfo.sequenceOperatorRecognition);

   RegCloseKey(hKey);
  }
Beispiel #2
0
globle int SetResetGlobalsCommand(
  void *theEnv)
  {
   int oldValue;
   DATA_OBJECT arg_ptr;

   /*===========================================*/
   /* Remember the old value of this attribute. */
   /*===========================================*/

   oldValue = EnvGetResetGlobals(theEnv);

   /*============================================*/
   /* Check for the correct number of arguments. */
   /*============================================*/

   if (EnvArgCountCheck(theEnv,"set-reset-globals",EXACTLY,1) == -1)
     { return(oldValue); }

   /*===========================================*/
   /* Determine the new value of the attribute. */
   /*===========================================*/

   EnvRtnUnknown(theEnv,1,&arg_ptr);

   if ((arg_ptr.value == EnvFalseSymbol(theEnv)) && (arg_ptr.type == SYMBOL))
     { EnvSetResetGlobals(theEnv,FALSE); }
   else
     { EnvSetResetGlobals(theEnv,TRUE); }

   /*========================================*/
   /* Return the old value of the attribute. */
   /*========================================*/

   return(oldValue);
  }