ds_list.h

来自「内存数据库」· C头文件 代码 · 共 45 行

H
45
字号
 
#ifndef __DS_LIST_H__
#define __DS_LIST_H__


#define	FLAG_RELEASE	0x0001

typedef struct LNode{

	void			*data;
	struct LNode	*next;
	struct LNode	*prev;

} *LPOSITION;

typedef struct {

	LPOSITION	head, tail;
	UINT		size;
	UINT		count;
	
} DS_LIST;

void		DSL_InitList( DS_LIST* pList, UINT size );
void*		DSL_GetAt( LPOSITION pos );
BOOL		DSL_IsEmpty( DS_LIST* pList );
int			DSL_GetCount( DS_LIST* pList );
LPOSITION	DSL_NextPos( LPOSITION pos);
LPOSITION	DSL_PrevPos( LPOSITION pos );
LPOSITION	DSL_GetHead( DS_LIST* pList );
LPOSITION	DSL_GetLast( DS_LIST* pList );
BOOL		DSL_SetAt( DS_LIST* pList, LPOSITION pos, void* elem );
void		DSL_ClearList( DS_LIST* pList );
LPOSITION	DSL_AddHead( DS_LIST* pList, void* node );
LPOSITION	DSL_AddTail( DS_LIST* pList, void* node );
BOOL		DSL_RemoveAt( DS_LIST* pList, LPOSITION pos );
BOOL		DSL_RemoveTail( DS_LIST* pList );
LPOSITION	DSL_AddTail( DS_LIST* pList, void* node );
BOOL		DSL_IsEOF( DS_LIST* pList, LPOSITION pos );
BOOL		DSL_IsBOF( DS_LIST* pList, LPOSITION pos );
LPOSITION	DSL_InsertBefore( DS_LIST* pList, LPOSITION pos, void* elem );
LPOSITION	DSL_InsertAfter( DS_LIST* pList, LPOSITION pos, void* elem );


#endif

⌨️ 快捷键说明

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