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

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

?? qpriheaplib.c

?? vxworks5.5.1源代碼。完整源代碼
?? 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青草国产成人av片免费| 欧美三级资源在线| 日本韩国一区二区三区视频| 91精品欧美一区二区三区综合在| 久久久蜜桃精品| 亚洲va欧美va天堂v国产综合| 国产在线视频一区二区| 欧美日韩精品一区二区三区蜜桃 | 精品一区二区综合| gogo大胆日本视频一区| 精品美女被调教视频大全网站| 一区二区三区日韩精品| 懂色av一区二区三区蜜臀| 日韩欧美亚洲另类制服综合在线| 亚洲另类在线制服丝袜| 国产.欧美.日韩| 精品久久久久99| 人人精品人人爱| 91婷婷韩国欧美一区二区| 国产肉丝袜一区二区| 国产一区二区免费看| 欧美日韩国产综合一区二区三区| 中文字幕一区二区三区在线观看| 国产精品911| 337p日本欧洲亚洲大胆精品| 日本中文一区二区三区| 欧美美女网站色| 亚洲444eee在线观看| 在线观看国产91| 亚洲嫩草精品久久| 91丝袜美腿高跟国产极品老师| 欧美激情一区在线| 丁香亚洲综合激情啪啪综合| 精品成人一区二区三区四区| 蜜桃视频在线观看一区二区| 91精品国产色综合久久不卡蜜臀 | 中文字幕亚洲一区二区av在线 | 国产性天天综合网| 国产麻豆精品theporn| 久久精品这里都是精品| 国产九色sp调教91| 亚洲国产成人自拍| 91小视频在线观看| 亚洲成人激情综合网| 欧美美女一区二区| 狠狠久久亚洲欧美| 国产欧美精品日韩区二区麻豆天美| 国产精品原创巨作av| 国产精品视频免费看| 91美女片黄在线观看| 一区二区免费看| 欧洲av一区二区嗯嗯嗯啊| 天天综合色天天综合| 日韩欧美一区二区在线视频| 国产一区二区三区高清播放| 久久久久国产精品麻豆ai换脸| 国产成人自拍在线| 亚洲男人天堂av网| 欧美一区二区在线不卡| 国产精品夜夜爽| 亚洲激情综合网| 日韩精品一区二区三区四区视频| 国产电影一区在线| 一卡二卡三卡日韩欧美| 欧美tickle裸体挠脚心vk| 岛国精品在线观看| 亚洲高清在线视频| 国产亚洲成av人在线观看导航| 91麻豆6部合集magnet| 日韩不卡一区二区| 中文字幕中文字幕一区| 欧美精品在线观看一区二区| 国产成人自拍网| 丝袜亚洲精品中文字幕一区| 国产亚洲va综合人人澡精品| 欧美日韩三级一区| 国产成人午夜电影网| 婷婷开心久久网| 中文一区在线播放| 欧美一区二区高清| 色一区在线观看| 国产一区免费电影| 亚洲成av人片在线观看无码| 国产欧美综合在线观看第十页| 欧美精三区欧美精三区| 色偷偷成人一区二区三区91| 国产精品一区在线观看你懂的| 亚洲成人综合视频| 中文字幕中文在线不卡住| 精品国产成人系列| 欧美日韩欧美一区二区| 91片在线免费观看| 国产91精品在线观看| 蜜臀久久99精品久久久画质超高清| 中文字幕佐山爱一区二区免费| 久久人人爽人人爽| 久久综合国产精品| 欧美二区在线观看| 欧美日韩国产一级片| 色国产综合视频| jlzzjlzz亚洲女人18| 国产一区二区三区精品视频| 卡一卡二国产精品| 日韩av电影免费观看高清完整版| 一区av在线播放| 一卡二卡三卡日韩欧美| 亚洲精品视频在线观看免费| 久久亚洲一区二区三区四区| 欧美成人aa大片| 日韩欧美一二三区| 日韩免费看的电影| 欧美www视频| 日韩免费一区二区三区在线播放| 91精品国产91久久久久久最新毛片| 欧美日韩久久久久久| aaa亚洲精品| 成人av免费在线观看| 99热这里都是精品| 色老综合老女人久久久| 色婷婷综合久久久中文一区二区| 91麻豆国产在线观看| 色先锋久久av资源部| 欧美日韩国产影片| 欧美一区二区三区喷汁尤物| 91精品国产综合久久婷婷香蕉| 欧美丝袜丝交足nylons图片| 在线观看91精品国产入口| 欧美三级在线看| 日韩一级二级三级| 337p日本欧洲亚洲大胆精品| 国产午夜亚洲精品午夜鲁丝片| 国产欧美日韩久久| 亚洲男人的天堂av| 日韩黄色免费电影| 国产精品18久久久久久vr| av激情成人网| 欧美一区二区视频观看视频 | 国产一区不卡精品| 成人的网站免费观看| 欧美图区在线视频| 精品久久久久久久久久久久包黑料 | 国产99精品视频| 91精品1区2区| 欧美v国产在线一区二区三区| 国产精品视频九色porn| 香蕉加勒比综合久久| 国产成人精品三级| 91高清在线观看| 精品少妇一区二区| 亚洲天堂成人网| 免费成人av资源网| caoporen国产精品视频| 欧美理论在线播放| 日本一区二区综合亚洲| 亚洲国产精品影院| 国产一区二区免费在线| 欧美性猛交xxxx乱大交退制版| 26uuu成人网一区二区三区| 亚洲欧美视频在线观看| 裸体歌舞表演一区二区| 91在线观看视频| 欧美v日韩v国产v| 一区二区三区精密机械公司| 国产在线视频一区二区三区| 欧美亚洲尤物久久| 日本一区二区综合亚洲| 毛片av一区二区| 在线观看成人免费视频| 欧美激情资源网| 久久99精品久久久久久动态图 | 白白色 亚洲乱淫| 日韩欧美的一区| 亚洲国产精品视频| 波多野结衣在线aⅴ中文字幕不卡| 日韩精品一区二区三区视频| 亚洲一二三区不卡| av不卡在线观看| 国产丝袜欧美中文另类| 日本成人在线一区| 欧美性受xxxx黑人xyx| 中文字幕一区免费在线观看| 国产一区二区毛片| 精品乱人伦小说| 久久国产尿小便嘘嘘| 91精品国产综合久久久蜜臀图片| 亚洲自拍偷拍九九九| 成人av网站免费观看| 中文字幕不卡在线| 国产精品一区二区在线观看网站 | 日韩亚洲欧美高清| 日韩国产精品久久久| 欧美日韩极品在线观看一区| 一区二区三区日韩欧美| 色综合色综合色综合色综合色综合| 国产精品私人影院| 国产高清无密码一区二区三区| 久久久久99精品国产片| 国产麻豆视频精品| 久久亚洲一区二区三区四区| 国产美女精品人人做人人爽|