亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cstrnchk.c

?? clips源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
   /*******************************************************/
   /*      "C" Language Integrated Production System      */
   /*                                                     */
   /*             CLIPS Version 6.24  07/01/05            */
   /*                                                     */
   /*             CONSTRAINT CHECKING MODULE              */
   /*******************************************************/

/*************************************************************/
/* Purpose: Provides functions for constraint checking of    */
/*   data types.                                             */
/*                                                           */
/* Principal Programmer(s):                                  */
/*      Gary D. Riley                                        */
/*                                                           */
/* Contributing Programmer(s):                               */
/*      Brian Donnell                                        */
/*                                                           */
/* Revision History:                                         */
/*      6.23: Changed name of variable exp to theExp         */
/*            because of Unix compiler warnings of shadowed  */
/*            definitions.                                   */
/*                                                           */
/*      6.24: Added allowed-classes slot facet.              */
/*                                                           */
/*            Renamed BOOLEAN macro type to intBool.         */
/*                                                           */
/*************************************************************/

#define _CSTRNCHK_SOURCE_

#include <stdio.h>
#define _STDIO_INCLUDED_
#include <stdlib.h>

#include "setup.h"

#include "router.h"
#include "multifld.h"
#include "envrnmnt.h"
#include "extnfunc.h"
#include "cstrnutl.h"
#if OBJECT_SYSTEM
#include "inscom.h"
#include "insfun.h"
#include "classcom.h"
#include "classexm.h"
#endif

#include "cstrnchk.h"

/***************************************/
/* LOCAL INTERNAL FUNCTION DEFINITIONS */
/***************************************/

   static intBool                 CheckRangeAgainstCardinalityConstraint(void *,int,int,CONSTRAINT_RECORD *);
   static int                     CheckFunctionReturnType(int,CONSTRAINT_RECORD *);
   static intBool                 CheckTypeConstraint(int,CONSTRAINT_RECORD *);
   static intBool                 CheckRangeConstraint(void *,int,void *,CONSTRAINT_RECORD *);
   static void                    PrintRange(void *,char *,CONSTRAINT_RECORD *);

/******************************************************/
/* CheckFunctionReturnType: Checks a functions return */
/*   type against a set of permissable return values. */
/*   Returns TRUE if the return type is included      */
/*   among the permissible values, otherwise FALSE.   */
/******************************************************/
static int CheckFunctionReturnType(
  int functionReturnType,
  CONSTRAINT_RECORD *constraints)
  {
   if (constraints == NULL) return(TRUE);

   if (constraints->anyAllowed) return(TRUE);

   switch(functionReturnType)
     {
      case 'c':
      case 'w':
      case 'b':
        if (constraints->symbolsAllowed) return(TRUE);
        else return(FALSE);

      case 's':
        if (constraints->stringsAllowed) return(TRUE);
        else return(FALSE);

      case 'j':
        if ((constraints->symbolsAllowed) ||
            (constraints->stringsAllowed) ||
            (constraints->instanceNamesAllowed)) return(TRUE);
        else return(FALSE);

      case 'k':
        if ((constraints->symbolsAllowed) || (constraints->stringsAllowed)) return(TRUE);
        else return(FALSE);

      case 'd':
      case 'f':
        if (constraints->floatsAllowed) return(TRUE);
        else return(FALSE);

      case 'i':
      case 'l':
        if (constraints->integersAllowed) return(TRUE);
        else return(FALSE);

      case 'n':
        if ((constraints->integersAllowed) || (constraints->floatsAllowed)) return(TRUE);
        else return(FALSE);

      case 'm':
        if (constraints->multifieldsAllowed) return(TRUE);
        else return(FALSE);

      case 'a':
        if (constraints->externalAddressesAllowed) return(TRUE);
        else return(FALSE);

      case 'x':
        if (constraints->instanceAddressesAllowed) return(TRUE);
        else return(FALSE);

      case 'o':
        if (constraints->instanceNamesAllowed) return(TRUE);
        else return(FALSE);

      case 'u':
        return(TRUE);

      case 'v':
        if (constraints->voidAllowed) return(TRUE);
     }

   return(TRUE);
  }

