chain.h

来自「文件系统源代码!!!!! 文件系统源代码」· C头文件 代码 · 共 62 行

H
62
字号
/*** Copyright (C) 2008 Happy Fish / YuQing** FastDFS may be copied only under the terms of the GNU General* Public License V3, which may be found in the FastDFS source kit.* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.**/#ifndef CHAIN_H#define CHAIN_H#include "common_define.h"#define CHAIN_TYPE_INSERT	0#define CHAIN_TYPE_APPEND	1#define CHAIN_TYPE_SORTED	2typedef struct tagChainNode{	void *data;	struct tagChainNode *next;} ChainNode;typedef struct{	int type;	ChainNode *head;	ChainNode *tail;	FreeDataFunc freeDataFunc;	CompareFunc compareFunc;} ChainList;#ifdef __cplusplusextern "C" {#endifvoid chain_init(ChainList *pList, const int type, FreeDataFunc freeDataFunc, \		CompareFunc compareFunc);void chain_destroy(ChainList *pList);int chain_count(ChainList *pList);int addNode(ChainList *pList, void *data);void freeChainNode(ChainList *pList, ChainNode *pChainNode);void deleteNodeEx(ChainList *pList, ChainNode *pPreviousNode, \		ChainNode *pDeletedNode);void deleteToNodePrevious(ChainList *pList, ChainNode *pPreviousNode, \		ChainNode *pDeletedNext);int deleteOne(ChainList *pList, void *data);int deleteAll(ChainList *pList, void *data);void *chain_pop_head(ChainList *pList);int insertNodePrior(ChainList *pList, void *data);int appendNode(ChainList *pList, void *data);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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