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

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

?? qpriheaplib.c

?? 操作系統(tǒng)開發(fā),vxwork操作系統(tǒng)源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* qPriHeapLib.c - heap priority queue management library *//* Copyright 1984-1998 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01p,11nov01,dee  Add COLDFIRE support01o,04sep98,cdp  make ARM CPUs with ARM_THUMB==TRUE use portable routines.01n,22apr97,jpd  Added ARM to non-portable list.01m,19mar95,dvs  removed tron references.01l,19jul92,pme  made qPriHeapRemove return STATUS.01k,18jul92,smb  Changed errno.h to errnoLib.h.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,23jul91,hdn  added conditional macro for optimized TRON codes.01f,24may91,wmd  added predeclarations to avoid compiler errors.01e,28sep90,jcf	 documentation.01d,05jul90,jcf	 added qPriHeapCalibrate().01c,26jun90,jcf	 add qPriHeapResort().01b,10may90,jcf	 fixed PORTABLE definition.01a,14jun89,jcf	 written.*//*DESCRIPTIONThis library contains routines to manage a priority queue.  The queue ismaintained in priority order in a binary tree.  This queue performs aqPriHeapPut() operation preportional in time with log base 2 of the number ofnodes in the queue.  This queue is used for timer queues.  The only restrictionis that the heap can only handle a static number of nodes as specified atcreation time.This queue complies with the multi-way queue data structures and thus may beutilized by any multi-way queue.  The priority heap multi-way queueclass is accessed by the global id qPriHeapClassId.SEE ALSO: qLib()*/#include "vxWorks.h"#include "qClass.h"#include "qPriHeapLib.h"#include "stdlib.h"#include "string.h"#include "errnoLib.h"#include "stdio.h"/* XXX should break out for each architecture *//* optimized version available for 680X0 and ARM */#if (defined(PORTABLE) || \     ((CPU_FAMILY != MC680X0) && (CPU_FAMILY != ARM) && (CPU_FAMILY != COLDFIRE)) || \     ((CPU_FAMILY == ARM) && ARM_THUMB))#define qPriHeapLib_PORTABLE#endif	/* (defined(PORTABLE) || (CPU_FAMILY != MC680X0)) *//* imports */IMPORT ULONG vxTicks;		/* current time in ticks *//* globals */LOCAL Q_CLASS qPriHeapClass =    {    (FUNCPTR)qPriHeapCreate,    (FUNCPTR)qPriHeapInit,    (FUNCPTR)qPriHeapDelete,    (FUNCPTR)qPriHeapTerminate,    (FUNCPTR)qPriHeapPut,    (FUNCPTR)qPriHeapGet,    (FUNCPTR)qPriHeapRemove,    (FUNCPTR)qPriHeapResort,    (FUNCPTR)qPriHeapAdvance,    (FUNCPTR)qPriHeapGetExpired,    (FUNCPTR)qPriHeapKey,    (FUNCPTR)qPriHeapCalibrate,    (FUNCPTR)qPriHeapInfo,    (FUNCPTR)qPriHeapEach,    &qPriHeapClass    };Q_CLASS_ID qPriHeapClassId = &qPriHeapClass;/* forward static functions */#ifdef qPriHeapLib_PORTABLEstatic void qPriHeapUp (Q_PRI_HEAP_HEAD *pQPriHeapHead, int index);static void qPriHeapDown (Q_PRI_HEAP_HEAD *pQPriHeapHead, int index);#elseextern void qPriHeapUp (Q_PRI_HEAP_HEAD *pQPriHeapHead, int index);extern void qPriHeapDown (Q_PRI_HEAP_HEAD *pQPriHeapHead, int index);#endif/******************************************************************************** qPriHeapArrayCreate - create and initialized a heap priority queue** Create a heap priority queue.  Initialize the specified queue header.** RETURNS: OK or ERROR if not enough memory to create queue.** SEE ALSO: qPriHeapInit (2)*/HEAP_ARRAY *qPriHeapArrayCreate    (    int heapSize    )    {    return ((HEAP_ARRAY *) malloc ((unsigned) 4 * heapSize));    }/******************************************************************************** qPriHeapArrayDelete - deallocate a heap array** This routine returns an allocated HEAP_ARRAY structure to the free memory* pool.** RETURNS:*  OK, or*  ERROR if could not deallocate heap array.*/STATUS qPriHeapArrayDelete    (    HEAP_ARRAY *pHeapArray    )    {    free ((char *) pHeapArray);    return OK;    }/******************************************************************************** qPriHeapCreate - create and initialized a heap priority queue** Create a heap priority queue.  Initialize the specified queue header.** RETURNS: OK or ERROR if not enough memory to create queue.** SEE ALSO: qPriHeapInit (2)*/Q_PRI_HEAP_HEAD *qPriHeapCreate    (    HEAP_ARRAY *pHeapArray    )    {    Q_PRI_HEAP_HEAD *pQPriHeapHead = (Q_PRI_HEAP_HEAD *)				     malloc (sizeof (Q_PRI_HEAP_HEAD));    if (pQPriHeapHead == NULL)	return (NULL);    if (qPriHeapInit (pQPriHeapHead, pHeapArray) != OK)	{	free ((char *)pQPriHeapHead);	return (NULL);	}    return (pQPriHeapHead);    }/******************************************************************************** qPriHeapInit - initialize a heap priority queue** Initialize the heap priority queue pointed to by the specified queue* header.** RETURNS:  OK, or ERROR if heap priority queue could not be initialized.** ERRNO: S_qPriHeapLib_NULL_HEAP_ARRAY**/STATUS qPriHeapInit    (    Q_PRI_HEAP_HEAD *pQPriHeapHead,    HEAP_ARRAY      *pHeapArray    )    {    if (pHeapArray == NULL)	{	errnoSet (S_qPriHeapLib_NULL_HEAP_ARRAY);	return (ERROR);	}    pQPriHeapHead->pHeapArray	= pHeapArray;	/* store bmap list pointer */    pQPriHeapHead->pHighNode	= NULL;		/* zero the highest node */    pQPriHeapHead->heapIndex	= 0;		/* initialize the heap index */    return (OK);    }/******************************************************************************** qPriHeapDelete - delete a priority heap queue** This routine deallocates memory associated with the queue.  All queued* nodes are lost.** RETURNS:*  OK, or*  ERROR if memory cannot be deallocated.*/STATUS qPriHeapDelete    (    Q_PRI_HEAP_HEAD *pQPriHeapHead    )    {    free ((char *) pQPriHeapHead);    return OK;    }/******************************************************************************** qPriHeapTerminate - terminate a heap priority queue** This routine terminates a heap priority queue.  All queued nodes will be lost.** ARGSUSED*/STATUS qPriHeapTerminate    (    Q_PRI_HEAP_HEAD *pQPriHeapHead    )    {    return (OK);    }/********************************************************************************* qPriHeapPut - insert a node into a heap priority queue** This routine inserts a node into a heap priority queue.  The insertion is* based on the priority key.  The lower the key the higher the priority.*/void qPriHeapPut    (    Q_PRI_HEAP_HEAD     *pQPriHeapHead,    Q_PRI_HEAP_NODE     *pQPriHeapNode,    ULONG                key    )    {    int index = pQPriHeapHead->heapIndex++;    pQPriHeapNode->key = key;    (*pQPriHeapHead->pHeapArray)[index] = pQPriHeapNode;    qPriHeapUp (pQPriHeapHead, index);    }/********************************************************************************* qPriHeapGet - remove and return first node in heap priority queue** This routine removes and returns the first node in a heap priority 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_HEAP_NODE *qPriHeapGet    (    Q_PRI_HEAP_HEAD *pQPriHeapHead    )    {    FAST Q_PRI_HEAP_NODE **heapArray = *pQPriHeapHead->pHeapArray;    Q_PRI_HEAP_NODE *pQPriHeapNode = pQPriHeapHead->pHighNode;    if (pQPriHeapHead->heapIndex == 0)	return (NULL);    else if (pQPriHeapHead->heapIndex-- == 1)	pQPriHeapHead->pHighNode = NULL;    else	{	heapArray [0] = heapArray [pQPriHeapHead->heapIndex];	qPriHeapDown (pQPriHeapHead, 0);	}    return (pQPriHeapNode);    }/********************************************************************************* qPriHeapRemove - remove a node from a heap priority queue** This routine removes a node from the specified heap priority queue.*/STATUS qPriHeapRemove    (    Q_PRI_HEAP_HEAD *pQPriHeapHead,    Q_PRI_HEAP_NODE *pQPriHeapNode    )    {    FAST int index = pQPriHeapNode->index;    FAST Q_PRI_HEAP_NODE **heapArray = *pQPriHeapHead->pHeapArray;    int heapIndex = pQPriHeapHead->heapIndex;    if (--pQPriHeapHead->heapIndex == 0)	pQPriHeapHead->pHighNode = NULL;    else	{	heapArray [index] = heapArray [heapIndex - 1];	if ((index > 0) &&	    (heapArray [(index - 1) / 2]->key > heapArray [index]->key))	    qPriHeapUp (pQPriHeapHead, index);	else	    qPriHeapDown (pQPriHeapHead, index);	}    return (OK);    }/********************************************************************************* qPriHeapResort - resort a node to a new position based on a new key

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲bt欧美bt精品777| 91精品国产综合久久精品 | 欧美一区二区三区视频在线观看| 欧美日韩亚洲综合在线| 日韩欧美一级在线播放| 国产精品伦理在线| 午夜精品久久久| 国产乱子伦视频一区二区三区 | 亚洲色图色小说| 日韩av中文字幕一区二区| 国产乱国产乱300精品| 色婷婷综合久久久中文一区二区 | 日本中文一区二区三区| 成人自拍视频在线| 欧美日韩视频第一区| 国产欧美一区二区三区在线看蜜臀| 亚洲免费在线播放| 蜜桃视频一区二区三区在线观看 | 亚洲精品视频免费观看| 九九热在线视频观看这里只有精品| 99精品久久免费看蜜臀剧情介绍| 日韩一级二级三级| 亚洲美女少妇撒尿| 国产高清在线精品| 欧美一区二区在线视频| 亚洲三级小视频| 韩国v欧美v亚洲v日本v| 欧美三区在线观看| 中文字幕一区二区三区不卡在线| 久久99精品久久久久婷婷| 精品99999| 亚洲一区二三区| 国产成人综合网| 欧美一级淫片007| 亚洲国产精品视频| 99国产精品久| 欧美激情一区二区三区| 麻豆精品在线播放| 欧美日韩激情在线| 亚洲色图在线播放| 风流少妇一区二区| 2019国产精品| 日韩av电影免费观看高清完整版| 91福利区一区二区三区| 国产精品麻豆视频| 国产一区二区不卡| 日韩欧美不卡在线观看视频| 亚洲成人在线观看视频| 91丨porny丨蝌蚪视频| 国产精品无人区| 国产精品白丝jk白祙喷水网站| 欧美成人一区二区三区片免费| 亚洲成人动漫一区| 在线日韩一区二区| 亚洲精品亚洲人成人网在线播放| 不卡av在线免费观看| 久久久久久久综合狠狠综合| 久久不见久久见免费视频1| 91精品国产色综合久久不卡蜜臀 | 91精品国产高清一区二区三区蜜臀| 亚洲一区二区三区四区五区中文| 99免费精品在线观看| 亚洲国产精品二十页| 国产99久久精品| 国产欧美一区二区在线| 国产成人一区在线| 日本一区二区不卡视频| 成人免费电影视频| 国产精品人人做人人爽人人添 | 亚洲欧美区自拍先锋| 不卡一区二区中文字幕| 欧美激情中文字幕一区二区| 国产精品亚洲成人| 亚洲国产精品v| 99久久久久久| 亚洲靠逼com| 欧美日韩和欧美的一区二区| 午夜电影一区二区三区| 日韩一区二区三区高清免费看看| 人人狠狠综合久久亚洲| 日韩欧美亚洲一区二区| 国产一区二区三区久久久| 韩国av一区二区| xnxx国产精品| 成人视屏免费看| 日韩毛片精品高清免费| 色综合久久久久综合体| 亚洲电影视频在线| 欧美成人猛片aaaaaaa| 国产精品99久久久久久有的能看| 日本一区二区不卡视频| 色综合久久九月婷婷色综合| 久久综合九色综合欧美就去吻| 国产福利不卡视频| 亚洲欧美日韩国产另类专区| 欧美日韩一级片在线观看| 日韩激情一区二区| 精品久久一二三区| 欧美tk丨vk视频| 东方欧美亚洲色图在线| 一区二区三区在线观看网站| 这里只有精品电影| 国产一区欧美二区| 亚洲欧洲精品天堂一级| 精品视频一区 二区 三区| 精品亚洲国内自在自线福利| 中文字幕一区二区三区在线不卡| 欧美日韩亚洲综合在线| 国产乱理伦片在线观看夜一区| 亚洲另类中文字| 欧美成人欧美edvon| 91在线视频观看| 琪琪一区二区三区| 日韩一区在线播放| 91精品久久久久久蜜臀| 成人一道本在线| 偷拍日韩校园综合在线| 欧美激情一区二区在线| 欧美日韩欧美一区二区| 国产精品一区在线| 一区二区三区成人| 欧美精品一区男女天堂| 色偷偷久久人人79超碰人人澡| 理论电影国产精品| 亚洲欧美激情一区二区| 精品国产123| 色妹子一区二区| 免费成人在线观看视频| 亚洲色图制服诱惑| 久久亚洲一区二区三区明星换脸| 91浏览器入口在线观看| 精品一区二区免费看| 一区二区久久久| 国产调教视频一区| 777奇米四色成人影色区| 成人av在线资源网| 美日韩一区二区三区| 亚洲精品伦理在线| 国产欧美久久久精品影院| 欧美绝品在线观看成人午夜影视| 高清不卡一区二区在线| 免费人成精品欧美精品 | 91福利国产精品| 成人免费不卡视频| 精品一区二区三区在线观看国产| 亚洲一区二区五区| 国产精品久久久久一区| 亚洲精品一区二区三区四区高清| 欧美日韩一区二区三区在线看| 成人精品视频一区二区三区| 麻豆91免费看| 视频一区免费在线观看| 日韩毛片视频在线看| 国产欧美视频一区二区三区| 日韩美一区二区三区| 欧美日韩国产在线播放网站| 99久久精品免费观看| 国产91精品一区二区麻豆亚洲| 久久精品噜噜噜成人88aⅴ| 午夜精品福利久久久| 亚洲综合色噜噜狠狠| 国产精品久久久久久久裸模| 久久久久久久久久久久久女国产乱| 56国语精品自产拍在线观看| 欧美性受xxxx| 日本电影欧美片| 日本道免费精品一区二区三区| 欧美成人伊人久久综合网| 91麻豆精品国产91久久久资源速度| 日本高清视频一区二区| 色婷婷国产精品| 91视频国产观看| 一本色道亚洲精品aⅴ| 成人h动漫精品一区二| 成人av动漫在线| www.日韩精品| 91亚洲精品久久久蜜桃| 99国产精品久久久| 97精品久久久久中文字幕 | 1024成人网色www| 国产精品久久影院| 国产精品毛片无遮挡高清| 国产精品国产三级国产普通话三级| 国产无一区二区| 欧美高清在线一区二区| 国产精品美女一区二区三区| 中文字幕亚洲在| 亚洲乱码一区二区三区在线观看| 一区二区在线电影| 亚洲精品videosex极品| 亚洲电影视频在线| 美女视频免费一区| 国产一区二区剧情av在线| 成人视屏免费看| 色诱亚洲精品久久久久久| 欧美日韩一区久久| 日韩一区二区三区精品视频 | 成人综合在线网站| jlzzjlzz亚洲日本少妇| 色爱区综合激月婷婷|