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

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

?? qpriheaplib.c

?? 操作系統開發,vxwork操作系統源代碼
?? 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一区二区三区免费野_久草精品视频
久久99久国产精品黄毛片色诱| 久久久久久久久99精品| 欧美一级片在线看| 欧美精品一区二区三区四区| 国产精品久线在线观看| 亚洲精品高清在线| 六月丁香综合在线视频| 高清视频一区二区| 在线精品亚洲一区二区不卡| 欧美一级在线免费| 国产精品午夜在线| 图片区小说区区亚洲影院| 国产真实精品久久二三区| 97精品国产露脸对白| 91麻豆精品国产无毒不卡在线观看 | 日本精品视频一区二区| 日韩一区二区精品在线观看| 国产精品网站在线观看| 日韩高清一级片| 成人听书哪个软件好| 91精品婷婷国产综合久久| 日本一区二区成人| 奇米影视7777精品一区二区| 99久久精品久久久久久清纯| 在线成人免费观看| 最新中文字幕一区二区三区| 美国欧美日韩国产在线播放| 色88888久久久久久影院按摩| 精品久久久久久久久久久院品网| 一区二区欧美在线观看| 国产成人免费视频精品含羞草妖精| 欧美视频精品在线观看| 国产精品无码永久免费888| 日本伊人精品一区二区三区观看方式| 成人看片黄a免费看在线| 欧美一级搡bbbb搡bbbb| 亚洲综合色丁香婷婷六月图片| 国产精品中文字幕一区二区三区| 欧美日韩第一区日日骚| 亚洲视频免费看| 国产精品夜夜嗨| 日韩欧美色电影| 亚洲成人三级小说| 色婷婷亚洲婷婷| 国产精品三级视频| 韩国一区二区三区| 欧美一区二区美女| 亚洲午夜久久久久久久久电影网| 成人av网站大全| 久久综合九色综合欧美亚洲| 日韩精品五月天| 欧美三区在线观看| 亚洲欧美日韩久久| youjizz国产精品| 国产日韩一级二级三级| 狠狠色丁香久久婷婷综合丁香| 欧美精品电影在线播放| 亚洲综合久久av| 色综合天天综合在线视频| 国产精品毛片无遮挡高清| 国产夫妻精品视频| 久久久欧美精品sm网站| 黄色资源网久久资源365| 欧美一区二区精美| 五月激情综合网| 欧美乱熟臀69xxxxxx| 亚洲bt欧美bt精品777| 欧美图片一区二区三区| 一区二区三区免费看视频| 91麻豆免费在线观看| 亚洲欧美另类综合偷拍| 91视频xxxx| 一区二区三区中文在线观看| 色偷偷一区二区三区| 亚洲精品欧美激情| 91极品视觉盛宴| 亚洲国产一区二区a毛片| 欧美图区在线视频| 首页欧美精品中文字幕| 91精品国产手机| 免费成人小视频| 久久众筹精品私拍模特| 国产一本一道久久香蕉| 国产亲近乱来精品视频| 高清久久久久久| 亚洲男女毛片无遮挡| 日本精品裸体写真集在线观看| 亚洲综合无码一区二区| 777欧美精品| 乱一区二区av| 国产欧美日本一区二区三区| 国产aⅴ综合色| 亚洲青青青在线视频| 欧美三级电影在线观看| 蜜臀av一级做a爰片久久| 久久久不卡网国产精品二区| 不卡的看片网站| 一区二区三区四区五区视频在线观看 | 26uuu久久综合| 成人黄色综合网站| 一区二区三区小说| 日韩三级.com| 成人午夜视频福利| 亚洲自拍偷拍av| 欧美一级电影网站| 高清不卡一二三区| 一区二区三区不卡视频在线观看| 欧美肥大bbwbbw高潮| 国产一二精品视频| 一区二区三区在线不卡| 欧美不卡视频一区| 99国产精品国产精品久久| 亚洲成av人影院在线观看网| 精品国产1区二区| 色婷婷久久一区二区三区麻豆| 日本不卡1234视频| 国产精品麻豆一区二区| 4438x成人网最大色成网站| 国产高清一区日本| 亚洲一区二区免费视频| 久久―日本道色综合久久| 日本韩国欧美一区二区三区| 日本午夜精品视频在线观看| 国产精品三级视频| 日韩欧美综合在线| 在线免费观看成人短视频| 国产一区在线观看麻豆| 亚洲国产视频网站| 欧美精品一区二区三区很污很色的| 99精品视频一区二区三区| 秋霞电影网一区二区| 中文字幕一区二区三区色视频| 日韩一区二区三区免费看 | 亚洲丝袜制服诱惑| 日韩精品在线网站| 在线观看免费成人| 国产成人免费视频精品含羞草妖精| 亚洲1区2区3区4区| 国产精品久久夜| 日韩欧美另类在线| 色女孩综合影院| 国产二区国产一区在线观看| 日韩影院精彩在线| 亚洲黄色免费电影| 日本一区二区三区高清不卡| 欧美一区午夜视频在线观看| 91麻豆精品秘密| 成人午夜电影小说| 狂野欧美性猛交blacked| 夜夜嗨av一区二区三区中文字幕| 国产欧美日韩在线观看| 欧美一区日本一区韩国一区| 91免费看片在线观看| 国产成人av电影在线观看| 另类人妖一区二区av| 视频在线观看一区| 亚洲男人的天堂av| 国产精品麻豆视频| 久久精品一区二区三区不卡牛牛| 欧美一区永久视频免费观看| 欧美日韩久久一区| 在线观看中文字幕不卡| 91蜜桃网址入口| jizzjizzjizz欧美| 成人免费看视频| 国产精品1区2区3区| 激情另类小说区图片区视频区| 蜜臀av一区二区在线观看 | 日韩精品专区在线| 欧美一区二区三区免费视频| 欧美精品v日韩精品v韩国精品v| 91看片淫黄大片一级在线观看| 成人黄色777网| 成人黄色网址在线观看| 成人激情免费视频| gogogo免费视频观看亚洲一| 福利电影一区二区| 成人午夜激情在线| 成a人片亚洲日本久久| 夫妻av一区二区| caoporen国产精品视频| 成人手机电影网| 不卡视频在线观看| 不卡电影一区二区三区| 91在线观看污| 色噜噜夜夜夜综合网| 在线国产亚洲欧美| 欧美日韩黄视频| 69久久夜色精品国产69蝌蚪网| 欧美精品久久一区| 日韩欧美一区中文| 久久免费午夜影院| 国产日韩欧美精品一区| 欧美韩国一区二区| 最近日韩中文字幕| 亚洲伊人伊色伊影伊综合网| 亚洲mv在线观看| 精品制服美女丁香| 福利一区福利二区| 91久久精品一区二区|