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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? facthsh.c

?? clips源代碼
?? C
字號:
   /*******************************************************/   /*      "C" Language Integrated Production System      */   /*                                                     */   /*             CLIPS Version 6.24  05/17/06            */   /*                                                     */   /*                 FACT HASHING MODULE                 */   /*******************************************************//*************************************************************//* Purpose: Provides routines for maintaining a fact hash    *//*   table so that duplication of facts can quickly be       *//*   determined.                                             *//*                                                           *//* Principal Programmer(s):                                  *//*      Gary D. Riley                                        *//*                                                           *//* Contributing Programmer(s):                               *//*                                                           *//* Revision History:                                         *//*                                                           *//*      6.24: Removed LOGICAL_DEPENDENCIES compilation flag. *//*                                                           *//*            Renamed BOOLEAN macro type to intBool.         *//*                                                           *//*************************************************************/#define _FACTHSH_SOURCE_#include <stdio.h>#define _STDIO_INCLUDED_#include <stdlib.h>#include "setup.h"#if DEFTEMPLATE_CONSTRUCT#include "constant.h"#include "memalloc.h"#include "router.h"#include "sysdep.h"#include "envrnmnt.h"#if DEFRULE_CONSTRUCT#include "lgcldpnd.h"#endif#include "facthsh.h"/***************************************//* LOCAL INTERNAL FUNCTION DEFINITIONS *//***************************************/   static struct fact            *FactExists(void *,struct fact *,unsigned long);   static struct factHashEntry  **CreateFactHashTable(void *,unsigned long);   static void                    ResizeFactHashTable(void *);   static void                    ResetFactHashTable(void *);   /************************************************//* HashFact: Returns the hash value for a fact. *//************************************************/unsigned long HashFact(  void *theEnv,  struct fact *theFact)  {   unsigned long count = 0;   /*============================================*/   /* Get a hash value for the deftemplate name. */   /*============================================*/   count += (unsigned long) theFact->whichDeftemplate->header.name->bucket * 73981;   /*=================================================*/   /* Add in the hash value for the rest of the fact. */   /*=================================================*/   count += HashMultifield(&theFact->theProposition,-1);   /*================================*/   /* Make sure the hash value falls */   /* in the appropriate range.      */   /*================================*/   theFact->hashValue = count;   /*========================*/   /* Return the hash value. */   /*========================*/   return(count);  }/**********************************************//* FactExists: Determines if a specified fact *//*   already exists in the fact hash table.   *//**********************************************/static struct fact *FactExists(  void *theEnv,  struct fact *theFact,  unsigned long hashValue)  {   struct factHashEntry *theFactHash;   hashValue = (hashValue % FactData(theEnv)->FactHashTableSize);   for (theFactHash = FactData(theEnv)->FactHashTable[hashValue];        theFactHash != NULL;        theFactHash = theFactHash->next)     {      if (theFact->hashValue != theFactHash->theFact->hashValue)        { continue; }      if ((theFact->whichDeftemplate == theFactHash->theFact->whichDeftemplate) ?          MultifieldsEqual(&theFact->theProposition,                           &theFactHash->theFact->theProposition) : FALSE)        { return(theFactHash->theFact); }     }   return(NULL);  }/************************************************************//* AddHashedFact: Adds a fact entry to the fact hash table. *//************************************************************/globle void AddHashedFact(  void *theEnv,  struct fact *theFact,  unsigned long hashValue)  {   struct factHashEntry *newhash, *temp;   if (FactData(theEnv)->NumberOfFacts > FactData(theEnv)->FactHashTableSize)     { ResizeFactHashTable(theEnv); }   newhash = get_struct(theEnv,factHashEntry);   newhash->theFact = theFact;   hashValue = (hashValue % FactData(theEnv)->FactHashTableSize);      temp = FactData(theEnv)->FactHashTable[hashValue];   FactData(theEnv)->FactHashTable[hashValue] = newhash;   newhash->next = temp;  }/******************************************//* RemoveHashedFact: Removes a fact entry *//*   from the fact hash table.            *//******************************************/globle intBool RemoveHashedFact(  void *theEnv,  struct fact *theFact)  {   int hashValue;   struct factHashEntry *hptr, *prev;   hashValue = HashFact(theEnv,theFact);   hashValue = (hashValue % FactData(theEnv)->FactHashTableSize);   for (hptr = FactData(theEnv)->FactHashTable[hashValue], prev = NULL;        hptr != NULL;        hptr = hptr->next)     {      if (hptr->theFact == theFact)        {         if (prev == NULL)           {            FactData(theEnv)->FactHashTable[hashValue] = hptr->next;            rtn_struct(theEnv,factHashEntry,hptr);            if (FactData(theEnv)->NumberOfFacts == 1)              { ResetFactHashTable(theEnv); }            return(1);           }         else           {            prev->next = hptr->next;            rtn_struct(theEnv,factHashEntry,hptr);            if (FactData(theEnv)->NumberOfFacts == 1)              { ResetFactHashTable(theEnv); }            return(1);           }        }      prev = hptr;     }   return(0);  }/*****************************************************//* HandleFactDuplication: Determines if a fact to be *//*   added to the fact-list is a duplicate entry and *//*   takes appropriate action based on the current   *//*   setting of the fact-duplication flag.           *//*****************************************************/globle unsigned long HandleFactDuplication(  void *theEnv,  void *theFact,  intBool *duplicate)  {   struct fact *tempPtr;   unsigned long hashValue;   *duplicate = FALSE;      hashValue = HashFact(theEnv,(struct fact *) theFact);   if (FactData(theEnv)->FactDuplication) return(hashValue);   tempPtr = FactExists(theEnv,(struct fact *) theFact,hashValue);   if (tempPtr == NULL) return(hashValue);   ReturnFact(theEnv,(struct fact *) theFact);#if DEFRULE_CONSTRUCT   AddLogicalDependencies(theEnv,(struct patternEntity *) tempPtr,TRUE);#endif   *duplicate = TRUE;   return(0);  }/*******************************************//* EnvGetFactDuplication: C access routine *//*   for the get-fact-duplication command. *//*******************************************/globle intBool EnvGetFactDuplication(  void *theEnv)  {      return(FactData(theEnv)->FactDuplication);   }/*******************************************//* EnvSetFactDuplication: C access routine *//*   for the set-fact-duplication command. *//*******************************************/globle intBool EnvSetFactDuplication(  void *theEnv,  int value)  {   int ov;   ov = FactData(theEnv)->FactDuplication;   FactData(theEnv)->FactDuplication = value;   return(ov);  }/**************************************************//* InitializeFactHashTable: Initializes the table *//*   entries in the fact hash table to NULL.      *//**************************************************/globle void InitializeFactHashTable(   void *theEnv)   {    FactData(theEnv)->FactHashTable = CreateFactHashTable(theEnv,SIZE_FACT_HASH);    FactData(theEnv)->FactHashTableSize = SIZE_FACT_HASH;   }/*******************************************************************//* CreateFactHashTable: Creates and initializes a fact hash table. *//*******************************************************************/static struct factHashEntry **CreateFactHashTable(   void *theEnv,   unsigned long tableSize)   {    unsigned long i;    struct factHashEntry **theTable;    theTable = (struct factHashEntry **)               gm3(theEnv,sizeof (struct factHashEntry *) * tableSize);    if (theTable == NULL) EnvExitRouter(theEnv,EXIT_FAILURE);        for (i = 0; i < tableSize; i++) theTable[i] = NULL;        return(theTable);   } /*******************************************************************//* ResizeFactHashTable: *//*******************************************************************/static void ResizeFactHashTable(   void *theEnv)   {    unsigned long i, newSize, newLocation;    struct factHashEntry **theTable, **newTable;    struct factHashEntry *theEntry, *nextEntry;    theTable = FactData(theEnv)->FactHashTable;        newSize = (FactData(theEnv)->FactHashTableSize * 2) + 1;    newTable = CreateFactHashTable(theEnv,newSize);    /*========================================*/    /* Copy the old entries to the new table. */    /*========================================*/        for (i = 0; i < FactData(theEnv)->FactHashTableSize; i++)      {       theEntry = theTable[i];       while (theEntry != NULL)         {           nextEntry = theEntry->next;                    newLocation = theEntry->theFact->hashValue % newSize;          theEntry->next = newTable[newLocation];          newTable[newLocation] = theEntry;                    theEntry = nextEntry;         }      }        /*=====================================================*/    /* Replace the old hash table with the new hash table. */    /*=====================================================*/        rm3(theEnv,theTable,sizeof(struct factHashEntry *) * FactData(theEnv)->FactHashTableSize);    FactData(theEnv)->FactHashTableSize = newSize;    FactData(theEnv)->FactHashTable = newTable;   }/*******************************************************************//* ResetFactHashTable: *//*******************************************************************/static void ResetFactHashTable(   void *theEnv)   {    struct factHashEntry **newTable;    /*=============================================*/    /* Don't reset the table unless the hash table */    /* has been expanded from its original size.   */    /*=============================================*/        if (FactData(theEnv)->FactHashTableSize == SIZE_FACT_HASH)      { return; }              /*=======================*/    /* Create the new table. */    /*=======================*/        newTable = CreateFactHashTable(theEnv,SIZE_FACT_HASH);        /*=====================================================*/    /* Replace the old hash table with the new hash table. */    /*=====================================================*/        rm3(theEnv,FactData(theEnv)->FactHashTable,sizeof(struct factHashEntry *) * FactData(theEnv)->FactHashTableSize);    FactData(theEnv)->FactHashTableSize = SIZE_FACT_HASH;    FactData(theEnv)->FactHashTable = newTable;   }      #if DEVELOPER/*****************************************************//* ShowFactHashTable: Displays the number of entries *//*   in each slot of the fact hash table.            *//*****************************************************/globle void ShowFactHashTable(   void *theEnv)   {    int i, count;    struct factHashEntry *theEntry;    char buffer[20];    for (i = 0; i < FactData(theEnv)->FactHashTableSize; i++)      {       for (theEntry =  FactData(theEnv)->FactHashTable[i], count = 0;            theEntry != NULL;            theEntry = theEntry->next)         { count++; }       if (count != 0)         {          gensprintf(buffer,"%4d: %4d\n",i,count);          EnvPrintRouter(theEnv,WDISPLAY,buffer);         }      }   }#endif /* DEVELOPER */#endif /* DEFTEMPLATE_CONSTRUCT */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色一情一乱一乱一91av| 男女男精品网站| 99精品黄色片免费大全| 国产欧美精品一区二区三区四区 | 欧美午夜精品一区二区蜜桃 | 午夜激情一区二区| 欧美一区二区三区精品| 国产精品资源在线观看| 国产精品网曝门| 成人app下载| 夜夜精品浪潮av一区二区三区| 91久久精品网| 日韩理论片中文av| 色综合av在线| 亚洲在线免费播放| 日韩欧美电影在线| 国产乱子伦视频一区二区三区| 精品免费日韩av| 99re这里都是精品| 日韩中文字幕亚洲一区二区va在线| 久久综合给合久久狠狠狠97色69| 国产在线麻豆精品观看| 久久久国产午夜精品| 国产99久久久国产精品潘金| 国产精品无人区| 精品污污网站免费看| 精品在线免费视频| 亚洲人亚洲人成电影网站色| 91啪亚洲精品| 久久成人久久爱| 亚洲三级在线观看| av电影一区二区| 国产精品第五页| 91.xcao| 久久av中文字幕片| 国产欧美一区二区精品忘忧草| 91极品视觉盛宴| 激情成人综合网| 丝袜美腿一区二区三区| 中文字幕日本不卡| 久久综合久久久久88| 欧美日韩精品系列| 菠萝蜜视频在线观看一区| 免费xxxx性欧美18vr| 悠悠色在线精品| 国产欧美日韩另类视频免费观看| 69堂亚洲精品首页| 在线一区二区视频| 成人在线视频一区| 毛片av中文字幕一区二区| 亚洲国产精品嫩草影院| 国产精品久久久久一区二区三区| 欧美成人精品高清在线播放| 欧美在线色视频| 99久久综合国产精品| 国产精品1024久久| 久久精品国产在热久久| 亚洲小说欧美激情另类| 中文字幕一区视频| 欧美激情一区在线| 国产日韩亚洲欧美综合| 欧美本精品男人aⅴ天堂| 欧美精品日韩一区| 欧美精选在线播放| 欧美日韩一区二区三区四区| 欧美艳星brazzers| 欧美色电影在线| 欧美日韩在线电影| 在线观看一区二区精品视频| 色哟哟国产精品免费观看| 成人av在线一区二区| 成人激情动漫在线观看| 成人网在线播放| 国产成人亚洲综合a∨婷婷图片| 久久精品999| 激情文学综合插| 国产盗摄女厕一区二区三区| 国产一区二区三区av电影 | 亚洲黄色免费电影| 亚洲美女精品一区| 一区二区三区不卡在线观看| 亚洲精品高清在线| 亚洲国产cao| 日本不卡一二三| 久久99精品久久久久久久久久久久| 麻豆精品国产91久久久久久| 蜜臀av在线播放一区二区三区| 美国欧美日韩国产在线播放| 久久精品国产网站| 国产 日韩 欧美大片| 成人精品国产一区二区4080| 成人黄页毛片网站| 日韩欧美一级二级| 2020国产精品自拍| 亚洲欧洲精品天堂一级| 亚洲激情在线播放| 日韩电影一区二区三区四区| 国内外成人在线| 成人aa视频在线观看| 欧美主播一区二区三区| 欧美一区二区免费| 国产精品天干天干在线综合| 亚洲女厕所小便bbb| 日韩精品五月天| 国产一区二区视频在线| 不卡高清视频专区| 欧美少妇一区二区| 精品日韩99亚洲| 中文字幕在线不卡一区二区三区| 性做久久久久久| 国产高清在线精品| 欧美羞羞免费网站| 精品sm在线观看| 亚洲自拍偷拍综合| 国产99久久久精品| 制服丝袜中文字幕一区| 国产精品乱码久久久久久| 日产精品久久久久久久性色| 国产成人av电影在线| 欧美久久一二三四区| 国产色婷婷亚洲99精品小说| 亚洲国产精品久久人人爱蜜臀| 国产自产高清不卡| 欧美老女人在线| 中文字幕视频一区二区三区久| 日韩不卡免费视频| 日本电影欧美片| 中文幕一区二区三区久久蜜桃| 丝袜美腿亚洲综合| 色婷婷亚洲综合| 国产精品剧情在线亚洲| 五月综合激情婷婷六月色窝| 丁香激情综合国产| 精品对白一区国产伦| 亚洲mv在线观看| 色综合婷婷久久| 国产精品人妖ts系列视频| 蜜桃一区二区三区四区| 在线观看亚洲一区| 亚洲欧洲韩国日本视频| 国产大陆a不卡| 2022国产精品视频| 美国欧美日韩国产在线播放| 欧美丝袜丝交足nylons图片| 日韩美女视频一区| 成人app在线| 亚洲国产精品精华液ab| 精品一区二区免费| 日韩一区二区高清| 午夜在线电影亚洲一区| 欧美亚洲一区二区在线| 亚洲青青青在线视频| 成人激情文学综合网| 国产精品色噜噜| 成人一区二区三区中文字幕| 久久久99精品免费观看不卡| 国内精品伊人久久久久影院对白| 欧美电影免费观看高清完整版| 奇米精品一区二区三区在线观看| 欧美精品亚洲二区| 亚洲图片欧美色图| 欧美精品久久久久久久多人混战| 亚洲国产精品久久不卡毛片| 欧美最猛性xxxxx直播| 亚洲人xxxx| 色老汉一区二区三区| 一区二区三区在线免费视频| 在线免费观看不卡av| 亚洲国产日韩一级| 欧美日韩视频在线一区二区| 午夜精品福利在线| 欧美日韩中文一区| 日本va欧美va欧美va精品| 日韩一区二区视频在线观看| 捆绑调教美女网站视频一区| 精品对白一区国产伦| 国产成人a级片| 亚洲欧美综合在线精品| 色av成人天堂桃色av| 三级一区在线视频先锋 | 亚洲h在线观看| 欧美一区二区三区不卡| 国产一区二区三区美女| 国产日韩欧美亚洲| 色天天综合色天天久久| 五月婷婷综合激情| 欧美电视剧在线看免费| 成人美女视频在线观看18| 亚洲人一二三区| 7777精品伊人久久久大香线蕉超级流畅| 日本三级亚洲精品| 中文字幕乱码久久午夜不卡| 91麻豆自制传媒国产之光| 午夜精品久久一牛影视| 精品国产乱码91久久久久久网站| 北条麻妃国产九九精品视频| 亚洲va国产va欧美va观看| 国产日韩欧美一区二区三区综合| 色婷婷av一区二区| 国产在线播放一区二区三区|