⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 blocklist.h

📁 操作系统中的一个例子
💻 H
字号:
/*
 * Copyright (c) 2000-2008
 * Author: Weiming Zhou
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  
 */

#ifndef _BLOCKLIST_H_
#define _BLOCKLIST_H_


typedef struct BLOCKLIST_st {
    void        *pBlock;        /* 整块内存指针 */
    SINGLENODE  *pEmpty;        /* 自由空间表头指针 */
    SINGLENODE  *pHead;         /* 链表头指针 */
    UINT        uDataSize;      /* 数据大小 */
    UINT        uMaxDataCount;  /* 最大的数据节点个数 */
    UINT        uFreeCount;     /* 自由空间节点数量 */
} BLOCKLIST;

BLOCKLIST * BlockList_Create(UINT uDataSize, UINT uMaxDataCount);
void        BlockList_Destroy(BLOCKLIST *pList);

INT         BlockList_InsertHead(BLOCKLIST *pList, void *pData, UINT uDataLen);
void        BlockList_DeleteHead(BLOCKLIST *pList);

void      * BlockList_Alloc(BLOCKLIST *pList);
void        BlockList_Free(BLOCKLIST *pList, void *pData);

#endif /* _BLOCKLIST_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -