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

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

?? qpribmaplib.c

?? vxworks的完整的源代碼
?? C
字號:
/* qPriBMapLib.c - bit mapped priority queue management library *//* Copyright 1984-1998 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02o,16nov98,cdp  make ARM CPUs with ARM_THUMB==TRUE use portable routines.02m,06jan98,cym  added simnt support02n,22apr97,jpd  removed ARM from PORTABLE list.02m,29jan97,elp  added ARM support02l,12jul95,ism  added simsolaris support02l,04nov94,yao  added PPC support.02k,11aug93,gae  vxsim hppa from rrr.02j,12jun93,rrr  vxsim.02i,27jul92,jcf  all architectures now utilize this library.                 added nPriority selection for memory conservation.02h,19jul92,pme  made qPriBMapRemove return STATUS.02g,18jul92,smb  Changed errno.h to errnoLib.h02f,26may92,rrr  the tree shuffle02e,22apr92,jwt  converted CPU==SPARC to CPU_FAMILY==SPARC; copyright.02d,19nov91,rrr  shut up some ansi warnings.02c,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -fixed #else and #endif		  -changed TINY and UTINY to INT8 and UINT8		  -changed VOID to void		  -changed copyright notice02b,25mar91,del  added I960 to portable checklist.02a,10jan91,jcf  changed BMAP_LIST for portability to other architectures.01e,20dec90,gae  added declaration of qPriBMapSet and qPriBMapClear.01d,28sep90,jcf	 documentation.01c,05jul90,jcf	 added null routine for calibrateRtn field in Q_CLASS.01b,10may90,jcf	 fixed PORTABLE definition.		 changed ffs () to ffsMsb ().01a,14jun89,jcf	 written.*//*DESCRIPTIONThis library contains routines to manage a priority queue.  The queue ismaintained in priority order with no sorting time, so its performance isconstant.  Its restrictions are that it requires a 2K byte bit map, and itcan only prioritize nodes with keys in the range 0 to 255.This queue complies with the multi-way queue data structures and thus may beutilized by any multi-way queue.  The priority bit mapped multi-way queueclass is accessed by the global id qPriBMapClassId.SEE ALSO: qLib()*/#include "vxWorks.h"#include "qClass.h"#include "qPriBMapLib.h"#include "memLib.h"#include "errnoLib.h"#include "string.h"#include "stdlib.h"#if (defined(PORTABLE) || \     (CPU_FAMILY == SIMNT) || (CPU_FAMILY == SPARC) || (CPU_FAMILY == I960) || \     (CPU_FAMILY == SIMSPARCSUNOS) || (CPU_FAMILY == SIMHPPA) || \     (CPU_FAMILY == SIMSPARCSOLARIS) || ((CPU_FAMILY == ARM) && ARM_THUMB))#define qPriBMapLib_PORTABLE#endif#if     (CPU_FAMILY == PPC)#define qPriBMapLib_PORTABLE#endif  /* (CPU_FAMILY == PPC) */#if	defined(PORTABLE)#define qPriBMapLib_PORTABLE#endif	/* PORTABLE *//* forward static functions */static STATUS qPriBMapNullRtn (void);#ifdef qPriBMapLib_PORTABLEstatic void qPriBMapSet (BMAP_LIST *pBMapList, int priority);static void qPriBMapClear (BMAP_LIST *pBMapList, int priority);static int qPriBMapHigh (BMAP_LIST *pBMapList);#endif	/* qPriBMapLib_PORTABLE *//* locals */LOCAL Q_CLASS qPriBMapClass =    {    (FUNCPTR)qPriBMapCreate,    (FUNCPTR)qPriBMapInit,    (FUNCPTR)qPriBMapDelete,    (FUNCPTR)qPriBMapNullRtn,    (FUNCPTR)qPriBMapPut,    (FUNCPTR)qPriBMapGet,    (FUNCPTR)qPriBMapRemove,    (FUNCPTR)qPriBMapResort,    (FUNCPTR)qPriBMapNullRtn,    (FUNCPTR)qPriBMapNullRtn,    (FUNCPTR)qPriBMapKey,    (FUNCPTR)qPriBMapNullRtn,    (FUNCPTR)qPriBMapInfo,    (FUNCPTR)qPriBMapEach,    &qPriBMapClass    };/* globals */Q_CLASS_ID qPriBMapClassId = &qPriBMapClass;/******************************************************************************** qPriBMapListCreate - create and initialized a bit mapped priority queue** Create a bit mapped priority queue.  Initialize the specified queue header.** RETURNS: OK or ERROR if not enough memory to create queue.** SEE ALSO: qPriBMapInit().*/BMAP_LIST *qPriBMapListCreate     (    UINT nPriority	/* 1 priority to 256 priorities */    )    {    UINT size;    if ((nPriority < 1) || (nPriority > 256))	return (NULL);        size = sizeof (BMAP_LIST) - (sizeof (DL_LIST) * (256 - nPriority));    return ((BMAP_LIST *) malloc (size));    }/******************************************************************************** qPriBMapListDelete - deallocate a bit mapped list** This routine returns an allocated BMAP_LIST to the free memory pool.** RETURNS: OK, or ERROR if bit mapped list could not be deallocated.*/STATUS qPriBMapListDelete    (    BMAP_LIST *pBMapList    )    {    free ((char *)pBMapList);    return (OK);    }/******************************************************************************** qPriBMapCreate - create and initialized a bit mapped priority queue** Create a bit mapped priority queue.  Initialize the specified queue header.** RETURNS: OK, or ERROR if not enough memory to create queue.** SEE ALSO: qPriBMapInit()*/Q_PRI_BMAP_HEAD *qPriBMapCreate    (    BMAP_LIST *	pBMapList,    UINT	nPriority	/* 1 priority to 256 priorities */    )    {    Q_PRI_BMAP_HEAD *pQPriBMapHead;    if ((nPriority < 1) || (nPriority > 256))	return (NULL);    pQPriBMapHead = (Q_PRI_BMAP_HEAD *) malloc (sizeof (Q_PRI_BMAP_HEAD));    if (pQPriBMapHead == NULL)	return (NULL);    if (qPriBMapInit (pQPriBMapHead, pBMapList, nPriority) != OK)	{	free ((char *)pQPriBMapHead);	return (NULL);	}    return (pQPriBMapHead);    }/******************************************************************************** qPriBMapInit - initialize a bit mapped priority queue** Initialize the bit mapped priority queue pointed to by the specified queue* header.** RETURNS: OK or ERROR** ERRNO: S_qPriBMapLib_NULL_BMAP_LIST**/STATUS qPriBMapInit    (    Q_PRI_BMAP_HEAD *	pQPriBMapHead,    BMAP_LIST *		pBMapList,    UINT		nPriority	/* 1 priority to 256 priorities */    )    {    FAST int ix;    if ((nPriority < 1) || (nPriority > 256))	return (ERROR);    if (pBMapList == NULL)	{	errnoSet (S_qPriBMapLib_NULL_BMAP_LIST);	return (ERROR);	}    pQPriBMapHead->pBMapList = pBMapList;	/* store bmap list pointer */    /* initialize the q */    for (ix = 0; ix < nPriority; ++ix)	dllInit (&pBMapList->listArray[ix]);    pQPriBMapHead->highNode	= NULL;		/* zero the highest node */    pQPriBMapHead->nPriority	= nPriority;	/* higest legal priority */    /* zero the bit maps */    pBMapList->metaBMap = 0;    bzero ((char *) pBMapList->bMap, sizeof (pBMapList->bMap));    return (OK);    }/******************************************************************************** qPriBMapDelete - deallocate a bit mapped queue head** This routine deallocates a bit mapped queue head.  All queued nodes will* be lost.** RETURNS: OK, or ERROR in bit mapped queue head could not be deallocated.*/STATUS qPriBMapDelete    (    Q_PRI_BMAP_HEAD *pQPriBMapHead    )    {    free ((char *)pQPriBMapHead);    return (OK);    }#ifdef qPriBMapLib_PORTABLE/********************************************************************************* qPriBMapPut - insert a node into a priority bit mapped queue** This routine inserts a node into a priority bit mapped queue.  The insertion* is based on the specified priority key which is constrained to the range* 0 to 255.  The highest priority is zero.*/void qPriBMapPut    (    Q_PRI_BMAP_HEAD     *pQPriBMapHead,    Q_PRI_NODE          *pQPriNode,    ULONG                key    )    {    pQPriNode->key = key;    if ((pQPriBMapHead->highNode == NULL) ||        (key < pQPriBMapHead->highNode->key))	{	pQPriBMapHead->highNode = pQPriNode;	}    qPriBMapSet (pQPriBMapHead->pBMapList, key);    dllAdd (&pQPriBMapHead->pBMapList->listArray[key], &pQPriNode->node);    }/********************************************************************************* qPriBMapGet - remove and return first node in priority bit-mapped queue** This routine removes and returns the first node in a priority bit-mapped* queue.  If the queue is empty, NULL is returned.** RETURNS Pointer to first queue node in queue head, or NULL if queue is empty.*/Q_PRI_NODE *qPriBMapGet    (    Q_PRI_BMAP_HEAD *pQPriBMapHead    )    {    Q_PRI_NODE *pQPriNode = pQPriBMapHead->highNode;    if (pQPriNode != NULL)	qPriBMapRemove (pQPriBMapHead, pQPriNode);    return (pQPriNode);    }/********************************************************************************* qPriBMapRemove - remove a node from a priority bit mapped queue** This routine removes a node from the specified bit mapped queue.*/STATUS qPriBMapRemove    (    Q_PRI_BMAP_HEAD *pQPriBMapHead,    Q_PRI_NODE *pQPriNode    )    {    dllRemove (&pQPriBMapHead->pBMapList->listArray[pQPriNode->key],	       &pQPriNode->node);    if (DLL_EMPTY (&pQPriBMapHead->pBMapList->listArray[pQPriNode->key]))        {	qPriBMapClear (pQPriBMapHead->pBMapList, pQPriNode->key);	if (pQPriNode == pQPriBMapHead->highNode)	    pQPriBMapHead->highNode =	      (Q_PRI_NODE *) DLL_FIRST(&pQPriBMapHead->pBMapList->	      listArray[qPriBMapHigh(pQPriBMapHead->pBMapList)]);	}    else if (pQPriNode == pQPriBMapHead->highNode)	pQPriBMapHead->highNode =	  (Q_PRI_NODE *) DLL_FIRST (&pQPriBMapHead->pBMapList->	  listArray[pQPriBMapHead->highNode->key]);    return (OK);    }#endif	/* qPriBMapLib_PORTABLE *//********************************************************************************* qPriBMapResort - resort a node to a new position based on a new key** This routine resorts a node to a new position based on a new priority key.*/void qPriBMapResort    (    Q_PRI_BMAP_HEAD *pQPriBMapHead,    Q_PRI_NODE      *pQPriNode,    ULONG            newKey    )    {    if (pQPriNode->key != newKey)	{	qPriBMapRemove (pQPriBMapHead, pQPriNode);	qPriBMapPut (pQPriBMapHead, pQPriNode, newKey);	}    }/********************************************************************************* qPriBMapKey - return the key of a node** This routine returns the key of a node currently in a multi-way queue.  The* keyType is ignored.** RETURNS: Node's key.** ARGSUSED*/ULONG qPriBMapKey    (    Q_PRI_NODE  *pQPriNode      /* node to get key for */    )    {    return (pQPriNode->key);	/* return key */    }/********************************************************************************* qPriBMapInfo - gather information on a bit mapped queue** This routine fills up to maxNodes elements of a nodeArray with nodes* currently in a multi-way queue.  The actual number of nodes copied to the* array is returned.  If the nodeArray is NULL, then the number of nodes in* the multi-way queue is returned.** RETURNS: Number of node pointers copied into the nodeArray, or number of*	   nodes in bit mapped queue if nodeArray is NULL*/int qPriBMapInfo    (    Q_PRI_BMAP_HEAD *pQPriBMapHead,     /* bmap q to gather list for */    FAST int nodeArray[],               /* array of node pointers for filling */    FAST int maxNodes                   /* max node pointers for nodeArray */    )    {    FAST Q_PRI_NODE *pNode;    FAST int *pElement = nodeArray;    FAST int ix;    int count = 0;    if (nodeArray == NULL)	{	for (ix = 0; ix < pQPriBMapHead->nPriority; ++ix)	    count += dllCount (&pQPriBMapHead->pBMapList->listArray[ix]);	return (count);	}    for (ix = 0; ix < pQPriBMapHead->nPriority; ++ix) /* search the array */	{	pNode=(Q_PRI_NODE *)DLL_FIRST(&pQPriBMapHead->pBMapList->listArray[ix]);	while ((pNode != NULL) && (--maxNodes >= 0))	/* anybody left? */	    {	    *(pElement++) = (int)pNode;			/* fill in table */	    pNode = (Q_PRI_NODE *) DLL_NEXT (&pNode->node);  /* next node */	    }	if (maxNodes < 0)		/* out of room? */	    break;	}    return (pElement - nodeArray);	/* return count of active tasks */    }/********************************************************************************* qPriBMapEach - call a routine for each node in a queue** This routine calls a user-supplied routine once for each node in the* queue.  The routine should be declared as follows:* .CS*  BOOL routine (pQNode, arg)*      Q_PRI_NODE *pQNode;	/@ pointer to a queue node          @/*      int	   arg;		/@ arbitrary user-supplied argument @/* .CE* The user-supplied routine should return TRUE if qPriBMapEach() is to* continue calling it for each entry, or FALSE if it is done and* qPriBMapEach() can exit.** RETURNS: NULL if traversed whole queue, or pointer to Q_PRI_NODE that*          qPriBMapEach stopped on.*/Q_PRI_NODE *qPriBMapEach    (    Q_PRI_BMAP_HEAD *pQHead,     /* queue head of queue to call routine for */    FUNCPTR          routine,    /* the routine to call for each table entry */    int              routineArg  /* arbitrary user-supplied argument */    )    {    FAST int	     ix;    FAST Q_PRI_NODE *pNode = NULL;    for (ix = 0; ix < pQHead->nPriority; ++ix)	/* search array */	{	pNode = (Q_PRI_NODE *)		DLL_FIRST (&pQHead->pBMapList->listArray[ix]);	while (pNode != NULL)	    {	    if (!((* routine) (pNode, routineArg)))		goto done;				/* bail out */	    pNode = (Q_PRI_NODE *) DLL_NEXT (&pNode->node);	    }	}done:    return (pNode);			/* return node we ended with */    }/********************************************************************************* qPriBMapNullRtn - null routine returns OK** This routine does nothing and returns OK.  It is used by the queue class* structure for operations not supported by this queue type.*/LOCAL STATUS qPriBMapNullRtn (void)    {    return (OK);    }#ifdef qPriBMapLib_PORTABLE/********************************************************************************* qPriBMapSet - set the bits in the bit map for the specified priority** This routine sets the bits in the bit map to reflect the addition of a node* of the specified priority.*/LOCAL void qPriBMapSet    (    BMAP_LIST *pBMapList,    int priority    )    {    priority = 255 - priority;    pBMapList->metaBMap			|= (1 << (priority >> 3));    pBMapList->bMap [priority >> 3]	|= (1 << (priority & 0x7));    }/********************************************************************************* qPriBMapClear - clear the bits in the bit map for the specified priority** This routine clears the bits in the bit map to reflect the removal of a node* of the specified priority.*/LOCAL void qPriBMapClear    (    BMAP_LIST *pBMapList,    int priority    )    {    priority = 255 - priority;    pBMapList->bMap [priority >> 3] &= ~(1 << (priority & 0x7));    if (pBMapList->bMap [priority >> 3] == 0)	pBMapList->metaBMap &= ~(1 << (priority >> 3));    }/********************************************************************************* qPriBMapHigh - return highest priority in ready queue** This routine utilizes the bit map structure to determine the highest active* priority group.** RETURNS: Priority of highest active priority group.*/LOCAL int qPriBMapHigh    (    BMAP_LIST *pBMapList    )	{	UINT8 highBits = (UINT8) ffsMsb ((int)pBMapList->metaBMap) - 1;	UINT8 lowBits  = (UINT8) ffsMsb ((int)pBMapList->bMap[highBits]) - 1;	return (255 - (((highBits << 3) | lowBits) & 0xff));	}#endif	/* qPriBMapLib_PORTABLE */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人性视频免费网站| 日韩国产欧美一区二区三区| 成人午夜视频在线观看| 久久色在线观看| 国产一区二区在线观看免费| 亚洲精品一区二区三区99| 狠狠色2019综合网| 欧美激情资源网| 91亚洲精品一区二区乱码| 亚洲精品你懂的| 欧美精品一级二级三级| 美美哒免费高清在线观看视频一区二区 | 欧美日韩在线不卡| 日韩av在线播放中文字幕| 欧美mv日韩mv| 不卡视频一二三四| 亚洲国产中文字幕| 2023国产一二三区日本精品2022| 国产成人精品一区二| 亚洲人成精品久久久久久| 欧美色精品天天在线观看视频| 欧美aaa在线| 欧美极品另类videosde| 欧美午夜免费电影| 韩国三级在线一区| 亚洲精品五月天| 日韩欧美一区中文| 国产999精品久久久久久绿帽| 亚洲免费在线视频一区 二区| 在线综合亚洲欧美在线视频| 国产精品自拍在线| 亚洲国产一区二区在线播放| 26uuu国产电影一区二区| 色一情一乱一乱一91av| 蜜桃av一区二区| 综合欧美一区二区三区| 日韩欧美二区三区| 一本色道**综合亚洲精品蜜桃冫| 美女看a上一区| 亚洲精品高清在线| 久久久精品黄色| 欧美巨大另类极品videosbest | 欧美精品亚洲二区| 99综合电影在线视频| 另类综合日韩欧美亚洲| 亚洲人123区| 国产亚洲成aⅴ人片在线观看| 欧美片网站yy| 91亚洲大成网污www| 国产美女一区二区| 日本一不卡视频| 一区二区激情视频| 国产精品福利一区二区| 精品国产一区二区三区忘忧草 | 91精品国产综合久久精品性色| 成人app下载| 国产乱码精品一区二区三区五月婷| 亚洲制服丝袜一区| 中文字幕一区在线| 国产亚洲欧美一区在线观看| 91麻豆精品国产自产在线观看一区 | 欧美主播一区二区三区美女| 春色校园综合激情亚洲| 精品一区二区在线视频| 日韩在线a电影| 亚洲自拍都市欧美小说| 亚洲综合一区二区精品导航| 亚洲私人影院在线观看| 国产精品欧美久久久久无广告| 久久综合色8888| 精品福利一区二区三区| 日韩一级片在线播放| 欧美另类videos死尸| 91精品国产综合久久久久久久久久| 欧美日韩精品一区二区三区| 欧美性生活久久| 欧美视频一区二区在线观看| 欧美性受xxxx| 91精品国产欧美一区二区18| 欧美精品久久天天躁| 911国产精品| 欧美一区二区三区四区五区| 欧美一区二区三区在线视频| 日韩亚洲欧美在线观看| 日韩一区二区精品| 亚洲精品一区二区在线观看| 波多野结衣视频一区| 成人免费观看男女羞羞视频| 久久精品国内一区二区三区 | 国产精品视频一二三| 久久这里只有精品6| 精品999在线播放| 国产午夜三级一区二区三| 久久久亚洲国产美女国产盗摄 | www.成人网.com| 99久久久国产精品免费蜜臀| 色综合天天综合网天天狠天天| 国产91精品入口| 懂色av一区二区三区免费观看| 国产福利精品导航| 国产91丝袜在线18| 不卡一区二区在线| av欧美精品.com| 在线观看日韩一区| 欧美日韩一卡二卡三卡 | 日韩一区二区视频| 精品国产区一区| 日韩一区二区高清| 国产精品美女久久久久久久 | 99国内精品久久| 欧美在线一区二区| 在线成人高清不卡| 日本一区二区三区dvd视频在线| 国产三级一区二区| 中文字幕日韩av资源站| 亚洲激情校园春色| 天天免费综合色| 久久精品噜噜噜成人av农村| 国产九九视频一区二区三区| 成人av影视在线观看| 色婷婷av一区二区| 日韩一区二区三区观看| 久久久久久久久久久久久久久99 | 青青草原综合久久大伊人精品| 黑人精品欧美一区二区蜜桃| 成人午夜av在线| 欧美日韩免费观看一区三区| 欧美老女人在线| 亚洲日本护士毛茸茸| 视频一区二区三区中文字幕| 国内精品嫩模私拍在线| eeuss鲁片一区二区三区| 欧美日韩国产bt| 久久影院电视剧免费观看| 国产精品三级av在线播放| 亚洲国产日韩精品| 国产精品一二三在| 欧美午夜精品理论片a级按摩| 精品国产区一区| 亚洲欧美日韩系列| 国产99一区视频免费| 在线观看91av| 亚洲色欲色欲www| 经典三级视频一区| 欧洲生活片亚洲生活在线观看| 欧美一区二区三区啪啪| 亚洲欧美在线高清| 麻豆91在线观看| 欧美在线观看18| 国产区在线观看成人精品| 视频在线观看国产精品| 粉嫩一区二区三区在线看| 日本高清成人免费播放| 中文字幕一区二区三区四区不卡| 免费成人深夜小野草| 日本精品一区二区三区四区的功能| 久久久影视传媒| 日韩av在线播放中文字幕| 91在线精品一区二区| 国产精品美女久久久久aⅴ| 久久精品久久精品| 欧美日本在线一区| 亚洲黄色小说网站| 成人成人成人在线视频| 中文字幕在线观看一区二区| 紧缚奴在线一区二区三区| 91精品婷婷国产综合久久性色| 亚洲欧美日韩久久精品| 国产精品69毛片高清亚洲| 日韩一区二区麻豆国产| 丝袜美腿亚洲色图| 欧美三级日韩在线| 亚洲男帅同性gay1069| 成人精品国产福利| 欧美精品一区二区三区蜜臀| 国产一区二区毛片| 精品少妇一区二区三区在线播放| 亚洲gay无套男同| 欧美视频自拍偷拍| 亚洲成a人v欧美综合天堂下载 | 欧美日韩精品免费观看视频| 亚洲精品午夜久久久| 色94色欧美sute亚洲线路一ni| 亚洲品质自拍视频| 色94色欧美sute亚洲13| 亚洲黄一区二区三区| 在线视频一区二区三| 亚洲成人av电影在线| 欧美精品久久久久久久多人混战| 亚洲福利一区二区三区| 日韩欧美国产一二三区| 极品销魂美女一区二区三区| 欧美大黄免费观看| 经典三级视频一区| 欧美成人精品福利| 99久精品国产| 夜夜揉揉日日人人青青一国产精品| 色偷偷久久人人79超碰人人澡| 亚洲一二三区在线观看| 日韩精品资源二区在线|