/****************************************************/
/* CheckTypeConstraint: Determines if a primitive   */
/*   data type satisfies the type constraint fields */
/*   of aconstraint record.                         */
/****************************************************/
static intBool CheckTypeConstraint(
  int type,
  CONSTRAINT_RECORD *constraints)
  {
   if (type == RVOID) return(FALSE);

   if (constraints == NULL) return(TRUE);

   if (constraints->anyAllowed == TRUE) return(TRUE);

   if ((type == SYMBOL) && (constraints->symbolsAllowed != TRUE))
     { return(FALSE); }

   if ((type == STRING) && (constraints->stringsAllowed != TRUE))
     { return(FALSE); }

   if ((type == FLOAT) && (constraints->floatsAllowed != TRUE))
     { return(FALSE); }

   if ((type == INTEGER) && (constraints->integersAllowed != TRUE))
     { return(FALSE); }

#if OBJECT_SYSTEM
   if ((type == INSTANCE_NAME) && (constraints->instanceNamesAllowed != TRUE))
     { return(FALSE); }

   if ((type == INSTANCE_ADDRESS) && (constraints->instanceAddressesAllowed != TRUE))
     { return(FALSE); }
#endif

   if ((type == EXTERNAL_ADDRESS) && (constraints->externalAddressesAllowed != TRUE))
     { return(FALSE); }

   if ((type == RVOID) && (constraints->voidAllowed != TRUE))
     { return(FALSE); }

   if ((type == FACT_ADDRESS) && (constraints->factAddressesAllowed != TRUE))
     { return(FALSE); }

   return(TRUE);
  }

/********************************************************/
/* CheckCardinalityConstraint: Determines if an integer */
/*   falls within the range of allowed cardinalities    */
/*   for a constraint record.                           */
/********************************************************/
globle intBool CheckCardinalityConstraint(
  void *theEnv,
  long number,
  CONSTRAINT_RECORD *constraints)
  {
   /*=========================================*/
   /* If the constraint record is NULL, there */
   /* are no cardinality restrictions.        */
   /*=========================================*/

   if (constraints == NULL) return(TRUE);

   /*==================================*/
   /* Determine if the integer is less */
   /* than the minimum cardinality.    */
   /*==================================*/

   if (constraints->minFields != NULL)
     {
      if (constraints->minFields->value != SymbolData(theEnv)->NegativeInfinity)
        {
         if (number < ValueToLong(constraints->minFields->value))
           { return(FALSE); }
        }
     }

   /*=====================================*/
   /* Determine if the integer is greater */
   /* than the maximum cardinality.       */
   /*=====================================*/

   if (constraints->maxFields != NULL)
     {
      if (constraints->maxFields->value != SymbolData(theEnv)->PositiveInfinity)
        {
         if (number > ValueToLong(constraints->maxFields->value))
           { return(FALSE); }
        }
     }

   /*=========================================================*/
   /* The integer falls within the allowed cardinality range. */
   /*=========================================================*/

   return(TRUE);
  }

