?? doublelist.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 __DOUBLELIST_H__#define __DOUBLELIST_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef struct DOUBLELIST_st { DOUBLENODE *pHead; /* 第1個節點的指針 */ DOUBLENODE *pTail; /* 最后1個節點的指針 */
DOUBLENODE *pCur; /* 當前節點的指針 */ UINT uCount; /* 保存鏈表節點的個數 */} DOUBLELIST;/* create/destroy functions */DOUBLELIST * DoubleList_Create( void );void DoubleList_Destroy( DOUBLELIST * pList,
DESTROYFUNC DestroyFunc );/* insertion functions */
INT DoubleList_InsertHead( DOUBLELIST *pList, void *pData );INT DoubleList_InsertTail( DOUBLELIST *pList, void *pData );/* removal functions */void * DoubleList_PopHead( DOUBLELIST *pList );void * DoubleList_PopTail( DOUBLELIST *pList );INT DoubleList_RemoveMatches( DOUBLELIST *pList, COMPAREFUNC CompareFunc, void *pMatchData, DESTROYFUNC DestroyFunc );
INT DoubleList_Remove( DOUBLELIST *pList, void *pCur,
DESTROYFUNC DestroyFunc );/* retrieval functions */void * DoubleList_GetHead( DOUBLELIST *pList );void * DoubleList_GetTail( DOUBLELIST *pList );void * DoubleList_Find( DOUBLELIST *pList, void *pMatchData,
COMPAREFUNC CompareFunc );
void DoubleList_EnumBegin( DOUBLELIST *pList );
void * DoubleList_EnumNext( DOUBLELIST *pList );
DOUBLENODE * DoubleList_EnumNode( DOUBLELIST *pList );
DOUBLENODE * DoubleList_PopNode( DOUBLELIST *pList, DOUBLENODE *pNode );
/* miscellaneous functions */unsigned DoubleList_GetCount( DOUBLELIST *pList );DOUBLELIST * DoubleList_Copy( DOUBLELIST *pList, COPYFUNC CopyFunc );
/* sort functions */INT DoubleList_InsertSort( DOUBLELIST *pList,
COMPAREFUNC CompareFunc );
INT DoubleList_Merge( DOUBLELIST *pListA, DOUBLELIST *pListB,
COMPAREFUNC CompareFunc );
DOUBLELIST* DoubleList_Split( DOUBLELIST *pList, unsigned count );
INT DoubleList_MergeSort(DOUBLELIST *pList,
COMPAREFUNC CompareFunc,
UINT uInsertSortCount);
INT DoubleList_RadixSort( DOUBLELIST *pList,
UINT uRadix,
UINT uMaxKeyLen,
GETKEYFUNC GetKeyFunc );
/* traverse functions */
void DoubleList_Traverse( DOUBLELIST *pList, TRAVERSEFUNC TraverseFunc );
#define MAX_RADIX 1000
#ifdef __cplusplus
}
#endif
#endif /* __DOUBLELIST_H__ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -