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

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

?? qprideltalib.c

?? vxworks5.5.1源代碼。完整源代碼
?? C
字號:
/* qPriDeltaLib.c - priority queue with relative priority sorting library *//* Copyright 1984-1992 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01h,19jul92,pme  made qPriDeltaRemove return STATUS.01g,26may92,rrr  the tree shuffle01f,19nov91,rrr  shut up some ansi warnings.01e,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed VOID to void		  -changed copyright notice01d,28sep90,jcf	 documentation.01c,05jul90,jcf	 added null routine for calibrateRtn field in Q_CLASS.01b,26jun90,jcf	 fixed queue class definition.01a,14jun89,jcf	 written.*//*DESCRIPTIONThis library contains routines to manage a priority queue.  The queue ismaintained in priority order with each node key a priority delta to the nodeahead of it.  This queue performs a qPriDeltaPut() operation preportional intime with number of nodes in the queue.  This queue is used for timer queues.This queue complies with the multi-way queue data structures and thus may beutilized by any multi-way queue.  The priority delta multi-way queueclass is accessed by the global id qPriDeltaClassId.SEE ALSO: qLib.*/#include "vxWorks.h"#include "qClass.h"#include "qPriDeltaLib.h"#include "stdlib.h"IMPORT ULONG vxTicks;		/* current time in ticks *//* forward static functions */static STATUS qPriDeltaNullRtn (void);/* locals */LOCAL Q_CLASS qPriDeltaClass =    {    (FUNCPTR)qPriDeltaCreate,    (FUNCPTR)qPriDeltaInit,    (FUNCPTR)qPriDeltaDelete,    (FUNCPTR)qPriDeltaTerminate,    (FUNCPTR)qPriDeltaPut,    (FUNCPTR)qPriDeltaGet,    (FUNCPTR)qPriDeltaRemove,    (FUNCPTR)qPriDeltaResort,    (FUNCPTR)qPriDeltaAdvance,    (FUNCPTR)qPriDeltaGetExpired,    (FUNCPTR)qPriDeltaKey,    (FUNCPTR)qPriDeltaNullRtn,    (FUNCPTR)qPriDeltaInfo,    (FUNCPTR)qPriDeltaEach,    &qPriDeltaClass    };/* globals */Q_CLASS_ID qPriDeltaClassId = &qPriDeltaClass;/******************************************************************************** qPriDeltaCreate - allocate and initialize a priority delta queue** This routine allocates and initializes a priority delta queue by allocating* a Q_PRI_HEAD structure from the free memory pool.** RETURNS:*  Pointer to a Q_PRI_HEAD, or*  NULL if out of memory.*/Q_PRI_HEAD *qPriDeltaCreate (void)    {    Q_PRI_HEAD *pQPriHead = (Q_PRI_HEAD *) malloc (sizeof (Q_PRI_HEAD));    if (pQPriHead == NULL)	return (NULL);    qPriDeltaInit (pQPriHead);    return (pQPriHead);    }/******************************************************************************** qPriDeltaInit - initialize a priority delta queue** This routine initializes the specified priority delta queue.*/STATUS qPriDeltaInit    (    Q_PRI_HEAD *pQPriHead    )    {    dllInit (pQPriHead);	 /* initialize doubly linked list */    return (OK);    }/******************************************************************************** qPriDeltaDelete - delete a priority delta queue** This routine deallocates memory associated with the queue.  All queued* nodes are lost.** RETURNS:*  OK, or*  ERROR if memory cannot be deallocated.*/STATUS qPriDeltaDelete    (    Q_PRI_HEAD *pQPriHead    )    {    free ((char *) pQPriHead);    return OK;    }/******************************************************************************** qPriDeltaTerminate - terminate a priority delta queue** This routine terminates a priority delta queue.  All queued nodes are lost.** ARGSUSED*/STATUS qPriDeltaTerminate    (    Q_PRI_HEAD *pQPriHead    )    {    return (OK);    }/********************************************************************************* qPriDeltaPut - insert a node into a priority delta queue** This routine inserts a node into a priority delta queue.  The insertion is* based on the priority key.  Lower key values are higher in priority.*/void qPriDeltaPut    (    Q_PRI_HEAD  *pQPriHead,    Q_PRI_NODE  *pQPriNode,    ULONG       key    )    {    FAST Q_PRI_NODE *pQNode = (Q_PRI_NODE *) DLL_FIRST (pQPriHead);    pQPriNode->key = key - vxTicks;	/* relative queue keeps delta time */    while (pQNode != NULL)		/* empty list? */        {	if (pQPriNode->key < pQNode->key)	    {	    /* We've reached the place in the delta queue to insert this task */	    dllInsert (pQPriHead, DLL_PREVIOUS (&pQNode->node),		       &pQPriNode->node);	    /* Now decrement the delta key of the guy behind us. */	    pQNode->key -= pQPriNode->key;	    return;				/* we're done */	    }	pQPriNode->key -= pQNode->key;	pQNode = (Q_PRI_NODE *) DLL_NEXT (&pQNode->node);	}    /* if we fall through, add to end of delta q */    dllInsert (pQPriHead, (DL_NODE *) DLL_LAST (pQPriHead), &pQPriNode->node);    }/********************************************************************************* qPriDeltaGet - remove and return first node in priority delta queue** This routine removes and returns the first node in a priority delta 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 *qPriDeltaGet    (    Q_PRI_HEAD *pQPriHead    )    {    if (DLL_EMPTY (pQPriHead))	return (NULL);    return ((Q_PRI_NODE *) dllGet (pQPriHead));    }/********************************************************************************* qPriDeltaRemove - remove a node from a priority delta queue** This routine removes a node from the specified priority delta queue.*/STATUS qPriDeltaRemove    (    Q_PRI_HEAD *pQPriHead,    Q_PRI_NODE *pQPriNode    )    {    Q_PRI_NODE *pNextNode = (Q_PRI_NODE *) DLL_NEXT (&pQPriNode->node);    if (pNextNode != NULL)	pNextNode->key += pQPriNode->key; /* add key to next node */    dllRemove (pQPriHead, &pQPriNode->node);    return (OK);    }/********************************************************************************* qPriDeltaResort - 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 qPriDeltaResort    (    Q_PRI_HEAD *pQPriHead,    Q_PRI_NODE *pQPriNode,    ULONG       newKey    )    {    qPriDeltaRemove (pQPriHead, pQPriNode);    qPriDeltaPut (pQPriHead, pQPriNode, newKey);    }/********************************************************************************* qPriDeltaAdvance - advance a queues concept of time** Priority delta queues keep nodes prioritized by time-to-fire.  The library* utilizes this routine to advance time.  It is usually called from within a* clock-tick interrupt service routine.*/void qPriDeltaAdvance    (    Q_PRI_HEAD *pQPriHead    )    {    FAST Q_PRI_NODE *pQPriNode = (Q_PRI_NODE *) DLL_FIRST (pQPriHead);    if (pQPriNode != NULL)	pQPriNode->key --;    }/********************************************************************************* qPriDeltaGetExpired - return a time-to-fire expired node** This routine returns a time-to-fire expired node in a priority delta timer* queue.  Expired nodes result from a qPriDeltaAdvance(2) advancing a node* beyond its delay.  As many nodes may expire on a single qPriDeltaAdvance(2),* this routine should be called within a while loop until NULL is returned.* NULL is returned when there are no expired nodes.** RETURNS*  Pointer to first queue node in queue head, or*  NULL if queue is empty.*/Q_PRI_NODE *qPriDeltaGetExpired    (    Q_PRI_HEAD *pQPriHead    )    {    FAST Q_PRI_NODE *pQPriNode = (Q_PRI_NODE *) DLL_FIRST (pQPriHead);    if (pQPriNode != NULL)	{	if (pQPriNode->key != 0)	    pQPriNode = NULL;	else	    qPriDeltaRemove (pQPriHead, pQPriNode);	/* get off delay list */	}    return (pQPriNode);    }/********************************************************************************* qPriDeltaKey - return the key of a node** This routine returns the key of a node currently in a priority delta queue.** RETURNS*  Node's key.** ARGSUSED*/ULONG qPriDeltaKey    (    Q_PRI_NODE  *pQPriNode      /* node to get key for */    )    {    FAST ULONG sum = 0;    while (pQPriNode != NULL)        {	sum += pQPriNode->key;	pQPriNode = (Q_PRI_NODE *) DLL_PREVIOUS (&pQPriNode->node);	}    return (sum);	/* return key */    }/********************************************************************************* qPriDeltaInfo - gather information on a priority delta 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 priority delta queue is returned.** RETURNS*  Number of node pointers copied into the nodeArray, or*  Number of nodes in multi-way queue if nodeArray is NULL*/int qPriDeltaInfo    (    Q_PRI_HEAD *pQPriHead,      /* priority queue to gather list for */    FAST int nodeArray[],       /* array of node pointers to be filled in */    FAST int maxNodes           /* max node pointers nodeArray can accomodate */    )    {    FAST Q_PRI_NODE *pQNode = (Q_PRI_NODE *) DLL_FIRST (pQPriHead);    FAST int *pElement  = nodeArray;    if (nodeArray == NULL)		/* NULL node array means return count */	return (dllCount (pQPriHead));    while ((pQNode != NULL) && (--maxNodes >= 0))	{	*(pElement++) = (int)pQNode;			/* fill in table */	pQNode = (Q_PRI_NODE *) DLL_NEXT (&pQNode->node);	/* next node */	}    return (pElement - nodeArray);	/* return count of active tasks */    }/********************************************************************************* qPriDeltaEach - 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 qPriDeltaEach (2) is to* continue calling it for each entry, or FALSE if it is done and* qPriDeltaEach can exit.** RETURNS: NULL if traversed whole queue, or pointer to Q_PRI_NODE that*          qPriDeltaEach stopped on.*/Q_PRI_NODE *qPriDeltaEach    (    Q_PRI_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 Q_PRI_NODE *pQNode = (Q_PRI_NODE *) DLL_FIRST (pQHead);    while ((pQNode != NULL) && ((* routine) (pQNode, routineArg)))	pQNode = (Q_PRI_NODE *) DLL_NEXT (&pQNode->node);    return (pQNode);			/* return node we ended with */    }/********************************************************************************* qPriDeltaNullRtn - nop that returns OK** This routine does nothing and returns OK.  It is used to by the queue class* structure for unsupported functions.*/LOCAL STATUS qPriDeltaNullRtn (void)    {    return (OK);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品久久精品| 午夜电影一区二区三区| 蜜臀av在线播放一区二区三区 | 亚洲综合小说图片| 99久久国产综合精品女不卡| 中文字幕人成不卡一区| 国产老妇另类xxxxx| 久久精品亚洲国产奇米99| 国产一区二区在线影院| 欧美成人aa大片| 国产精品一区三区| 国产性天天综合网| 91年精品国产| 一区二区三区高清不卡| 欧美系列在线观看| 美女免费视频一区| 亚洲精品一区二区三区在线观看 | 欧美一区二区美女| 麻豆国产一区二区| 欧美高清性hdvideosex| 狠狠色丁香久久婷婷综| 欧美高清在线一区| 97久久人人超碰| 一区二区三区中文字幕电影| 久久99热狠狠色一区二区| www国产成人| 久久精品国产精品亚洲红杏| 久久久久久久久久电影| 97精品国产97久久久久久久久久久久| 日韩理论在线观看| 日韩一区和二区| 国产在线精品一区二区夜色| 国产精品乱码人人做人人爱| 欧美喷水一区二区| 久久97超碰色| 亚洲黄色小视频| 日韩一区二区精品葵司在线| 国产在线精品一区二区三区不卡| 中文字幕在线不卡| 91精品国产91久久综合桃花 | 欧美亚洲动漫精品| 蜜臀精品一区二区三区在线观看| 久久精品夜色噜噜亚洲aⅴ| 在线观看网站黄不卡| 日本视频免费一区| 亚洲色图都市小说| 精品国产百合女同互慰| 国产99久久久国产精品免费看 | 一区二区三区**美女毛片| 日韩欧美精品在线| 91在线国内视频| 国产在线不卡一区| 亚洲大片精品永久免费| 国产日韩欧美精品综合| 欧美丰满少妇xxxbbb| 国产成人精品免费网站| 一区二区三区四区视频精品免费| 精品国一区二区三区| 94-欧美-setu| 成人国产在线观看| 美国一区二区三区在线播放| 亚洲一二三四在线| 国产精品久久久久aaaa| 日韩欧美一级二级| 这里只有精品99re| 成人黄色小视频| 国产一区二区三区久久久| 一区二区三区高清| 欧美精品一区二区三区视频| 成人爱爱电影网址| 青青草成人在线观看| 日韩免费高清av| 国产在线精品国自产拍免费| 国产精品卡一卡二卡三| 日韩成人伦理电影在线观看| 日韩一级免费观看| 色综合天天综合给合国产| 欧美日韩午夜影院| 亚洲欧美激情小说另类| 91精品国产免费| 久久超碰97中文字幕| 欧美国产精品中文字幕| 2021久久国产精品不只是精品| 91猫先生在线| 国产精品一区二区果冻传媒| 午夜影院久久久| 亚洲午夜久久久久中文字幕久| 亚洲日本一区二区| 国产精品色婷婷| 亚洲三级视频在线观看| 亚洲国产精品ⅴa在线观看| 日韩一区和二区| 精品国产一区二区三区久久影院| 欧美日韩久久一区二区| 欧美久久久一区| 欧美精品久久天天躁| 91精品国产丝袜白色高跟鞋| 欧美日本免费一区二区三区| 欧美色倩网站大全免费| 91精品国产高清一区二区三区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 一区二区三区在线影院| 欧洲亚洲精品在线| 99精品视频在线免费观看| 午夜欧美一区二区三区在线播放| 国产精品美女久久久久久久| 国产精品免费免费| 国产99久久久国产精品免费看 | 国产精品夜夜嗨| 国产91对白在线观看九色| 色婷婷国产精品久久包臀| 91在线视频免费91| 91精品在线一区二区| 欧美xingq一区二区| 日韩一级精品视频在线观看| 欧美激情一区二区在线| 亚洲精品日韩综合观看成人91| 亚洲va韩国va欧美va| 寂寞少妇一区二区三区| 99国内精品久久| 欧美三级视频在线| 日韩欧美久久一区| 亚洲男人的天堂一区二区| 石原莉奈在线亚洲二区| 成人亚洲一区二区一| 91福利精品视频| 欧美色偷偷大香| 精品国产乱码91久久久久久网站| 国产精品国产三级国产aⅴ入口| 亚洲欧美二区三区| 日本sm残虐另类| 不卡视频在线观看| 91麻豆精品国产无毒不卡在线观看| 26uuu国产一区二区三区| 亚洲综合偷拍欧美一区色| 麻豆精品国产传媒mv男同| 成人欧美一区二区三区黑人麻豆 | 91麻豆国产精品久久| 成人黄页毛片网站| 精品久久久久一区二区国产| 欧美日韩一本到| 国产婷婷精品av在线| 亚洲精品国产无套在线观| 免费成人在线观看视频| 99视频有精品| 欧美精品一区二区高清在线观看| 最新高清无码专区| 日日夜夜精品视频天天综合网| 久久91精品久久久久久秒播| 日日夜夜精品视频天天综合网| 国产成人自拍高清视频在线免费播放| 成人毛片视频在线观看| 欧美日韩一级片在线观看| 亚洲曰韩产成在线| 粉嫩av一区二区三区在线播放| 91免费视频大全| 色综合久久综合网97色综合 | 中文字幕中文字幕一区二区| 精品少妇一区二区| 国产情人综合久久777777| 香蕉影视欧美成人| 国产精品夜夜嗨| 久久精品亚洲一区二区三区浴池| 亚洲va天堂va国产va久| 91在线视频在线| 亚洲男人电影天堂| 欧美另类高清zo欧美| 欧美午夜宅男影院| 日日摸夜夜添夜夜添国产精品| 久久99精品网久久| 久久久精品影视| 国产成人小视频| 亚洲欧美日本韩国| 欧美午夜精品一区二区蜜桃 | 精品国产91九色蝌蚪| 欧美区在线观看| 精品国产乱码久久久久久老虎| 午夜精品影院在线观看| 欧美日韩三级一区| 成人精品视频一区二区三区尤物| 国产精品白丝在线| 欧美裸体一区二区三区| 久久国产生活片100| 国产精品私人影院| 欧美亚洲综合网| 国产精选一区二区三区| 久久久久久久综合狠狠综合| 欧美日韩久久不卡| 亚洲成人动漫在线免费观看| 欧美一区二区视频免费观看| 一区二区三区影院| 成人午夜av影视| 亚洲精品国产无天堂网2021| 色婷婷国产精品综合在线观看| 无码av免费一区二区三区试看| 欧美日韩国产高清一区| 麻豆久久久久久久| 日韩三级视频在线观看| 毛片av中文字幕一区二区| 国产欧美精品一区二区色综合朱莉|