Esempio n. 1
0
globle void RefreshCommand(
    void *theEnv)
{
    char *ruleName;
    void *rulePtr;

    /*===========================*/
    /* Get the name of the rule. */
    /*===========================*/

    ruleName = GetConstructName(theEnv,(char*)"refresh",(char*)"rule name");
    if (ruleName == NULL) return;

    /*===============================*/
    /* Determine if the rule exists. */
    /*===============================*/

    rulePtr = EnvFindDefrule(theEnv,ruleName);
    if (rulePtr == NULL)
    {
        CantFindItemErrorMessage(theEnv,(char*)"defrule",ruleName);
        return;
    }

    /*===================*/
    /* Refresh the rule. */
    /*===================*/

    EnvRefresh(theEnv,rulePtr);
}
Esempio n. 2
0
globle void RemoveBreakCommand(
  void *theEnv)
  {
   DATA_OBJECT argPtr;
   char *argument;
   int nargs;
   void *defrulePtr;

   if ((nargs = EnvArgCountCheck(theEnv,"remove-break",NO_MORE_THAN,1)) == -1)
     { return; }

   if (nargs == 0)
     {
      RemoveAllBreakpoints(theEnv);
      return;
     }

   if (EnvArgTypeCheck(theEnv,"remove-break",1,SYMBOL,&argPtr) == FALSE) return;

   argument = DOToString(argPtr);

   if ((defrulePtr = EnvFindDefrule(theEnv,argument)) == NULL)
     {
      CantFindItemErrorMessage(theEnv,"defrule",argument);
      return;
     }

   if (EnvRemoveBreak(theEnv,defrulePtr) == FALSE)
     {
      EnvPrintRouter(theEnv,WERROR,"Rule ");
      EnvPrintRouter(theEnv,WERROR,argument);
      EnvPrintRouter(theEnv,WERROR," does not have a breakpoint set.\n");
     }
  }
Esempio n. 3
0
globle long RuleComplexityCommand(
  void *theEnv)
  {
   char *ruleName;
   struct defrule *rulePtr;

   ruleName = GetConstructName(theEnv,"rule-complexity","rule name");
   if (ruleName == NULL) return(-1);

   rulePtr = (struct defrule *) EnvFindDefrule(theEnv,ruleName);
   if (rulePtr == NULL)
     {
      CantFindItemErrorMessage(theEnv,"defrule",ruleName);
      return(-1);
     }

   return(rulePtr->complexity);
  }
Esempio n. 4
0
globle void MatchesCountCommand(
  void *theEnv)
  {
   char *ruleName;
   void *rulePtr;

   ruleName = GetConstructName(theEnv,"matches-count","rule name");
   if (ruleName == NULL) return;

   rulePtr = EnvFindDefrule(theEnv,ruleName);
   if (rulePtr == NULL)
     {
      CantFindItemErrorMessage(theEnv,"defrule",ruleName);
      return;
     }

   EnvMatchesCount(theEnv,rulePtr);
  }
Esempio n. 5
0
globle long long JoinActivityCommand(
  void *theEnv)
  {
   char *ruleName;
   void *rulePtr;

   ruleName = GetConstructName(theEnv,"join-activity","rule name");
   if (ruleName == NULL) return(0);

   rulePtr = EnvFindDefrule(theEnv,ruleName);
   if (rulePtr == NULL)
     {
      CantFindItemErrorMessage(theEnv,"defrule",ruleName);
      return(0);
     }

   return EnvJoinActivity(theEnv,rulePtr,0);
  }
Esempio n. 6
0
globle void ShowJoinsCommand(
  void *theEnv)
  {
   char *ruleName;
   void *rulePtr;

   ruleName = GetConstructName(theEnv,"show-joins","rule name");
   if (ruleName == NULL) return;

   rulePtr = EnvFindDefrule(theEnv,ruleName);
   if (rulePtr == NULL)
     {
      CantFindItemErrorMessage(theEnv,"defrule",ruleName);
      return;
     }

   ShowJoins(theEnv,rulePtr);

   return;
  }
Esempio n. 7
0
globle void SetBreakCommand(
  void *theEnv)
  {
   DATA_OBJECT argPtr;
   char *argument;
   void *defrulePtr;

   if (EnvArgCountCheck(theEnv,"set-break",EXACTLY,1) == -1) return;

   if (EnvArgTypeCheck(theEnv,"set-break",1,SYMBOL,&argPtr) == FALSE) return;

   argument = DOToString(argPtr);

   if ((defrulePtr = EnvFindDefrule(theEnv,argument)) == NULL)
     {
      CantFindItemErrorMessage(theEnv,"defrule",argument);
      return;
     }

   EnvSetBreak(theEnv,defrulePtr);
  }
Esempio n. 8
0
globle void *FindDefrule(
  const char *defruleName)
  {
   return EnvFindDefrule(GetCurrentEnvironment(),defruleName);
  }