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

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

#1 add typical data structure algorithms (linked-list / queue / stak) and rename symbol for context of each modules

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