/** * \file cf_list.h * * \author myusgun * * \brief 연결 리스트 * * \example list.c */ #ifndef __CF_LIST_H__ #define __CF_LIST_H__ #include "cf_base.h" /** 리스트 컨텍스트 (Opaque) */ typedef void * CF_List_Ctx; /** 리스트 탐색자 (Opaque) */ typedef void * CF_Traverser; /** 추가 위치 */ typedef enum { CF_DIRECTION_BEFORE, /**< traverser의 앞 */ CF_DIRECTION_AFTER /**< traverser의 뒤 */ } CF_DIRECTION; #ifdef __cplusplus extern "C" { #endif CF_EXPORT int CF_List_CreateCtx (CF_List_Ctx * ctx); CF_EXPORT int CF_List_DestroyCtx (CF_List_Ctx ctx); CF_EXPORT int CF_List_Front (CF_List_Ctx ctx, CF_Traverser * traverser); CF_EXPORT int CF_List_Rear (CF_List_Ctx ctx, CF_Traverser * traverser); CF_EXPORT int CF_List_Insert (CF_List_Ctx ctx, const CF_Traverser traverser, const CF_DIRECTION direction, const void * element); CF_EXPORT int CF_List_Remove (CF_List_Ctx ctx, CF_Traverser * traverser); CF_EXPORT int CF_List_RemoveAll (CF_List_Ctx ctx); CF_EXPORT int CF_List_GetElement (const CF_Traverser traverser, void ** element); CF_EXPORT int CF_List_Prev (CF_Traverser * traverser); CF_EXPORT int CF_List_Next (CF_Traverser * traverser); CF_EXPORT int CF_List_GetSize (CF_List_Ctx ctx); #ifdef __cplusplus } #endif #endif // #ifndef __CF_LIST_H__