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

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

?? lists.c

?? ARM的bootloader代碼.rar
?? C
?? 第 1 頁 / 共 2 頁
字號:
#include <armboot.h>#include <malloc.h>#include "lists.h"#define MAX(a,b) 	(((a)>(b)) ? (a) : (b))#define MIN(a,b) 	(((a)<(b)) ? (a) : (b))#define CAT4CHARS(a,b,c,d)	((a<<24) | (b<<16) | (c<<8) | d)#define kDefaultAllocationPercentIncrease   10  /* increase list size by 10% every time it is full */#define kDefaultAllocationminNumItemsIncrease   4   /* always increase list size by 4 items when it is full */ /* how many items to expand the list by when it becomes full = current listSize (in items) + (hiword percent of list size) +   loword */#define NUMITEMSPERALLOC(list) MAX(((*list)->listSize * ((*list)->percentIncrease + 100)) / 100 , (*list)->minNumItemsIncrease)#define ITEMPTR(list, item)     &(((char *)&(*list)->itemList)[ (*(list))->itemSize * (item)])#define LIST_SIGNATURE          CAT4CHARS('L', 'I', 'S', 'T');#define calloc(size,num)	malloc(size*num)/********************************************************************/Handle NewHandle(unsigned int numBytes){    void            *memPtr;    HandleRecord    *hanPtr;    memPtr = calloc(numBytes, 1);    hanPtr = (HandleRecord*)calloc(sizeof(HandleRecord), 1);    if (hanPtr && (memPtr || numBytes == 0))        {        hanPtr->ptr = memPtr;        hanPtr->size = numBytes;        return (Handle)hanPtr;        }    else        {        free(memPtr);        free(hanPtr);        return NULL;        }}/********************************************************************/void  DisposeHandle(Handle handle){    if (handle)        {        free(*handle);        free((void *)handle);        }}/********************************************************************/unsigned int  GetHandleSize(Handle handle){    return ((HandleRecord *)handle)->size;}/********************************************************************/int  SetHandleSize(Handle handle, unsigned int newSize){    HandleRecord    *hanRecPtr = (HandleRecord *)handle;    void            *newPtr, *oldPtr;    unsigned int    oldSize;    oldPtr = hanRecPtr->ptr;    oldSize = hanRecPtr->size;    if (oldSize == newSize)         return 1;    if (oldPtr == NULL)    {        newPtr = malloc(newSize);    }    else    {        newPtr = realloc(oldPtr, newSize);    }    if (newPtr || (newSize == 0))        {        hanRecPtr->ptr = newPtr;        hanRecPtr->size = newSize;        if (newSize > oldSize)            memset ((char *)newPtr+oldSize, 0, newSize-oldSize);        return 1;        }    else        return 0;}#ifdef	CFG_ALL_LIST_FUNCTIONS    /*  Used to compare list elements by their raw data contents */static int  ListMemBlockCmp(void *a, void *b, int size){    return memcmp(a, b, size);}/***************************************************************************/    /*  Binary search numElements of size elementSize in array for a match        to the. item. Return the index of the element that matches (0 - numElements - 1).        If no match is found return the -i-1 where i is the index (0 - numElements)        where the item should be placed. (*theCmp)(a,b) should return  <0 if a<b,        0 if a==b, >0 if a>b.        This function is like the C-Library function bsearch() except that this        function returns the index where the item should be placed if it is not        found.    */int BinSearch(void *array, int numElements, int elementSize, void *itemPtr, CompareFunction compareFunction){    int low, high, mid, cmp;    void *arrayItemPtr;    for(low=0, high= numElements-1, mid=0, cmp= -1; low <= high; )        {        mid = (low + high) >> 1;        arrayItemPtr = (void *) (((char *)array) + (mid*elementSize));        cmp = compareFunction ? compareFunction(itemPtr, arrayItemPtr)                              : ListMemBlockCmp(itemPtr, arrayItemPtr, elementSize);        if (cmp == 0)            return mid;        else        if (cmp < 0)            high= mid - 1;        else            low= mid + 1;        }    if (cmp > 0)        mid++;    return -mid-1;}#endif	/* CFG_ALL_LIST_FUNCTIONS *//*******************************************************************************/    /* BEGIN PATCH to 4.0.1 - jag 8-29-96 */    /*  If numNewItems == 0 then expand the list by the number of items	indicated by its allocation policy.        If numNewItems > 0 then expand the list by exactly the number of	items indicated.        If numNewItems < 0 then expand the list by the absolute value of	numNewItems plus the number of items indicated by its allocation	policy.        Returns 1 for success, 0 if out of memory    */static int  ExpandListSpace (list_t list, int numNewItems){    if (numNewItems == 0)        numNewItems = NUMITEMSPERALLOC(list);    else    if (numNewItems < 0)        numNewItems = (-numNewItems) + NUMITEMSPERALLOC(list);    if (SetHandleSize ((Handle)list,        sizeof(ListStruct) +	((*list)->listSize + numNewItems) * (*list)->itemSize))	{    	    (*list)->listSize += numNewItems;    	    return 1;        }    else    {        return 0;    }}/*******************************/#ifdef	CFG_ALL_LIST_FUNCTIONS     /* This function reallocate the list, minus any currently unused portion of its allotted memory. */void  ListCompact (list_t list){    if (!SetHandleSize ((Handle)list,        sizeof (ListStruct) + (*list)->numItems * (*list)->itemSize))        return;    (*list)->listSize = (*list)->numItems;}#endif	/* CFG_ALL_LIST_FUNCTIONS *//*******************************/list_t  ListCreate (int elementSize){    list_t    list;    list = (list_t)(NewHandle (sizeof(ListStruct)));   /* create empty list */    if (list)        {        (*list)->signature = LIST_SIGNATURE;        (*list)->numItems = 0;        (*list)->listSize = 0;        (*list)->itemSize = elementSize;        (*list)->percentIncrease = kDefaultAllocationPercentIncrease;        (*list)->minNumItemsIncrease = kDefaultAllocationminNumItemsIncrease;        }    return list;}/*******************************/void  ListSetAllocationPolicy (list_t list, int minItemsPerAlloc, int percentIncreasePerAlloc){    (*list)->percentIncrease = percentIncreasePerAlloc;    (*list)->minNumItemsIncrease = minItemsPerAlloc;}/*******************************/void  ListDispose (list_t list){    DisposeHandle ((Handle)list);}/*******************************/#ifdef	CFG_ALL_LIST_FUNCTIONSvoid  ListDisposePtrList(list_t list){    int index;    int numItems;    if (list)        {        numItems = ListNumItems(list);        for (index = 1; index <= numItems; index++)            free(*(void **)ListGetPtrToItem(list, index));        ListDispose(list);        }}/*******************************/void   ListClear (list_t list)  /* keeps memory, resets the number of items to 0 */{    if (!list)        return;    (*list)->numItems = 0;}/*******************************/list_t  ListCopy (list_t originalList)   /* copy is only as large as necessary */{    list_t    tempList = NULL;    int         numItems;    if (!originalList)        return NULL;    tempList = ListCreate ((*originalList)->itemSize);    if (tempList) {        numItems = ListNumItems (originalList);        if (!SetHandleSize ((Handle)tempList,            sizeof (ListStruct) + numItems * (*tempList)->itemSize)) {            ListDispose (tempList);            return NULL;            }        (*tempList)->numItems = (*originalList)->numItems;        (*tempList)->listSize = (*originalList)->numItems;        (*tempList)->itemSize = (*originalList)->itemSize;        (*tempList)->percentIncrease = (*originalList)->percentIncrease;        (*tempList)->minNumItemsIncrease = (*originalList)->minNumItemsIncrease;        memcpy (ITEMPTR(tempList,0), ITEMPTR(originalList,0),            numItems * (*tempList)->itemSize);        }    return tempList;}/********************************/int  ListAppend (list_t list1, list_t list2)  /* list1 = list1 + list2 */{    int numItemsL1, numItemsL2;    if (!list2)        return 1;    if (!list1)        return 0;    if ((*list1)->itemSize != (*list2)->itemSize)        return 0;    numItemsL1 = ListNumItems (list1);    numItemsL2 = ListNumItems (list2);    if (numItemsL2 == 0)        return 1;    if (!SetHandleSize ((Handle)list1,        sizeof (ListStruct) + (numItemsL1 + numItemsL2) * (*list1)->itemSize))        return 0;    (*list1)->numItems = numItemsL1 + numItemsL2;    (*list1)->listSize = numItemsL1 + numItemsL2;    memmove (ITEMPTR(list1,numItemsL1), ITEMPTR(list2,0),        numItemsL2 * (*list2)->itemSize);    return 1;}#endif	/* CFG_ALL_LIST_FUNCTIONS *//*******************************/    /*  returns 1 if the item is inserted, returns 0 if out of memory or        bad arguments were passed.    */int  ListInsertItem (list_t list, void *ptrToItem, int itemPosition){    return ListInsertItems (list, ptrToItem, itemPosition, 1);}/*******************************/int  ListInsertItems (list_t list, void *ptrToItems, int firstItemPosition, int numItemsToInsert){    int numItems = (*list)->numItems;    if (firstItemPosition == numItems + 1)        firstItemPosition = LIST_END;    else    if (firstItemPosition > numItems)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲sss视频在线视频| 欧美va在线播放| 综合自拍亚洲综合图不卡区| 精品系列免费在线观看| 日韩一区二区视频在线观看| 日本不卡中文字幕| 精品国产乱码久久久久久久| 经典一区二区三区| 国产丝袜美腿一区二区三区| 国产激情一区二区三区桃花岛亚洲| 久久综合九色综合欧美亚洲| 国产99久久久久久免费看农村| 中文字幕一区在线| 欧洲色大大久久| 捆绑调教一区二区三区| 国产视频一区二区三区在线观看 | 欧美日韩亚洲丝袜制服| 午夜激情一区二区三区| www国产成人免费观看视频 深夜成人网| 国产精品夜夜嗨| 亚洲蜜臀av乱码久久精品蜜桃| 欧美日韩国产免费一区二区 | 日本精品一级二级| 日本人妖一区二区| 中文成人综合网| 欧美日韩国产综合一区二区| 国产一区日韩二区欧美三区| 亚洲欧美另类小说| 日韩欧美国产精品| 99精品视频在线观看| 日日噜噜夜夜狠狠视频欧美人 | 粉嫩aⅴ一区二区三区四区| 亚洲欧美韩国综合色| 欧美成人福利视频| 91美女在线看| 国产在线视频精品一区| 一区二区三区久久久| 久久色成人在线| 欧美日韩视频专区在线播放| 国产69精品久久777的优势| 日韩高清国产一区在线| 中文字幕一区二区在线观看 | 国产成人免费视频网站| 午夜精品久久久久久久久| 国产精品亲子乱子伦xxxx裸| 日韩一卡二卡三卡| 国产精品人人做人人爽人人添| 欧美日韩精品是欧美日韩精品| 国产精品自拍三区| 日本美女一区二区| 亚洲亚洲精品在线观看| 国产精品高清亚洲| 久久夜色精品国产欧美乱极品| 欧美日韩一区二区三区在线看| 大胆亚洲人体视频| 国内精品写真在线观看| 奇米色777欧美一区二区| 一区二区三区蜜桃网| 亚洲少妇中出一区| 国产精品美女视频| 久久久久久久综合狠狠综合| 欧美日本一区二区| 欧美在线视频全部完| 99re8在线精品视频免费播放| 国产麻豆日韩欧美久久| 日韩av电影免费观看高清完整版| 亚洲精品国产精华液| 国产精品美女一区二区| 中文字幕乱码久久午夜不卡| 久久一区二区视频| 久久人人爽人人爽| 久久婷婷成人综合色| 久久欧美中文字幕| 欧美极品少妇xxxxⅹ高跟鞋 | 18欧美亚洲精品| 欧美国产视频在线| 国产精品国产三级国产专播品爱网| 久久嫩草精品久久久精品| 久久夜色精品一区| 国产蜜臀av在线一区二区三区| 久久久久综合网| 国产欧美综合在线观看第十页| 亚洲国产精品传媒在线观看| 国产日韩精品一区二区三区在线| 国产视频视频一区| 国产精品久久久久久久久免费相片 | 欧美激情一区在线| 国产精品欧美一区二区三区| 亚洲色图欧美激情| 亚洲女性喷水在线观看一区| 亚洲午夜激情av| 视频一区欧美精品| 免费视频一区二区| 国产精品一区一区| 99久久精品免费观看| 91香蕉视频mp4| 欧美午夜精品一区| 精品日韩一区二区三区| 国产午夜精品久久久久久免费视 | 91福利区一区二区三区| 欧洲一区在线电影| 日韩高清欧美激情| 免费看欧美女人艹b| 国产麻豆成人精品| 91性感美女视频| 日韩一区二区精品| 中文字幕在线观看一区二区| 亚洲图片欧美视频| 狠狠色丁香婷综合久久| av男人天堂一区| 欧美日韩激情在线| 亚洲国产电影在线观看| 亚洲国产欧美日韩另类综合| 韩国理伦片一区二区三区在线播放| 丁香六月久久综合狠狠色| 欧美又粗又大又爽| 久久人人97超碰com| 亚洲中国最大av网站| 国产在线精品免费av| 色综合视频在线观看| 欧美sm美女调教| 亚洲欧美国产三级| 国产在线一区二区| 欧美精品在欧美一区二区少妇| 久久久久久**毛片大全| 亚洲h在线观看| 成人高清视频在线| 精品女同一区二区| 亚洲影院在线观看| 成人免费黄色大片| 精品欧美一区二区在线观看| **性色生活片久久毛片| 蜜桃久久精品一区二区| 91久久精品日日躁夜夜躁欧美| 久久综合久久久久88| 午夜精品久久久久久不卡8050| 成人国产免费视频| 久久久久久亚洲综合影院红桃 | 欧美日韩成人在线| 国产精品剧情在线亚洲| 国内精品国产三级国产a久久 | www.久久久久久久久| 日韩欧美另类在线| 亚洲国产欧美日韩另类综合| av电影一区二区| 久久精品一级爱片| 蜜臀av一区二区| 欧美色图在线观看| 亚洲欧洲综合另类在线| 国产精品羞羞答答xxdd| 日韩一卡二卡三卡四卡| 亚洲妇熟xx妇色黄| 欧美午夜精品久久久| 亚洲美女屁股眼交| av亚洲精华国产精华| 国产日韩综合av| 国产在线播精品第三| 欧美zozozo| 九九久久精品视频| 欧美tickling网站挠脚心| 免费人成网站在线观看欧美高清| 欧美综合亚洲图片综合区| 亚洲欧美激情小说另类| 色综合久久天天| 亚洲欧洲韩国日本视频| 99v久久综合狠狠综合久久| 国产精品久久毛片| 成人h动漫精品| 成人欧美一区二区三区黑人麻豆| 成人精品国产免费网站| 国产一区二区三区av电影| 精品久久久久一区二区国产| 久久国产精品99久久人人澡| 欧美一区二区三区成人| 日韩av在线播放中文字幕| 91精品国产乱码久久蜜臀| 日本伊人午夜精品| 欧美videos大乳护士334| 国产一区二区三区免费在线观看| 日韩三级在线免费观看| 狠狠色综合日日| 国产欧美视频一区二区| zzijzzij亚洲日本少妇熟睡| 中文字幕一区二区视频| 一本色道**综合亚洲精品蜜桃冫 | 国产欧美日韩精品a在线观看| 国产成人小视频| 国产精品久久久久天堂| 94色蜜桃网一区二区三区| 亚洲国产精品人人做人人爽| 777xxx欧美| 国产一区不卡精品| 亚洲私人影院在线观看| 欧美最新大片在线看| 麻豆精品蜜桃视频网站| 欧美国产一区二区在线观看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美精品一卡两卡| 国产一区二区三区四区在线观看| 国产精品女主播在线观看|