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

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

?? hashlib.c

?? VXWORKS 源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* hashLib.c - generic hashing library *//* Copyright 1990-1993 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01l,12feb93,kdl  changed hashLibInit() to handle multiple invocations.01k,04jul92,jcf  scalable/ANSI/cleanup effort.01j,26may92,rrr  the tree shuffle01i,19nov91,rrr  shut up some ansi warnings.01h,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -changed VOID to void		  -changed copyright notice01g,01oct90,jcf   fixed hashTblEach() to traverse table correctly.01f,28sep90,jcf   documentation.01e,17jul90,dnw   changed call to objAlloc() to objAllocExtra()01d,05jul90,jcf   documentation.01c,23jun90,jcf   changed ffs to ffsMsb.01b,22apr90,jcf   removed hashTblShow to indepent show routine library.01a,17nov89,jcf   written.*//*DESCRIPTIONThis subroutine library supports the creation and maintenance of achained hash table.  Hash tables efficiently store hash nodes for fast access.They are frequently used for symbol tables, or other name to identifierfunctions.  A chained hash table is an array of singly linked list heads,with one list head per element of the hash table.  During creation a hash tableis passed two user-definable functions, the hashing function, and the hash nodecomparator.HASH NODESA hash node is a structure used for chaining nodes together in the table.The defined structure HASH_NODE is not complete because it contains no fieldfor the key for referencing, and no place to store data.  The user completesthe hash node by including a HASH_NODE in a structure containing the necessarykey and data fields.  This flexibility allows hash tables to better suitvarying data representations of the key and data fields.  The hashing functionand the hash node comparator determine the full hash node representation.  Referto the defined structures H_NODE_INT and H_NODE_STRING for examples of thegeneral purpose hash nodes used by the hashing functions and hash nodecomparators defined in this library.HASHING FUNCTIONSOne function, called the hashing function, controls the distribution of nodesin the table.  This library provides a number of standard hashing functions,but applications can specify their own.  Desirable properties of a hashingfunction are that they execute quickly, and evenly distribute the nodesthroughout the table.  The worst hashing function imaginable would be:h(k) = 0.  This function would put all nodes in list associated with thezero element in the hash table.  Most hashing functions find their originin random number generators.Hashing functions must return an index between zero and (elements - 1).  Theytake the following form:.CSint hashFuncXXX (elements, pHashNode, keyArg)    int		elements;	/@ number of elements in hash table        @/    HASH_NODE	*pHashNode;	/@ hash node to pass through hash function @/    int		keyArg;		/@ optional argument to hash function      @/.CEHASH NODE COMPARATOR FUNCTIONSThe second function required is a key comparator.  Different hash tables maychoose to compare hash nodes in different ways.  For example, the hash nodecould contain a key which is a pointer to a string, or simply an integer.The comparator compares the hash node on the basis of some criteria, andreturns a boolean as to the nodes equivalence.  Additionally, the keycomparator can use the keyCmpArg for additional information to the comparator.The keyCmpArg is passed from all the hashLib functions which use the thecomparator.  The keyCmpArg is usually not needed except for advancedhash table queurying.symLib is a good example of the utilization of the keyCmpArg parameter.symLib hashes the name of the symbol.  It finds the id based on thename using hashTblFind(), but for the purposes of putting and removingsymbols from the symbol's hash table, an additional comparison restrictionapplies.  Symbols have types, and while symbols of equivalent names can exist,no symbols of equivalent name and type can exist.  So symLib utilizes thekeyCmpArg as a flag to denote the which operation being performed on the hashtable: symbol name matching, or complete symbol name and type matching.Key comparator functions must return a boolean.  They take the following form:.CSint hashKeyCmpXXX (pMatchNode, pHashNode, keyCmpArg)    HASH_NODE	*pMatchNode;	/@ hash node to match                        @/    HASH_NODE	*pHashNode;	/@ hash node in table being compared to      @/    int		keyCmpArg;	/@ parameter passed to hashTblFind (2)       @/.CEHASHING COLLISIONSHashing collisions occur when the hashing function returns the same index whengiven two unique keys.  This is unavoidable in cases where there are more nodesin the hash table then there are elements in the hash table.  In a chainedhash table, collisions are resolved by treating each element of the table asthe head of a linked list.  Nodes are simply added to appropriate listregardless of other nodes already in the list.  The list is not sorted, butnew nodes are added at the head of the list because newer entries are usuallysearched for before older entries.  When nodes are removed or searched for,the list is traversed from the head until a match is found.STRUCTURE.CS   HASH_HEAD 0           HASH_NODE         HASH_NODE   ---------             --------          --------   | head--------------->| next----------->| next---------   |       |             |......|          |......|      |   | tail------          | key  |          | key  |      |   |       |  |          | data |          | data |      v   ---------  |          --------          --------     ---              |                             ^            -              |                             |              -------------------------------   HASH_HEAD 1           HASH_NODE   ---------             --------   | head--------------->| next---------   |       |             |......|      |   | tail------          | key  |      |   |       |  |          | data |      v   ---------  |          --------     ---              |           ^            -              |           |              -------------    ...    ...   HASH_HEAD N   ---------   | head-----------------   |       |             |   | tail---------       |   |       |     |       v   ---------    ---     ---		 -	 -.CECAVEATSHash tables must have a number of elements equal to a power of two.INCLUDE FILE: hashLib.h*/#include "vxWorks.h"#include "errno.h"#include "hashLib.h"#include "string.h"#include "private/classLibP.h"#include "private/objLibP.h"IMPORT int ffsMsb (int bitfield);/* locals */LOCAL OBJ_CLASS hashClass;LOCAL BOOL	hashLibInstalled = FALSE;  /* protect from multiple inits *//* globals */CLASS_ID hashClassId = &hashClass;/********************************************************************************* hashLibInit - initialize hash table library** This routine initializes the hash table package.*/STATUS hashLibInit (void)    {    if (!hashLibInstalled &&(classInit (hashClassId, sizeof (HASH_TBL), 		       	     		OFFSET(HASH_TBL,objCore),		       	     		(FUNCPTR) hashTblCreate, 					(FUNCPTR) hashTblInit,		       	     		(FUNCPTR) hashTblDestroy) == OK))	{	hashLibInstalled = TRUE;	}	    return ((hashLibInstalled) ? OK : ERROR);    }/********************************************************************************* hashTblCreate - create a hash table** This rountine creates a hash table 2^sizeLog2 number of elements.  The hash* table is carved from the system memory pool via malloc (2).  To accomidate* the list structures associated with the table, the actual amout of memory* alocated will be roughly eight times the number of elements requested.* Additionallly, two routines must be specified to dictate the behavior of the* hashing table.  The first routine is the hashing function.** The hashing function's role is to disperse the hash nodes added to the table* as evenly throughout the table as possible.  The hashing function receives as* its parameters; the number of elements in the table, a pointer to the* HASH_NODE structure, and finally the keyArg parameter passed to this* routine.  The keyArg may be used to seed the hashing function.  The hash* function returns an index between 0 and (elements - 1).  Standard hashing* functions are available in this library.** The keyCmpRtn parameter specifies the other function required by the hash* table.  This routine tests for equivalence of two HASH_NODES.  It returns a* boolean, TRUE if the keys match, and FALSE if they differ.  As an example,* a hash node may contain a HASH_NODE followed by a key which is an unsigned* integer identifiers, or a pointer to a string, depending on the application.* Standard hash node comparators are available in this library.** RETURNS: HASH_ID, or NULL if hash table could not be created.** SEE ALSO: hashFuncIterScale(), hashFuncModulo(), hashFuncMultiply()* 	    hashKeyCmp(), hashKeyStrCmp()*/HASH_ID hashTblCreate    (    int         sizeLog2,       /* number of elements in hash table log 2 */    FUNCPTR     keyCmpRtn,      /* function to test keys for equivalence */    FUNCPTR     keyRtn,         /* hashing function to generate hash from key */    int         keyArg          /* argument to hashing function */    )    {    unsigned extra  = (1 << sizeLog2) * sizeof (SL_LIST);    HASH_ID hashId;    SL_LIST *pList;    hashId  = (HASH_ID) objAllocExtra (hashClassId, extra, (void **) &pList);    if (hashId != NULL)	hashTblInit (hashId, pList, sizeLog2, keyCmpRtn, keyRtn, keyArg);    return (hashId);				/* return the hash id */    }/********************************************************************************* hashTblInit - initialize a hash table** This routine initializes a hash table.** RETURNS: OK*/STATUS hashTblInit    (    HASH_TBL    *pHashTbl,      /* pointer to hash table to initialize */    SL_LIST     *pTblMem,       /* pointer to memory of sizeLog2 SL_LISTs */    int         sizeLog2,       /* number of elements in hash table log 2 */    FUNCPTR     keyCmpRtn,      /* function to test keys for equivalence */    FUNCPTR     keyRtn,         /* hashing function to generate hash from key */    int         keyArg          /* argument to hashing function */    )    {    FAST int ix;    pHashTbl->elements	= 1 << sizeLog2;	/* store number of elements */    pHashTbl->keyCmpRtn	= keyCmpRtn;		/* store comparator routine */    pHashTbl->keyRtn	= keyRtn;		/* store hashing function */    pHashTbl->keyArg	= keyArg;		/* store hashing function arg */    pHashTbl->pHashTbl	= pTblMem;    /* initialize all of the linked list heads in the table */    for (ix = 0; ix < pHashTbl->elements; ix++)	sllInit (&pHashTbl->pHashTbl [ix]);    objCoreInit (&pHashTbl->objCore, hashClassId);	/* initialize core */    return (OK);    }/********************************************************************************* hashTblDelete - delete a hash table** This routine deletes the specified hash table and frees the* associated memory.  The hash table is marked as invalid.** RETURNS: OK, or ERROR if hashId is invalid.*/STATUS hashTblDelete    (    HASH_ID hashId              /* id of hash table to delete */    )    {    return (hashTblDestroy (hashId, TRUE));	/* delete the hash table */    }/********************************************************************************* hashTblTerminate - terminate a hash table** This routine terminates the specified hash table.  The hash table is marked* as invalid.** RETURNS: OK, or ERROR if hashId is invalid.*/STATUS hashTblTerminate    (    HASH_ID hashId              /* id of hash table to terminate */    )    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩久久| 成人一区二区在线观看| 欧美激情在线看| 精品99999| 制服丝袜中文字幕亚洲| 欧美在线观看一二区| 91免费国产在线观看| 色美美综合视频| 欧美人牲a欧美精品| 在线播放一区二区三区| 欧美一区二区女人| 精品国内二区三区| 丝袜诱惑制服诱惑色一区在线观看 | 亚洲婷婷综合久久一本伊一区| 国产欧美一区二区三区网站| 国产日韩影视精品| 日韩av电影免费观看高清完整版| 亚洲电影欧美电影有声小说| 亚洲国产毛片aaaaa无费看| 五月激情六月综合| 狠狠久久亚洲欧美| 热久久国产精品| 国产麻豆成人精品| 国产乱码精品一区二区三区忘忧草 | www.欧美色图| 色噜噜狠狠成人中文综合| 久久久国产精品不卡| 国产日韩在线不卡| 国产成人在线色| 91视频观看免费| 国产精品久久久久久久久搜平片| 亚洲成人一区在线| 日本韩国欧美一区二区三区| 亚洲天堂久久久久久久| 欧美精品一区在线观看| 亚洲国产中文字幕| 欧美体内she精高潮| 91精品婷婷国产综合久久竹菊| 亚洲综合激情网| 激情图片小说一区| 精品少妇一区二区三区在线播放 | 久久在线观看免费| 亚洲男人都懂的| 色香蕉成人二区免费| 日韩欧美电影一二三| 亚洲最新视频在线播放| 国产酒店精品激情| 国产精品久久久久天堂| 91免费看`日韩一区二区| 一区二区三区欧美日| 欧美日韩黄色一区二区| 日本不卡在线视频| 久久久不卡影院| 99精品国产99久久久久久白柏| 日韩网站在线看片你懂的| 一区二区三区欧美| 777奇米四色成人影色区| 久久精品久久久精品美女| 91国偷自产一区二区使用方法| 亚洲成人精品在线观看| 日韩欧美一区二区视频| 成人综合激情网| 亚洲国产视频一区| 久久亚洲精华国产精华液 | 青青草91视频| 国产日韩一级二级三级| 在线看日韩精品电影| 秋霞影院一区二区| 国产精品美女久久久久久 | 亚洲福利一二三区| 成人深夜在线观看| 亚洲一区视频在线观看视频| 欧美成人国产一区二区| av动漫一区二区| 麻豆精品在线播放| 欧美中文字幕一区| 国产在线一区二区| 亚洲福利视频三区| 中文字幕中文乱码欧美一区二区| 欧美日韩一区二区三区四区五区| 专区另类欧美日韩| 欧美大黄免费观看| 在线日韩一区二区| 国产成人亚洲综合a∨婷婷| 亚洲一二三四在线观看| 国产丝袜欧美中文另类| 成人激情免费电影网址| 亚洲视频在线一区观看| 久久久一区二区| 5566中文字幕一区二区电影| av电影在线观看不卡| 国产精品久久久久久久第一福利| 欧美一区二区视频网站| 91久久精品国产91性色tv| 国产精品66部| 久久99国产精品久久99 | 粉嫩aⅴ一区二区三区四区| 久久精品亚洲乱码伦伦中文| 欧美日韩电影在线播放| 91麻豆精东视频| 成人午夜又粗又硬又大| 精品一区二区三区视频在线观看| 午夜免费久久看| 一区二区三区欧美久久| 亚洲精品国产无天堂网2021| 91麻豆精品91久久久久同性| 在线视频亚洲一区| 91蜜桃婷婷狠狠久久综合9色| 国产99久久久国产精品潘金网站| 精品一区二区精品| 九九视频精品免费| 另类中文字幕网| 蜜臀精品久久久久久蜜臀| 日日夜夜精品免费视频| 亚洲gay无套男同| 天天做天天摸天天爽国产一区| 亚洲综合成人网| 午夜久久久久久| 石原莉奈在线亚洲二区| 日韩二区三区四区| 久久精品国产久精国产爱| 韩国一区二区三区| 国产精品一色哟哟哟| 国产经典欧美精品| 99久久精品国产毛片| 91免费观看视频在线| 欧美天堂亚洲电影院在线播放| 欧美日韩免费电影| 日韩精品一区二区三区在线| 久久欧美一区二区| 国产精品免费视频一区| 亚洲女同一区二区| 午夜欧美在线一二页| 久久99久久精品| 菠萝蜜视频在线观看一区| 色狠狠色狠狠综合| 91精品欧美综合在线观看最新| 精品剧情在线观看| 亚洲欧美中日韩| 国产欧美精品在线观看| 中文字幕佐山爱一区二区免费| 夜夜揉揉日日人人青青一国产精品| 五月激情综合网| 国产精品1区2区3区在线观看| 成人黄色电影在线| 欧美精品99久久久**| 久久久久久久电影| 亚洲综合一区二区| 蜜臀a∨国产成人精品| 国产精品一二三区| 成人av中文字幕| 欧美亚洲综合色| 日韩欧美国产综合| 国产精品女主播av| 日韩电影一二三区| 成人午夜碰碰视频| 制服丝袜成人动漫| 中文字幕一区二区三区av| 日韩高清一级片| 一本色道亚洲精品aⅴ| 日韩免费看的电影| 一区二区三国产精华液| 国产乱子伦一区二区三区国色天香| 色婷婷久久久综合中文字幕| 欧美激情一区在线| 日韩精品成人一区二区在线| 99久精品国产| 久久在线观看免费| 日韩成人av影视| 色8久久精品久久久久久蜜 | 香蕉av福利精品导航| 国产一区二区伦理| 欧美男同性恋视频网站| 国产精品国产三级国产| 麻豆国产欧美一区二区三区| 色噜噜偷拍精品综合在线| 久久精品男人的天堂| 丝袜亚洲另类丝袜在线| 色屁屁一区二区| 中文字幕不卡在线播放| 激情伊人五月天久久综合| 欧美日韩色一区| 一区二区在线电影| 成人aa视频在线观看| 久久婷婷色综合| 久久91精品久久久久久秒播| 在线播放视频一区| 亚洲bt欧美bt精品| 欧美日免费三级在线| 亚洲欧美日韩国产手机在线| 成人中文字幕合集| 久久夜色精品国产欧美乱极品| 日本不卡一区二区| 欧美日韩不卡在线| 亚洲一区二区精品3399| 欧亚一区二区三区| 亚洲国产精品久久久久婷婷884| 色香蕉成人二区免费| 亚洲精品乱码久久久久| 色综合天天综合网国产成人综合天|