blocklist.h
来自「多任务下的数据结构与算法的源码」· C头文件 代码 · 共 34 行
H
34 行
/*
* 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 + =
减小字号Ctrl + -
显示快捷键?