/*****************************************************************/
/* CheckRangeAgainstCardinalityConstraint: Determines if a range */
/*   of numbers could possibly fall within the range of allowed  */
/*   cardinalities for a constraint record. Returns TRUE if at   */
/*   least one of the numbers in the range is within the allowed */
/*   cardinality, otherwise FALSE is returned.                   */
/*****************************************************************/
static intBool CheckRangeAgainstCardinalityConstraint(
  void *theEnv,
  int min,
  int max,
  CONSTRAINT_RECORD *constraints)
  {
   /*=========================================*/
   /* If the constraint record is NULL, there */
   /* are no cardinality restrictions.        */
   /*=========================================*/

   if (constraints == NULL) return(TRUE);

   /*===============================================================*/
   /* If the minimum value of the range is greater than the maximum */
   /* value of the cardinality, then there are no numbers in the    */
   /* range which could fall within the cardinality range, and so   */
   /* FALSE is returned.                                            */
   /*===============================================================*/

   if (constraints->maxFields != NULL)
     {
      if (constraints->maxFields->value != SymbolData(theEnv)->PositiveInfinity)
        {
         if (min > ValueToLong(constraints->maxFields->value))
           { return(FALSE); }
        }
     }

   /*===============================================================*/
   /* If the maximum value of the range is less than the minimum    */
   /* value of the cardinality, then there are no numbers in the    */
   /* range which could fall within the cardinality range, and so   */
   /* FALSE is returned. A maximum range value of -1 indicates that */
   /* the maximum possible value of the range is positive infinity. */
   /*===============================================================*/

   if ((constraints->minFields != NULL) && (max != -1))
     {
      if (constraints->minFields->value != SymbolData(theEnv)->NegativeInfinity)
        {
         if (max < ValueToLong(constraints->minFields->value))
           { return(FALSE); }
        }
     }

   /*=============================================*/
   /* At least one number in the specified range  */
   /* falls within the allowed cardinality range. */
   /*=============================================*/

   return(TRUE);
  }

/**********************************************************************/
/* CheckAllowedValuesConstraint: Determines if a primitive data type  */
/*   satisfies the allowed-... constraint fields of a constraint      */
/*   record. Returns TRUE if the constraints are satisfied, otherwise */
/*   FALSE is returned.                                               */
/**********************************************************************/
globle intBool CheckAllowedValuesConstraint(
  int type,
  void *vPtr,
  CONSTRAINT_RECORD *constraints)
  {
   struct expr *tmpPtr;

   /*=========================================*/
   /* If the constraint record is NULL, there */
   /* are no allowed-... restrictions.        */
   /*=========================================*/

   if (constraints == NULL) return(TRUE);

   /*=====================================================*/
   /* Determine if there are any allowed-... restrictions */
   /* for the type of the value being checked.            */
   /*=====================================================*/

   switch (type)
     {
      case SYMBOL:
        if ((constraints->symbolRestriction == FALSE) &&
            (constraints->anyRestriction == FALSE))
          { return(TRUE); }
        break;

#if OBJECT_SYSTEM
      case INSTANCE_NAME:
        if ((constraints->instanceNameRestriction == FALSE) &&
            (constraints->anyRestriction == FALSE))
          { return(TRUE); }
        break;
#endif

      case STRING:
        if ((constraints->stringRestriction == FALSE) &&
            (constraints->anyRestriction == FALSE))
          { return(TRUE); }
        break;

      case INTEGER:
        if ((constraints->integerRestriction == FALSE) &&
            (constraints->anyRestriction == FALSE))
          { return(TRUE); }
        break;

      case FLOAT:
        if ((constraints->floatRestriction == FALSE) &&
            (constraints->anyRestriction == FALSE))
          { return(TRUE); }
        break;

      default:
        return(TRUE);
     }

   /*=========================================================*/
   /* Search through the restriction list to see if the value */
   /* matches one of the allowed values in the list.          */
   /*=========================================================*/

   for (tmpPtr = constraints->restrictionList;
        tmpPtr != NULL;
        tmpPtr = tmpPtr->nextArg)
     {
      if ((tmpPtr->type == type) && (tmpPtr->value == vPtr)) return(TRUE);
     }

   /*====================================================*/
   /* If the value wasn't found in the list, then return */
   /* FALSE because the constraint has been violated.    */
   /*====================================================*/

   return(FALSE);
  }

/**********************************************************************/
/* CheckAllowedClassesConstraint: Determines if a primitive data type */
/*   satisfies the allowed-classes constraint fields of a constraint  */
/*   record. Returns TRUE if the constraints are satisfied, otherwise */
/*   FALSE is returned.                                               */
/**********************************************************************/
globle intBool CheckAllowedClassesConstraint(
  void *theEnv,
  int type,
  void *vPtr,
  CONSTRAINT_RECORD *constraints)
  {
#if OBJECT_SYSTEM
   struct expr *tmpPtr;
   INSTANCE_TYPE *ins;
   DEFCLASS *insClass, *cmpClass;

   /*=========================================*/
   /* If the constraint record is NULL, there */
   /* is no allowed-classes restriction.      */
   /*=========================================*/

   if (constraints == NULL) return(TRUE);

   /*======================================*/
   /* The constraint is satisfied if there */
   /* aren't any class restrictions.       */
   /*======================================*/
   
   if (constraints->classList == NULL)
     { return(TRUE); }

   /*==================================*/
   /* Class restrictions only apply to */
   /* instances and instance names.    */
   /*==================================*/
    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av性久久久久蜜臀aⅴ流畅| 7777精品伊人久久久大香线蕉的| 精品国产免费久久| 日韩黄色小视频| 欧美性猛交xxxxxx富婆| 亚洲私人影院在线观看| 国v精品久久久网| 欧美xxxx在线观看| 国产精品久久久久久久久动漫 | 91在线porny国产在线看| 久久久久久久网| 久久国产剧场电影| 国产精品女人毛片| 不卡一二三区首页| 国产精品蜜臀av| 成人精品一区二区三区四区| 国产亚洲欧美激情| 国产成人99久久亚洲综合精品| 久久精品亚洲一区二区三区浴池| 国产高清久久久久| 中文天堂在线一区| 国产精品成人网| 亚洲品质自拍视频| 在线视频国内自拍亚洲视频| 夜夜揉揉日日人人青青一国产精品| 在线亚洲精品福利网址导航| 精品国产一区a| 国产一区二区看久久| 久久精品亚洲精品国产欧美 | 日韩综合小视频| 91精品国产综合久久久蜜臀图片| 日韩精彩视频在线观看| 日韩三级在线免费观看| 欧美激情艳妇裸体舞| 亚洲国产欧美在线人成| 欧美日本一道本| 裸体健美xxxx欧美裸体表演| www成人在线观看| 亚洲一区二区三区四区在线免费观看 | 亚洲精品一区二区三区精华液| 国产尤物一区二区在线| 国产精品色婷婷| 一本大道综合伊人精品热热| 亚洲h在线观看| 99视频精品全部免费在线| 亚洲综合久久av| 欧美一级午夜免费电影| 国产成人精品1024| 亚洲精品国产精华液| 粉嫩13p一区二区三区| 一区二区三区四区乱视频| 欧美一卡二卡在线观看| 国产亚洲综合在线| 狠狠色丁香久久婷婷综| 国产精品久久久久9999吃药| 欧美日韩一区二区三区在线 | 理论片日本一区| 国产精品天干天干在观线| 欧美中文字幕一区| 欧美亚一区二区| 一区二区三区四区在线播放| 欧美一区二区三区视频在线观看| 国产成人一区在线| 亚洲一区二区在线免费观看视频 | 538在线一区二区精品国产| 洋洋成人永久网站入口| 精品美女一区二区| 91麻豆国产香蕉久久精品| 免费不卡在线视频| 亚洲国产成人私人影院tom| 欧美日韩一区二区三区四区| 国产精品亚洲午夜一区二区三区| 亚洲自拍另类综合| 成人黄色综合网站| 国产欧美精品一区二区色综合 | 国产a视频精品免费观看| 一级日本不卡的影视| 91丝袜呻吟高潮美腿白嫩在线观看| 视频一区二区中文字幕| 国产精品伦一区二区三级视频| 欧美色倩网站大全免费| 丰满少妇久久久久久久| 日本午夜精品视频在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美一区二区三区在线| 蜜臀久久99精品久久久久宅男| 1024成人网色www| 精品成人一区二区| 欧美日韩国产另类不卡| 99国产精品久久久久久久久久| 久久精品噜噜噜成人88aⅴ| 一区二区三区欧美在线观看| 国产日产欧美一区二区三区| 欧美一区在线视频| 久久精品一区二区三区四区| 欧美精品三级日韩久久| 91丨porny丨中文| 国产电影一区在线| 捆绑紧缚一区二区三区视频| 亚洲在线视频一区| 一色屋精品亚洲香蕉网站| 亚洲成a人片在线不卡一二三区| 欧美一区三区二区| 91传媒视频在线播放| 国产精品影视在线观看| 蜜臂av日日欢夜夜爽一区| 亚洲国产精品久久艾草纯爱| 亚洲精品日韩一| 国产精品福利一区二区三区| 久久美女艺术照精彩视频福利播放| 6080午夜不卡| 国产精品一区二区三区网站| 麻豆国产一区二区| 日日骚欧美日韩| 亚洲成av人综合在线观看| 亚洲精品一二三四区| 亚洲欧美在线aaa| 国产亚洲一二三区| 久久人人超碰精品| 精品国产3级a| 日韩电影在线免费观看| 国产精品理论在线观看| 国产日产欧美一区二区视频| 国产丝袜美腿一区二区三区| 亚洲精品一区二区三区精华液 | 首页欧美精品中文字幕| 亚洲成人在线网站| 亚洲一区在线视频| 亚洲影院免费观看| 一区二区高清免费观看影视大全 | 另类小说图片综合网| 麻豆精品国产91久久久久久| 美女诱惑一区二区| 久久精品二区亚洲w码| 欧美aⅴ一区二区三区视频| 日本亚洲电影天堂| 男女性色大片免费观看一区二区| 日本网站在线观看一区二区三区| 日日夜夜精品视频天天综合网| 日本美女视频一区二区| 精品91自产拍在线观看一区| 91污片在线观看| 欧美性生活影院| 欧美日韩国产另类不卡| 欧美一区二区大片| 精品国产伦一区二区三区免费 | 日韩欧美在线不卡| 成+人+亚洲+综合天堂| av爱爱亚洲一区| 色噜噜狠狠成人中文综合| 在线免费观看一区| 欧美日韩在线播放一区| 一区二区三区美女视频| 欧美精品一区二区蜜臀亚洲| 国产三级欧美三级| 国产精品白丝在线| 一区二区成人在线视频| 日本不卡123| 一区二区在线观看视频在线观看| 亚洲成人激情av| 麻豆91免费观看| 成人理论电影网| 欧美在线看片a免费观看| 欧美剧在线免费观看网站| 精品久久一区二区三区| 欧美国产一区二区在线观看 | 成人激情免费电影网址| 成人av在线影院| 欧美伊人久久久久久午夜久久久久| 欧美顶级少妇做爰| 精品国产91亚洲一区二区三区婷婷 | 久久久久久久综合色一本| 国产精品免费av| 天天做天天摸天天爽国产一区 | 国产精品一区三区| 91视频免费播放| 欧美疯狂做受xxxx富婆| 久久婷婷国产综合精品青草 | 欧美夫妻性生活| 欧美中文字幕亚洲一区二区va在线 | 亚洲精品免费看| 久久精品二区亚洲w码| 99免费精品在线观看| 欧美顶级少妇做爰| 中文欧美字幕免费| 91影视在线播放| 欧美一级爆毛片| 中文字幕亚洲视频| 日本欧美一区二区三区| 成人免费的视频| 91精品国产手机| 国产精品久久777777| 日本不卡一区二区三区高清视频| 成人激情av网| 欧美大片顶级少妇| 一区二区在线观看不卡| 国内精品国产成人| 亚洲一区在线观看免费观看电影高清| 国产精品网曝门| 久久国产夜色精品鲁鲁99|