source: libcf/trunk/include/cf_list.h@ 128

Last change on this file since 128 was 128, checked in by cheese, 11 years ago

#1 add bitwise util from ARIA of chevalier

File size: 1.4 KB
Line 
1/**
2 * \file cf_list.h
3 *
4 * \author myusgun <myusgun@gmail.com>
5 *
6 * \brief 연결 리스트
7 *
8 * \example list.c
9 */
10#ifndef __CF_LIST_H__
11#define __CF_LIST_H__
12
13#include "cf_base.h"
14
15/** 리스트 컨텍스트 (Opaque) */
16typedef void * CF_List_Ctx;
17
18/** 리스트 탐색자 (Opaque) */
19typedef void * CF_Traverser;
20
21/** 추가 위치 */
22typedef enum
23{
24 CF_DIRECTION_BEFORE, /**< traverser의 앞 */
25 CF_DIRECTION_AFTER /**< traverser의 뒤 */
26} CF_DIRECTION;
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32CF_EXPORT int
33CF_List_CreateCtx (CF_List_Ctx * ctx);
34
35CF_EXPORT int
36CF_List_DestroyCtx (CF_List_Ctx ctx);
37
38CF_EXPORT int
39CF_List_Front (CF_List_Ctx ctx,
40 CF_Traverser * traverser);
41
42CF_EXPORT int
43CF_List_Rear (CF_List_Ctx ctx,
44 CF_Traverser * traverser);
45
46CF_EXPORT int
47CF_List_Insert (CF_List_Ctx ctx,
48 const CF_Traverser traverser,
49 const CF_DIRECTION direction,
50 const void * element);
51
52CF_EXPORT int
53CF_List_Remove (CF_List_Ctx ctx,
54 CF_Traverser * traverser);
55
56CF_EXPORT int
57CF_List_RemoveAll (CF_List_Ctx ctx);
58
59CF_EXPORT int
60CF_List_GetElement (const CF_Traverser traverser,
61 void ** element);
62
63CF_EXPORT int
64CF_List_Prev (CF_Traverser * traverser);
65
66CF_EXPORT int
67CF_List_Next (CF_Traverser * traverser);
68
69CF_EXPORT int
70CF_List_GetSize (CF_List_Ctx ctx);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif // #ifndef __CF_LIST_H__
Note: See TracBrowser for help on using the repository browser.