Index: /trunk/docs/doxyfile
===================================================================
--- /trunk/docs/doxyfile	(revision 150)
+++ /trunk/docs/doxyfile	(revision 151)
@@ -39,5 +39,5 @@
 # a quick idea about the purpose of the project. Keep the description short.
 
-PROJECT_BRIEF          = CFLibrary
+PROJECT_BRIEF          = "CFLibrary (Cheese Foundation Library)"
 
 # With the PROJECT_LOGO tag one can specify an logo or icon that is 
@@ -53,5 +53,5 @@
 # where doxygen was started. If left blank the current directory will be used.
 
-OUTPUT_DIRECTORY       = ../documentation
+OUTPUT_DIRECTORY       = ../Documentation
 
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
Index: /trunk/include/cf_base.h
===================================================================
--- /trunk/include/cf_base.h	(revision 150)
+++ /trunk/include/cf_base.h	(revision 151)
@@ -10,6 +10,6 @@
  * \mainpage
 
-<h2 style="line-height: 10%;">Welcome to documentation page of libCF</h2>
-&nbsp; - CFLibrary (cheese's foundation library)
+<h2 style="line-height: 10%;">Welcome to documentation for libcf</h2>
+&nbsp; :: CFLibrary (Cheese Foundation Library)
 
 &nbsp; This documentation (suggested by nvdark) includes only manual of APIs.
@@ -40,4 +40,7 @@
 } CF_BOOL;
 
+/** 공용 건텍스트 */
+typedef void *	cf_ctx;
+
 /** 성공 시, 반환 값 */
 #define CF_OK							0
Index: /trunk/include/cf_error.h
===================================================================
--- /trunk/include/cf_error.h	(revision 150)
+++ /trunk/include/cf_error.h	(revision 151)
@@ -21,8 +21,10 @@
 #define CF_ERROR_FILE_READ					CF_ERROR_FILE - 3
 #define CF_ERROR_FILE_WRITE					CF_ERROR_FILE - 4
-#define CF_ERROR_FILE_CREATE				CF_ERROR_FILE - 5
+#define CF_ERROR_FILE_CREATE_CTX			CF_ERROR_FILE - 5
 #define CF_ERROR_FILE_CLOSE					CF_ERROR_FILE - 6
 #define CF_ERROR_FILE_GET_SIZE				CF_ERROR_FILE - 7
 #define CF_ERROR_FILE_MAKE_DIRECTORY		CF_ERROR_FILE - 8
+#define CF_ERROR_FILE_ALLOCATE_BUFFER		CF_ERROR_FILE - 9
+#define CF_ERROR_FILE_INVALID_CTX			CF_ERROR_FILE - 10
 /* }}} file */
 
@@ -47,5 +49,7 @@
 #define CF_ERROR_SOCKET_SEND				CF_ERROR_SOCKET - 16
 #define CF_ERROR_SOCKET_RECV				CF_ERROR_SOCKET - 17
-#define CF_ERROR_SOCKET_INTERNAL			CF_ERROR_SOCKET - 18
+#define CF_ERROR_SOCKET_CHECK_DESC_SET		CF_ERROR_SOCKET - 18
+#define CF_ERROR_SOCKET_INVALID_CTX			CF_ERROR_SOCKET - 19
+#define CF_ERROR_SOCKET_CREATE_CTX			CF_ERROR_SOCKET - 20
 /* }}} socket */
 
@@ -85,19 +89,12 @@
 #define CF_ERROR_LOG						CF_ERROR_BASE * 6
 /*------------------------------------------------------------*/
-#define CF_ERROR_LOG_INITIALIZE				CF_ERROR_LOG - 1
-#define CF_ERROR_LOG_INVALID_CTX			CF_ERROR_LOG - 2
-#define CF_ERROR_LOG_SET_MULTITHREAD		CF_ERROR_LOG - 3
-#define CF_ERROR_LOG_UNSET_MULTITHREAD		CF_ERROR_LOG - 4
-#define CF_ERROR_LOG_LOCK_CTX				CF_ERROR_LOG - 5
-#define CF_ERROR_LOG_UNLOCK_CTX				CF_ERROR_LOG - 6
-#define CF_ERROR_LOG_FLUSH					CF_ERROR_LOG - 7
-#define CF_ERROR_LOG_INVALID_MAPID			CF_ERROR_LOG - 8
-#define CF_ERROR_LOG_NOT_MAPPED_ID			CF_ERROR_LOG - 9
-#define CF_ERROR_LOG_ALREADY_MAPPED_ID		CF_ERROR_LOG - 10
-#define CF_ERROR_LOG_NOT_INITIALIZE			CF_ERROR_LOG - 11
-#define CF_ERROR_LOG_INVALID_ARGS			CF_ERROR_LOG - 12
-#define CF_ERROR_LOG_CREATE_CTX				CF_ERROR_LOG - 13
-#define CF_ERROR_LOG_CREATE_FILE			CF_ERROR_LOG - 14
-#define CF_ERROR_LOG_ALLOCATE_BUFFER		CF_ERROR_LOG - 15
+#define CF_ERROR_LOG_INVALID_CTX			CF_ERROR_LOG - 1
+#define CF_ERROR_LOG_SET_MULTITHREAD		CF_ERROR_LOG - 2
+#define CF_ERROR_LOG_UNSET_MULTITHREAD		CF_ERROR_LOG - 3
+#define CF_ERROR_LOG_FLUSH					CF_ERROR_LOG - 4
+#define CF_ERROR_LOG_INVALID_ARGS			CF_ERROR_LOG - 5
+#define CF_ERROR_LOG_CREATE_CTX				CF_ERROR_LOG - 6
+#define CF_ERROR_LOG_CREATE_FILE			CF_ERROR_LOG - 7
+#define CF_ERROR_LOG_ALLOCATE_BUFFER		CF_ERROR_LOG - 8
 /* }}} log */
 
@@ -128,3 +125,25 @@
 /* }}} bitwise */
 
+/* util {{{ */
+#define CF_ERROR_UTIL						CF_ERROR_BASE * 10
+/*------------------------------------------------------------*/
+#define CF_ERROR_UTIL_INVALID_ARGS			CF_ERROR_UTIL - 1
+/* }}} util */
+
+/* context-manager {{{ */
+#define CF_ERROR_CTXMGR						CF_ERROR_BASE * 11
+/*------------------------------------------------------------*/
+#define CF_ERROR_CTXMGR_INITIALIZE			CF_ERROR_CTXMGR - 1
+#define CF_ERROR_CTXMGR_FINALIZE			CF_ERROR_CTXMGR - 2
+#define CF_ERROR_CTXMGR_REGISTER			CF_ERROR_CTXMGR - 3
+#define CF_ERROR_CTXMGR_UNREGISTER			CF_ERROR_CTXMGR - 4
+#define CF_ERROR_CTXMGR_FIND_FIRST_CTX		CF_ERROR_CTXMGR - 5
+#define CF_ERROR_CTXMGR_FIND_CTX			CF_ERROR_CTXMGR - 6
+#define CF_ERROR_CTXMGR_CHECK_DUPLICATION	CF_ERROR_CTXMGR - 7
+#define CF_ERROR_CTXMGR_ALREADY_REGISTERED	CF_ERROR_CTXMGR - 8
+#define CF_ERROR_CTXMGR_NOT_REGISTERED		CF_ERROR_CTXMGR - 9
+#define CF_ERROR_CTXMGR_CREATE_POOL			CF_ERROR_CTXMGR - 10
+#define CF_ERROR_CTXMGR_GET					CF_ERROR_CTXMGR - 11
+/* }}} context-manager */
+
 #endif // #ifndef __CF_ERROR_H__
Index: /trunk/include/cf_file.h
===================================================================
--- /trunk/include/cf_file.h	(revision 150)
+++ /trunk/include/cf_file.h	(revision 151)
@@ -31,20 +31,18 @@
 
 CF_EXPORT int
-CF_File_Open			(const char			* path,
+CF_File_Open			(cf_ctx				* ctx,
+						 const char			* path,
 						 const CF_FILE_FLAG	flag);
 
 CF_EXPORT int
-CF_File_Create			(const char * path);
+CF_File_Close			(cf_ctx ctx);
 
 CF_EXPORT int
-CF_File_Close			(const int fd);
-
-CF_EXPORT int
-CF_File_Read			(const int		fd,
+CF_File_Read			(const cf_ctx	ctx,
 						 void			* buf,
 						 const size_t	len);
 
 CF_EXPORT int
-CF_File_Write			(const int		fd,
+CF_File_Write			(const cf_ctx	ctx,
 						 const void		* buf, 
 						 const size_t	len);
@@ -59,4 +57,8 @@
 CF_File_MakeDirectory	(const char * path);
 
+CF_EXPORT int
+CF_File_GetPath			(const cf_ctx	ctx,
+						 char			* path);
+
 #ifdef __cplusplus
 }
Index: /trunk/include/cf_list.h
===================================================================
--- /trunk/include/cf_list.h	(revision 150)
+++ /trunk/include/cf_list.h	(revision 151)
@@ -13,16 +13,6 @@
 #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;
+typedef cf_ctx	cf_traverser;
 
 #ifdef __cplusplus
@@ -31,42 +21,58 @@
 
 CF_EXPORT int
-CF_List_CreateCtx		(CF_List_Ctx * ctx);
+CF_List_Create			(cf_ctx * ctx);
 
 CF_EXPORT int
-CF_List_DestroyCtx		(CF_List_Ctx ctx);
+CF_List_Destroy			(cf_ctx ctx);
 
 CF_EXPORT int
-CF_List_Front			(CF_List_Ctx	ctx,
-						 CF_Traverser	* traverser);
+CF_List_Front			(cf_ctx			ctx,
+						 cf_traverser	* traverser);
 
 CF_EXPORT int
-CF_List_Rear			(CF_List_Ctx	ctx,
-						 CF_Traverser	* traverser);
+CF_List_Rear			(cf_ctx			ctx,
+						 cf_traverser	* traverser);
 
 CF_EXPORT int
-CF_List_Insert			(CF_List_Ctx		ctx,
-						 const CF_Traverser	traverser,
-						 const CF_DIRECTION	direction,
+CF_List_AddFront		(cf_ctx		ctx,
+						 const void	* element);
+
+CF_EXPORT int
+CF_List_AddRear			(cf_ctx		ctx,
+						 const void	* element);
+
+CF_EXPORT int
+CF_List_InsertBefore	(cf_ctx				ctx,
+						 const cf_traverser	traverser,
 						 const void			* element);
 
 CF_EXPORT int
-CF_List_Remove			(CF_List_Ctx	ctx,
-						 CF_Traverser	* traverser);
+CF_List_InsertAfter		(cf_ctx				ctx,
+						 const cf_traverser	traverser,
+						 const void			* element);
 
 CF_EXPORT int
-CF_List_RemoveAll		(CF_List_Ctx ctx);
+CF_List_Set				(cf_traverser	traverser,
+						 const void		* element);
 
 CF_EXPORT int
-CF_List_GetElement		(const CF_Traverser	traverser,
+CF_List_Get				(const cf_traverser	traverser,
 						 void				** element);
 
 CF_EXPORT int
-CF_List_Prev			(CF_Traverser * traverser);
+CF_List_Remove			(cf_ctx			ctx,
+						 cf_traverser	* traverser);
 
 CF_EXPORT int
-CF_List_Next			(CF_Traverser * traverser);
+CF_List_RemoveAll		(cf_ctx ctx);
 
 CF_EXPORT int
-CF_List_GetSize			(CF_List_Ctx ctx);
+CF_List_Prev			(cf_traverser * traverser);
+
+CF_EXPORT int
+CF_List_Next			(cf_traverser * traverser);
+
+CF_EXPORT int
+CF_List_GetSize			(cf_ctx ctx);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_log.h
===================================================================
--- /trunk/include/cf_log.h	(revision 150)
+++ /trunk/include/cf_log.h	(revision 151)
@@ -29,28 +29,24 @@
 
 CF_EXPORT int
-CF_Log_Initialize		(const int poolSize);
-
-CF_EXPORT int
-CF_Log_Finalize			(void);
-
-CF_EXPORT int
-CF_Log_Open				(const int	mapid,
+CF_Log_Create			(cf_ctx		* ctx,
 						 const char	* path,
 						 const int	memsize);
 
 CF_EXPORT int
-CF_Log_Close			(const int mapid);
+CF_Log_Destroy			(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Log_Write			(const int	mapid,
+CF_Log_Write			(cf_ctx		ctx,
 						 const char	* prefix,
 						 const char	* fmt, ...);
 
 CF_EXPORT int
-CF_Log_Flush			(const int mapid);
+CF_Log_Flush			(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Log_SetMT			(const int		mapid,
-						 const CF_BOOL	flag);
+CF_Log_SetMultiThread	(cf_ctx ctx);
+
+CF_EXPORT int
+CF_Log_UnsetMultiThread	(cf_ctx ctx);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_mutex.h
===================================================================
--- /trunk/include/cf_mutex.h	(revision 150)
+++ /trunk/include/cf_mutex.h	(revision 151)
@@ -5,6 +5,4 @@
  *
  * \brief 뮤텍스 지원
- *
- * \example thread.c
  */
 #ifndef __CF_MUTEX_H__
@@ -13,7 +11,4 @@
 #include "cf_base.h"
 
-/** 뮤텍스 컨텍스트 */
-typedef void *	CF_Mutex_Ctx;
-
 #ifdef __cplusplus
 extern "C" {
@@ -21,14 +16,14 @@
 
 CF_EXPORT int
-CF_Mutex_CreateCtx		(CF_Mutex_Ctx * ctx);
+CF_Mutex_Create			(cf_ctx * ctx);
 
 CF_EXPORT int
-CF_Mutex_DestoryCtx		(CF_Mutex_Ctx ctx);
+CF_Mutex_Destory		(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Mutex_Lock			(CF_Mutex_Ctx ctx);
+CF_Mutex_Lock			(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Mutex_Unlock			(CF_Mutex_Ctx ctx);
+CF_Mutex_Unlock			(cf_ctx ctx);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_queue.h
===================================================================
--- /trunk/include/cf_queue.h	(revision 150)
+++ /trunk/include/cf_queue.h	(revision 151)
@@ -13,7 +13,4 @@
 #include "cf_base.h"
 
-/** 큐 컨텍스트 (Opaque) */
-typedef void *	CF_Queue_Ctx;
-
 #ifdef __cplusplus
 extern "C" {
@@ -21,23 +18,23 @@
 
 CF_EXPORT int
-CF_Queue_CreateCtx		(CF_Queue_Ctx * ctx);
+CF_Queue_Create			(cf_ctx * ctx);
 
 CF_EXPORT int
-CF_Queue_DestroyCtx		(CF_Queue_Ctx ctx);
+CF_Queue_Destroy		(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Queue_Put			(CF_Queue_Ctx	ctx,
-						 const void		* element);
+CF_Queue_Put			(cf_ctx		ctx,
+						 const void	* element);
 
 CF_EXPORT int
-CF_Queue_Get			(CF_Queue_Ctx	ctx,
-						 void			** element);
+CF_Queue_Get			(cf_ctx	ctx,
+						 void	** element);
 
 CF_EXPORT int
-CF_Queue_Front			(CF_Queue_Ctx	ctx,
-						 void			** element);
+CF_Queue_Front			(cf_ctx	ctx,
+						 void	** element);
 
 CF_EXPORT int
-CF_Queue_GetSize		(CF_Queue_Ctx ctx);
+CF_Queue_GetSize		(cf_ctx ctx);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_socket.h
===================================================================
--- /trunk/include/cf_socket.h	(revision 150)
+++ /trunk/include/cf_socket.h	(revision 151)
@@ -16,12 +16,9 @@
 
 /** 타임아웃을 설정하지 않음 */
-#define CF_SOCKET_NO_TIMEOUT		-1
+#define CF_SOCKET_NO_TIMEOUT		0
 
 #ifdef __cplusplus
 extern "C" {
 #endif
-
-CF_EXPORT CF_BOOL
-CF_Socket_IsInitialized		(void);
 
 CF_EXPORT int
@@ -32,8 +29,35 @@
 
 CF_EXPORT int
-CF_Socket_Close				(const int sock);
+CF_Socket_Create			(cf_ctx * ctx);
 
 CF_EXPORT int
-CF_Socket_SetOption			(const int		sock,
+CF_Socket_Close				(cf_ctx ctx);
+
+CF_EXPORT int
+CF_Socket_Connect			(cf_ctx					ctx,
+							 const char				* ip,
+							 const unsigned short	port);
+
+CF_EXPORT int
+CF_Socket_Server			(cf_ctx					ctx,
+							 const unsigned short	port,
+							 const int				backlog);
+
+CF_EXPORT int
+CF_Socket_Accept			(const cf_ctx	ctx,
+							 cf_ctx			* client);
+
+CF_EXPORT int
+CF_Socket_Send				(const cf_ctx	ctx,
+							 const void		* buf,
+							 const size_t	len);
+
+CF_EXPORT int
+CF_Socket_Recv				(const cf_ctx	ctx,
+							 void			* buf,
+							 const size_t	len);
+
+CF_EXPORT int
+CF_Socket_SetOption			(const cf_ctx	ctx,
 							 const int		optname,
 							 const void		* optval,
@@ -41,46 +65,20 @@
 
 CF_EXPORT int
-CF_Socket_GetOption			(const int	sock,
-							 const int	optname,
-							 void		* optval,
-							 size_t		* optlen);
+CF_Socket_GetOption			(const cf_ctx	ctx,
+							 const int		optname,
+							 void			* optval,
+							 size_t			* optlen);
 
 CF_EXPORT int
-CF_Socket_Connect			(const char				* ip,
-							 const unsigned short	port);
+CF_Socket_SetTimeOut		(cf_ctx	ctx,
+							 int	timeout);
 
 CF_EXPORT int
-CF_Socket_ConnectTimeout	(const char				* ip,
-							 const unsigned short	port,
-							 const int				timeout);
+CF_Socket_GetIP				(const cf_ctx	ctx,
+							 char			* ip);
 
 CF_EXPORT int
-CF_Socket_Server			(const unsigned short	port,
-							 const int				backlog);
-
-CF_EXPORT int
-CF_Socket_Accept			(const int sock);
-
-CF_EXPORT int
-CF_Socket_Send				(const int		sock,
-							 const void		* buf,
-							 const size_t	len);
-
-CF_EXPORT int
-CF_Socket_SendTimeout		(const int		sock,
-							 const void		* buf,
-							 const size_t	len,
-							 const int		timeout);
-
-CF_EXPORT int
-CF_Socket_Recv				(const int		sock,
-							 void			* buf,
-							 const size_t	len);
-
-CF_EXPORT int
-CF_Socket_RecvTimeout		(const int		sock,
-							 void			* buf,
-							 const size_t	len,
-							 const int		timeout);
+CF_Socket_GetPort			(const cf_ctx	ctx,
+							 unsigned short	* port);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_stack.h
===================================================================
--- /trunk/include/cf_stack.h	(revision 150)
+++ /trunk/include/cf_stack.h	(revision 151)
@@ -13,7 +13,4 @@
 #include "cf_base.h"
 
-/** 스택 컨텍스트 (Opaque) */
-typedef void *	CF_Stack_Ctx;
-
 #ifdef __cplusplus
 extern "C" {
@@ -21,23 +18,23 @@
 
 CF_EXPORT int
-CF_Stack_CreateCtx		(CF_Stack_Ctx * ctx);
+CF_Stack_Create			(cf_ctx * ctx);
 
 CF_EXPORT int
-CF_Stack_DestroyCtx		(CF_Stack_Ctx ctx);
+CF_Stack_Destroy		(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Stack_Push			(CF_Stack_Ctx	ctx,
-						 const void		* element);
+CF_Stack_Push			(cf_ctx		ctx,
+						 const void	* element);
 
 CF_EXPORT int
-CF_Stack_Pop			(CF_Stack_Ctx	ctx,
-						 void			** element);
+CF_Stack_Pop			(cf_ctx	ctx,
+						 void	** element);
 
 CF_EXPORT int
-CF_Stack_Top			(CF_Stack_Ctx 	ctx,
-						 void			** element);
+CF_Stack_Top			(cf_ctx	ctx,
+						 void	** element);
 
 CF_EXPORT int
-CF_Stack_GetSize		(CF_Stack_Ctx ctx);
+CF_Stack_GetSize		(cf_ctx ctx);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_thread.h
===================================================================
--- /trunk/include/cf_thread.h	(revision 150)
+++ /trunk/include/cf_thread.h	(revision 151)
@@ -16,7 +16,4 @@
 typedef int (* CF_Thread_Function) (void *);
 
-/** 스레드 컨텍스트 */
-typedef void *	CF_Thread_Ctx;
-
 #ifdef __cplusplus
 extern "C" {
@@ -24,16 +21,16 @@
 
 CF_EXPORT int
-CF_Thread_CreateCtx		(CF_Thread_Ctx		* ctx,
+CF_Thread_Create		(cf_ctx				* ctx,
 						 CF_Thread_Function	callback,
 						 void				* arg);
 
 CF_EXPORT int
-CF_Thread_Start			(CF_Thread_Ctx ctx);
+CF_Thread_Start			(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Thread_DestroyCtx	(CF_Thread_Ctx ctx);
+CF_Thread_Destroy		(cf_ctx ctx);
 
 CF_EXPORT int
-CF_Thread_Join			(CF_Thread_Ctx ctx);
+CF_Thread_Join			(cf_ctx ctx);
 
 #ifdef __cplusplus
Index: /trunk/include/cf_util.h
===================================================================
--- /trunk/include/cf_util.h	(revision 151)
+++ /trunk/include/cf_util.h	(revision 151)
@@ -0,0 +1,48 @@
+/**
+ * \file cf_util.h
+ *
+ * \author myusgun <myusgun@gmail.com>
+ *
+ * \brief 유틸
+ *
+ * \example util.c
+ */
+#ifndef __CF_UTIL_H__
+#define __CF_UTIL_H__
+
+#include "cf_base.h"
+
+#define CF_UTIL_DATETIME_LENGTH	(sizeof ("0000-00-00 00:00:00.000") - 1)
+
+typedef struct __cf_util_datetime__
+{
+	int year;
+	int month;
+	int day;
+	int week; /* SUN:0 ~ SAT:6 */
+
+	int hour;
+	int min;
+	int sec;
+	int usec;
+} CF_UTIL_DATETIME;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+CF_EXPORT int
+CF_Util_GetSystemError		(void);
+
+CF_EXPORT int
+CF_Util_GetCurrentTime		(CF_UTIL_DATETIME * dt);
+
+CF_EXPORT int
+CF_Util_GetTimeString		(const CF_UTIL_DATETIME	* dt,
+							 char					* buffer);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // #ifndef __CF_UTIL_H__
Index: /trunk/makeinclude/platform.mk
===================================================================
--- /trunk/makeinclude/platform.mk	(revision 150)
+++ /trunk/makeinclude/platform.mk	(revision 151)
@@ -9,5 +9,5 @@
 DOXYGEN	:= $(shell which doxygen)
 
-DOXYGEN_OUTPUT_PATH	= ../documentation
+DOXYGEN_OUTPUT_PATH	= ../Documentation
 DOXYGEN_PATH		= ../docs
 DOXYGEN_FILE		= $(DOXYGEN_PATH)/doxyfile
@@ -16,5 +16,5 @@
 # set options
 #------------------------------------------------------------
-ifeq ($(DEBUG), YES)
+ifeq ($(DEBUG), yes)
 	DEFS = -D_DEBUG
 	FLAG = -g
Index: /trunk/makeinclude/userdefine.mk
===================================================================
--- /trunk/makeinclude/userdefine.mk	(revision 150)
+++ /trunk/makeinclude/userdefine.mk	(revision 151)
@@ -9,7 +9,7 @@
 # compile with debugging flag and definition
 # > YES or NO
-DEBUG			= YES
+DEBUG			= yes
 
 # create doxygen documents automatically
 # > YES or NO
-DOXYGEN_CREATE	= YES
+DOXYGEN_CREATE	= yes
Index: /trunk/src/cf_codec.c
===================================================================
--- /trunk/src/cf_codec.c	(revision 150)
+++ /trunk/src/cf_codec.c	(revision 151)
@@ -13,62 +13,10 @@
 #include <stdio.h>
 
+#define BASE64_PADDING_CHAR_INDEX	64
+
 #define ASSERT_ARGS(x)	\
 	if ((x))			\
 		return CF_ERROR_CODEC_INVALID_ARGS
 
-const static cf_byte g_ascii_HexDecode[] = {
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  00 -  15 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  16 -  31 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  32 -  47 */
-	 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',0x00,0x00,0x00,0x00,0x00,0x00,	/*  48 -  63 */
-	0x00, 'A', 'A', 'A', 'A', 'A', 'A',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  64 -  79 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  80 -  95 */
-	0x00, 'a', 'a', 'a', 'a', 'a', 'a',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  96 - 111 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 112 - 127 */
-	/* end of ascii character */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 128 - 143 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 144 - 159 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 160 - 175 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 176 - 191 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 192 - 207 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 208 - 223 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 224 - 239 */
-	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 240 - 255 */
-};
-
-const static char g_table_Base64Encode[] = {
-#define BASE64_PADDING_CHAR_INDEX	64
-	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',		/* 00 - 07 */
-	'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',		/* 08 - 15 */
-	'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',		/* 16 - 23 */
-	'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',		/* 24 - 31 */
-	'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',		/* 32 - 39 */
-	'o', 'p', 'q', 'r', 's', 't', 'u', 'v',		/* 40 - 47 */
-	'w', 'x', 'y', 'z', '0', '1', '2', '3',		/* 48 - 55 */
-	'4', '5', '6', '7', '8', '9', '+', '/',		/* 56 - 63 */
-	'='											/* padding */
-};
-
-const static cf_byte g_ascii_Base64Decode[] = {
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  00 -  15 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  16 -  31 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,  62,0xff,0xff,0xff,  63,	/*  32 -  47 */
-	  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,0xff,0xff,0xff,  64,0xff,0xff,	/*  48 -  63 */
-	0xff,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,	/*  64 -  79 */
-	  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,0xff,0xff,0xff,0xff,0xff,	/*  80 -  95 */
-	0xff,  26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,	/*  96 - 111 */
-	  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,0xff,0xff,0xff,0xff,0xff,	/* 112 - 127 */
-	/* end of ascii character */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 128 - 143 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 144 - 159 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 160 - 175 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 176 - 191 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 192 - 207 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 208 - 223 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 224 - 239 */
-	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/* 240 - 255 */
-};
-
-
 /**
  * hex-encode
@@ -88,23 +36,21 @@
 					 char			* hex)
 {
-	size_t	iter = 0;
-	size_t	hexlen = len * 2 + 1;
-
-	const cf_byte	* ptr = bin;
-
-	const static char	hexchar[] = {'0', '1', '2', '3',
-									 '4', '5', '6', '7',
-									 '8', '9', 'a', 'b',
-									 'c', 'd', 'e', 'f'};
+	const cf_byte	* src = bin;
+	char			* dst = hex;
+
+	const static char	hexenc[] = {
+		'0', '1', '2', '3', '4', '5', '6', '7',
+		'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+	};
 
 	ASSERT_ARGS (bin == NULL);
 	ASSERT_ARGS (hex == NULL);
 
-	for (iter = 0 ; iter < hexlen ; iter += 2, ptr++)
-	{
-		hex[iter    ] = hexchar[((*(ptr)) >> 4) & 0x0f];
-		hex[iter + 1] = hexchar[((*(ptr))     ) & 0x0f];
-	}
-	hex[hexlen - 1] = '\0';
+	for ( ; *src ; src++)
+	{
+		*dst++ = hexenc[((*src) >> 4) & 0x0f];
+		*dst++ = hexenc[((*src)     ) & 0x0f];
+	}
+	*dst = '\0';
 
 	return CF_OK;
@@ -114,5 +60,5 @@
  * hex-decode
  *
- * \return 성공 시, 디코딩된 바이너리 데이터의 길이; 실패 시, 오류 코드
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
  *
  * \param hex	16진수 문자열
@@ -129,48 +75,61 @@
 {
 	size_t		length = 0;	/* absolutely even-number */
-	size_t		iter = 0;
-	size_t		binlen = 0;
-
-	const char	* ptr = hex;
+
+	const char	* src = hex;
+	cf_byte		* dst = bin;
 	char		buf = 0;
 	cf_byte		val = 0;
 	cf_byte		asciiHex = 0;
 
+	const static cf_byte hexdec[] = {
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  00 -  07 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  08 -  15 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  16 -  23 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  24 -  31 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  32 -  39 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  40 -  47 */
+		 '0', '0', '0', '0', '0', '0', '0', '0',	/*  48 -  55 */
+		 '0', '0',0x00,0x00,0x00,0x00,0x00,0x00,	/*  56 -  63 */
+		0x00, 'A', 'A', 'A', 'A', 'A', 'A',0x00,	/*  64 -  71 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  71 -  79 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  80 -  87 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/*  88 -  95 */
+		0x00, 'a', 'a', 'a', 'a', 'a', 'a',0x00,	/*  96 - 103 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 104 - 111 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,	/* 112 - 119 */
+		0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00		/* 120 - 127 */
+	};
+
 	ASSERT_ARGS (hex == NULL);
 	ASSERT_ARGS (bin == NULL);
 	ASSERT_ARGS (len == NULL);
 
-	*len = 0;
-
-	for ( ; g_ascii_HexDecode[(int)*ptr] && *ptr ; ptr++, length++);
-
-	if (*ptr)
+	for ( ; hexdec[(int)*src] && *src ; src++, length++);
+
+	if (*src)
 		return CF_ERROR_CODEC_NOT_HEXSTRING;
 
-	binlen = length / 2;
-
-	for (iter = 0, ptr = hex ; *ptr ; iter++)
+	for (src = hex ; *src ; )
 	{
 		val = 0;	/* init/re-init docoding-buffer */
 
 		/* decode one character */
-#define DECODE_HEX(x)								\
-		do {										\
-		buf = *(x);									\
-		val = (cf_byte)(val << 4);			\
-		asciiHex = g_ascii_HexDecode[(int)buf];		\
-													\
-		val |=	(cf_byte)						\
+#define DECODE_HEX(x)					\
+		do {							\
+		buf = *(x);						\
+		val = (cf_byte)(val << 4);		\
+		asciiHex = hexdec[(int)buf];	\
+		\
+		val |=	(cf_byte)				\
 				(buf - asciiHex + (asciiHex == '0' ? 0 : 10));	\
 		} while (0)
 
 		/* decode one byte by decode two character */
-		DECODE_HEX (ptr++);
-		DECODE_HEX (ptr++);
-
-		bin[iter] = val;
-	}
-
-	* len = binlen;
+		DECODE_HEX (src++);
+		DECODE_HEX (src++);
+
+		*dst++ = val;
+	}
+	*len = length / 2;
 
 	return CF_OK;
@@ -196,4 +155,16 @@
 	const cf_byte	* src = bin;
 	char			* dst = base64;
+
+	const static char base64enc[] = {
+		'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',	/* 00 - 07 */
+		'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',	/* 08 - 15 */
+		'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',	/* 16 - 23 */
+		'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',	/* 24 - 31 */
+		'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',	/* 32 - 39 */
+		'o', 'p', 'q', 'r', 's', 't', 'u', 'v',	/* 40 - 47 */
+		'w', 'x', 'y', 'z', '0', '1', '2', '3',	/* 48 - 55 */
+		'4', '5', '6', '7', '8', '9', '+', '/',	/* 56 - 63 */
+		'='										/* padding */
+	};
 
 	ASSERT_ARGS (src == NULL);
@@ -207,31 +178,28 @@
 #define SEXTUPLE_E_6(__x)	(((__x[2])     ) & 0x3f)
 
-	for ( ; src - bin < len - 2 ; src += 3)
-	{
-		*dst++ = g_table_Base64Encode[SEXTUPLE_E_1 (src)];
-		*dst++ = g_table_Base64Encode[SEXTUPLE_E_2 (src)|
-									  SEXTUPLE_E_3 (src)];
-		*dst++ = g_table_Base64Encode[SEXTUPLE_E_4 (src)|
-									  SEXTUPLE_E_5 (src)];
-		*dst++ = g_table_Base64Encode[SEXTUPLE_E_6 (src)];
-	}
-
-	if (src - bin < len)
-	{
-		*dst++ = g_table_Base64Encode[SEXTUPLE_E_1 (src)];
+	for ( ; (size_t)(src - bin) < len - 2 ; src += 3)
+	{
+		*dst++ = base64enc[SEXTUPLE_E_1 (src)];
+		*dst++ = base64enc[SEXTUPLE_E_2 (src) | SEXTUPLE_E_3 (src)];
+		*dst++ = base64enc[SEXTUPLE_E_4 (src) | SEXTUPLE_E_5 (src)];
+		*dst++ = base64enc[SEXTUPLE_E_6 (src)];
+	}
+
+	if ((size_t)(src - bin) < len)
+	{
+		*dst++ = base64enc[SEXTUPLE_E_1 (src)];
 
 		if (src - bin == len - 1)
 		{
-			*dst++ = g_table_Base64Encode[SEXTUPLE_E_2 (src)];
-			*dst++ = g_table_Base64Encode[BASE64_PADDING_CHAR_INDEX];
+			*dst++ = base64enc[SEXTUPLE_E_2 (src)];
+			*dst++ = base64enc[BASE64_PADDING_CHAR_INDEX];
 		}
 		else
 		{
-			*dst++ = g_table_Base64Encode[SEXTUPLE_E_2 (src)|
-										  SEXTUPLE_E_3 (src)];
-			*dst++ = g_table_Base64Encode[SEXTUPLE_E_4 (src)];
+			*dst++ = base64enc[SEXTUPLE_E_2 (src) | SEXTUPLE_E_3 (src)];
+			*dst++ = base64enc[SEXTUPLE_E_4 (src)];
 		}
 
-		*dst++ = g_table_Base64Encode[BASE64_PADDING_CHAR_INDEX];
+		*dst++ = base64enc[BASE64_PADDING_CHAR_INDEX];
 	}
 	*dst = '\0';
@@ -243,5 +211,5 @@
  * Base64-decode
  *
- * \return 성공 시, 디코딩된 바이너리 데이터의 길이; 실패 시, 오류 코드
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
  *
  * \param base64	base64 문자열
@@ -259,6 +227,25 @@
 	const char	* src = base64;
 	cf_byte		* dst = bin;
-	int			remain = 0;
-	int			binlen = 0;
+	size_t		remain = 0;
+	size_t		binlen = 0;
+
+	const static cf_byte base64dec[] = {
+		0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  00 -  07 */
+		0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  08 -  15 */
+		0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  16 -  23 */
+		0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  24 -  31 */
+		0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,	/*  32 -  39 */
+		0xff,0xff,0xff,  62,0xff,0xff,0xff,  63,	/*  40 -  47 */
+		  52,  53,  54,  55,  56,  57,  58,  59,	/*  48 -  55 */
+		  60,  61,0xff,0xff,0xff,  64,0xff,0xff,	/*  56 -  63 */
+		0xff,   0,   1,   2,   3,   4,   5,   6,	/*  64 -  71 */
+	 	   7,   8,   9,  10,  11,  12,  13,  14,	/*  71 -  79 */
+		  15,  16,  17,  18,  19,  20,  21,  22,	/*  80 -  87 */
+		  23,  24,  25,0xff,0xff,0xff,0xff,0xff,	/*  88 -  95 */
+		0xff,  26,  27,  28,  29,  30,  31,  32,	/*  96 - 103 */
+	  	  33,  34,  35,  36,  37,  38,  39,  40,	/* 104 - 111 */
+		  41,  42,  43,  44,  45,  46,  47,  48,	/* 112 - 119 */
+		  49,  50,  51,0xff,0xff,0xff,0xff,0xff		/* 120 - 127 */
+	};
 
 	ASSERT_ARGS (src == NULL);
@@ -266,20 +253,18 @@
 	ASSERT_ARGS (len == NULL);
 
-	*len = 0;
-
-	while (g_ascii_Base64Decode[(int)*src] < BASE64_PADDING_CHAR_INDEX) src++;
+	while (base64dec[(int)*src] < BASE64_PADDING_CHAR_INDEX) src++;
 
 	if (*src == 0xff)
 		return CF_ERROR_CODEC_NOT_BASE64;
 
-	remain = (int)(src - base64);
+	remain = (size_t)(src - base64);
 	binlen = ((remain + 2/* max padding length */) / 4) * 3;
 
-#define SEXTUPLE_D_1(src)	(g_ascii_Base64Decode[(int)src[0]] << 2)
-#define SEXTUPLE_D_2(src)	(g_ascii_Base64Decode[(int)src[1]] >> 4)
-#define SEXTUPLE_D_3(src)	(g_ascii_Base64Decode[(int)src[1]] << 4)
-#define SEXTUPLE_D_4(src)	(g_ascii_Base64Decode[(int)src[2]] >> 2)
-#define SEXTUPLE_D_5(src)	(g_ascii_Base64Decode[(int)src[2]] << 6)
-#define SEXTUPLE_D_6(src)	(g_ascii_Base64Decode[(int)src[3]]     )
+#define SEXTUPLE_D_1(src)	(base64dec[(int)src[0]] << 2)
+#define SEXTUPLE_D_2(src)	(base64dec[(int)src[1]] >> 4)
+#define SEXTUPLE_D_3(src)	(base64dec[(int)src[1]] << 4)
+#define SEXTUPLE_D_4(src)	(base64dec[(int)src[2]] >> 2)
+#define SEXTUPLE_D_5(src)	(base64dec[(int)src[2]] << 6)
+#define SEXTUPLE_D_6(src)	(base64dec[(int)src[3]]     )
 
 	for (src = base64 ; remain > 4 ; remain -= 4, src += 4)
@@ -297,4 +282,6 @@
 		*dst++ = (cf_byte)(SEXTUPLE_D_5 (src) | SEXTUPLE_D_6 (src));
 
-	return binlen - (4 - remain);
-}
+	*len = binlen - (4 - remain);
+
+	return CF_OK;
+}
Index: /trunk/src/cf_debug.c
===================================================================
--- /trunk/src/cf_debug.c	(revision 150)
+++ /trunk/src/cf_debug.c	(revision 151)
@@ -28,9 +28,7 @@
 		return CF_ERROR_DEBUG_INVALID_CTX
 
-/** 디버그 컨텍스트 (Opaque) */
-typedef void *	CF_Debug_Ctx;
-
 /** 콜스택 인터페이스 */
-typedef struct cf_debug_callStack {
+typedef struct cf_debug_callStack
+{
 	char	file[NAME_LENGTH + 1];		/* *< 파일 이름 */
 	char	function[NAME_LENGTH + 1];	/* *< 함수 이름 */
@@ -50,14 +48,14 @@
 } CF_DEBUG_CALLSTACK;
 
-/** 디버그 컨텍스트 (CF_Debug_Ctx의 구현) */
+/** 디버그 컨텍스트 (cf_ctx의 구현) */
 typedef struct __cf_debug_ctx__
 {
-	int				fd;
-	CF_Mutex_Ctx	mutex;
+	int		fd;
+	cf_ctx	mutex;
 
 	CF_DEBUG_CALLSTACK	callstack;
-} CF_DEBUG_CTX;
-
-static CF_Debug_Ctx	gDebugSingleCtx = NULL;
+} CF_DEBUG_CONTEXT;
+
+static cf_ctx	gDebugSingleCtx = NULL;
 
 static int
@@ -187,15 +185,15 @@
  */
 static int
-CF_Debug_CallStackPush (CF_Debug_Ctx	ctx,
-						const char		* file,
-						const char		* func,
-						const int		line)
-{
-	CF_DEBUG_CTX		* context = (CF_DEBUG_CTX *) ctx;
+CF_Debug_CallStackPush (cf_ctx		ctx,
+						const char	* file,
+						const char	* func,
+						const int	line)
+{
+	CF_DEBUG_CONTEXT	* context = (CF_DEBUG_CONTEXT *) ctx;
 	CF_DEBUG_CALLSTACK	* push = NULL;
 
 	ASSERT_CTX (ctx);
 
-	push = (CF_DEBUG_CALLSTACK *) calloc (sizeof (CF_DEBUG_CALLSTACK), 1);
+	push = NEWCTX (CF_DEBUG_CALLSTACK);
 	if (push == NULL)
 		return CF_ERROR_DEBUG_PUSH_CALLSTACK;
@@ -223,8 +221,8 @@
  */
 static int
-CF_Debug_CallStackPeek (CF_Debug_Ctx		ctx,
+CF_Debug_CallStackPeek (cf_ctx				ctx,
 						CF_Debug_CallStack	* callstack)
 {
-	CF_DEBUG_CTX		* context = (CF_DEBUG_CTX *) ctx;
+	CF_DEBUG_CONTEXT	* context = (CF_DEBUG_CONTEXT *) ctx;
 	CF_DEBUG_CALLSTACK	* pop = NULL;
 
@@ -254,8 +252,8 @@
  */
 static int
-CF_Debug_CallStackPop (CF_Debug_Ctx			ctx,
+CF_Debug_CallStackPop (cf_ctx				ctx,
 					   CF_Debug_CallStack	* callstack)
 {
-	CF_DEBUG_CTX		* context = (CF_DEBUG_CTX *) ctx;
+	CF_DEBUG_CONTEXT	* context = (CF_DEBUG_CONTEXT *) ctx;
 	CF_DEBUG_CALLSTACK	* pop = NULL;
 
@@ -283,7 +281,7 @@
  */
 static int
-CF_Debug_DestroyCtx (CF_Debug_Ctx ctx)
-{
-	CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
+CF_Debug_Destroy (cf_ctx ctx)
+{
+	CF_DEBUG_CONTEXT * context = (CF_DEBUG_CONTEXT *) ctx;
 
 	ASSERT_CTX (ctx);
@@ -293,5 +291,5 @@
 
 	if (context->mutex)
-		CF_Mutex_DestoryCtx (context->mutex);
+		CF_Mutex_Destory (context->mutex);
 
 	free (context);
@@ -303,17 +301,18 @@
  * 디버그 컨텍스트를 생성
  *
- * \return 성공 시, CF_Debug_Ctx 형태의 컨텍스트; 실패 시, NULL
+ * \return 성공 시, cf_ctx 형태의 컨텍스트; 실패 시, NULL
  *
  * \param ctx 디버그 컨텍스트
  */
 static int
-CF_Debug_CreateCtx (CF_Debug_Ctx * ctx)
-{
-	int				result = 0;
-	CF_DEBUG_CTX	* context = NULL;
+CF_Debug_Create (cf_ctx * ctx)
+{
+	int result = 0;
+
+	CF_DEBUG_CONTEXT * context = NULL;
 
 	TRY
 	{
-		context = (CF_DEBUG_CTX *) calloc (sizeof (CF_DEBUG_CTX), 1);
+		context = NEWCTX (CF_DEBUG_CONTEXT);
 		if (context == NULL)
 		{
@@ -322,5 +321,5 @@
 		}
 
-		result = CF_Mutex_CreateCtx (&context->mutex);
+		result = CF_Mutex_Create (&context->mutex);
 		if (result < 0)
 		{
@@ -328,9 +327,9 @@
 		}
 
-		*ctx = (CF_Debug_Ctx) context;
+		*ctx = (cf_ctx) context;
 	}
 	CATCH_IF (result < 0)
 	{
-		CF_Debug_DestroyCtx (context);
+		CF_Debug_Destroy (context);
 	}
 
@@ -349,5 +348,5 @@
 
 	if (gDebugSingleCtx == NULL)
-		result = CF_Debug_CreateCtx (&gDebugSingleCtx);
+		result = CF_Debug_Create (&gDebugSingleCtx);
 
 	return result;
@@ -362,9 +361,9 @@
 CF_Debug_Finalize (void)
 {
-	CF_Debug_Ctx ctx = gDebugSingleCtx;
+	cf_ctx ctx = gDebugSingleCtx;
 
 	gDebugSingleCtx = NULL;
 
-	return CF_Debug_DestroyCtx (ctx);
+	return CF_Debug_Destroy (ctx);
 }
 
@@ -383,5 +382,5 @@
 						const int	line)
 {
-	CF_DEBUG_CTX * ctx = (CF_DEBUG_CTX *)gDebugSingleCtx;
+	CF_DEBUG_CONTEXT * ctx = (CF_DEBUG_CONTEXT *)gDebugSingleCtx;
 
 	ASSERT_CTX (ctx);
@@ -402,5 +401,5 @@
 CF_Debug_LeaveFunction (void)
 {
-	CF_DEBUG_CTX * ctx = (CF_DEBUG_CTX *)gDebugSingleCtx;
+	CF_DEBUG_CONTEXT * ctx = (CF_DEBUG_CONTEXT *)gDebugSingleCtx;
 
 	ASSERT_CTX (ctx);
@@ -425,5 +424,5 @@
 	int iter = 0;
 
-	CF_DEBUG_CTX		* ctx = gDebugSingleCtx;
+	CF_DEBUG_CONTEXT	* ctx = gDebugSingleCtx;
 	CF_DEBUG_CALLSTACK	* callstack = NULL;
 
Index: /trunk/src/cf_file.c
===================================================================
--- /trunk/src/cf_file.c	(revision 150)
+++ /trunk/src/cf_file.c	(revision 151)
@@ -11,4 +11,5 @@
 
 #include <stdio.h>
+#include <string.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -51,7 +52,18 @@
 #define FILE_MODE		S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH
 
+#define ASSERT_CTX(__ctx)	\
+	if (__ctx == NULL)		\
+		return CF_ERROR_FILE_INVALID_CTX
+
 #define ASSERT_ARGS(x)	\
 	if ((x))			\
 		return CF_ERROR_FILE_INVALID_ARGS
+
+typedef struct __cf_file_ctx__
+{
+	int				fd;
+	char			path[1024];
+	CF_FILE_FLAG	flag;
+} CF_FILE_CONTEXT;
 
 static int
@@ -73,6 +85,7 @@
  * 파일 열기
  *
- * \return 성공 시, 파일 디스크립터; 실패 시, 오류 코드
- *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	파일 컨텍스트
  * \param path	파일 경로
  * \param flag	파일 열기 플래그
@@ -81,17 +94,44 @@
  */
 int
-CF_File_Open (const char			* path,
+CF_File_Open (cf_ctx				* ctx,
+			  const char			* path,
 			  const CF_FILE_FLAG	flag)
 {
+	int fd = 0;
 	int result = 0;
 	int osflag = 0;
 
+	CF_FILE_CONTEXT * context = NULL;
+
+	ASSERT_CTX (ctx);
 	ASSERT_ARGS (path == NULL);
 
-	osflag = CF_File_Local_ConvertFlag (flag) | O_BINARY;
-
-	result = open (path, osflag, FILE_MODE);
-	if (result < 0)
-		return CF_ERROR_FILE_OPEN;
+	TRY
+	{
+		context = NEWCTX (CF_FILE_CONTEXT);
+		if (context == NULL)
+		{
+			result = CF_ERROR_FILE_CREATE_CTX;
+			TRY_BREAK;
+		}
+		context->flag = flag;
+		context->fd = -1;
+
+		osflag = CF_File_Local_ConvertFlag (flag) | O_BINARY;
+
+		fd = open (path, osflag, FILE_MODE);
+		if (fd < 0)
+		{
+			result = CF_ERROR_FILE_OPEN;
+			TRY_BREAK;
+		}
+		context->fd = fd;
+
+		*ctx = context;
+	}
+	CATCH_IF (result < 0)
+	{
+		CF_File_Close ((cf_ctx) context);
+	}
 
 	return result;
@@ -99,38 +139,24 @@
 
 /**
- * 파일 생성
- *
- * \return 성공 시, 파일 디스크립터; 실패 시, 오류 코드
- *
- * \param path 파일 경로
- */
-int
-CF_File_Create (const char * path)
-{
-	int			result = 0;
-	const int	flag = CF_FILE_CREATE|CF_FILE_WRITE|CF_FILE_TRUNC;
-	
-	ASSERT_ARGS (path == NULL);
-
-	result = CF_File_Open (path, flag);
-	if (result < 0)
-		return CF_ERROR_FILE_CREATE;
-
-	return result;
-}
-
-/**
  * 파일 닫기
  *
  * \return 성공 시, CF_OK; 실패 시, 오류 코드
  *
- * \param fd 파일 디스크립터
- */
-int
-CF_File_Close (const int fd)
-{
-	int result = 0;
-
-	ASSERT_ARGS (fd < 0);
+ * \param ctx	파일 컨텍스트
+ */
+int
+CF_File_Close (cf_ctx ctx)
+{
+	int result = 0;
+	int fd = 0;
+
+	CF_FILE_CONTEXT * context = (CF_FILE_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_ARGS (context->fd < 0);
+
+	fd = context->fd;
+
+	free (context);
 
 	result = close (fd);
@@ -146,19 +172,22 @@
  * \return 성공 시, 읽은 바이트 수; 실패 시, 오류 코드
  *
- * \param fd	파일 디스크립터
+ * \param ctx	파일 컨텍스트
  * \param buf	데이터를 저장할 메모리
  * \param len	데이터를 저장할 메모리의 크기
  */
 int
-CF_File_Read (const int		fd,
+CF_File_Read (const cf_ctx	ctx,
 			  void			* buf,
 			  const size_t	len)
 {
 	int result = 0;
-	
-	ASSERT_ARGS (fd < 0);
+
+	CF_FILE_CONTEXT * context = (CF_FILE_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_ARGS (context->fd < 0);
 	ASSERT_ARGS (buf == NULL);
 
-	result = (int) read (fd, buf, len);
+	result = (int) read (context->fd, buf, len);
 	if (result < 0)
 		return CF_ERROR_FILE_READ;
@@ -172,19 +201,22 @@
  * \return 성공 시, CF_OK; 실패 시, 오류 코드
  *
- * \param fd	파일 디스크립터
+ * \param ctx	파일 컨텍스트
  * \param buf	데이터가 저장된 메모리
  * \param len	쓸 데이터의 길이
  */
 int
-CF_File_Write (const int	fd,
+CF_File_Write (const cf_ctx	ctx,
 			   const void	* buf, 
 			   const size_t	len)
 {
 	int result = 0;
-	
-	ASSERT_ARGS (fd < 0);
+
+	CF_FILE_CONTEXT * context = (CF_FILE_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_ARGS (context->fd < 0);
 	ASSERT_ARGS (buf == NULL);
 
-	result = (int) write (fd, buf, len);
+	result = (int) write (context->fd, buf, len);
 	if (result != len)
 	  return CF_ERROR_FILE_WRITE;
@@ -206,7 +238,9 @@
 	int fd = 0;
 
+	CF_FILE_CONTEXT * context = NULL;
+
 	ASSERT_ARGS (path == NULL);
 
-	fd = CF_File_Open (path, CF_FILE_READ);
+	fd = CF_File_Open ((cf_ctx *)&context, path, CF_FILE_READ);
 	if (fd < 0)
 		return CF_ERROR_FILE_OPEN;
@@ -216,5 +250,5 @@
 		return CF_ERROR_FILE_GET_SIZE;
 
-	CF_File_Close (fd);
+	CF_File_Close ((cf_ctx)context);
 
 	return length;
@@ -245,13 +279,22 @@
 {
 	int		result = 0;
-	char	fullPath[1024] = {0x00,};
+	size_t	length = 0;
+	char	* fullpath = NULL;
 	char	stepPath[256] = {0x00,};
 
-	char	* f = fullPath;
-	char	* d = stepPath;
+	char	* f = NULL;
+	char	* d = NULL;
 
 	ASSERT_ARGS (path == NULL);
 
-	snprintf (fullPath, sizeof (fullPath) - 1, "%s%c", path, DELIMITER);
+	length = strlen (path);
+	fullpath = (char *) calloc (length + 2, 1);
+	if (!fullpath)
+		return CF_ERROR_FILE_ALLOCATE_BUFFER;
+
+	f = fullpath;
+	d = stepPath;
+
+	snprintf (fullpath, length + 1, "%s%c", path, DELIMITER);
 
 	for (*d++ = *f++ ; *f ; *d++ = *f++)
@@ -270,2 +313,24 @@
 	return CF_OK;
 }
+
+/**
+ * 컨텍스트가 열고 있는 파일의 경로를 가져옴
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	파일 컨텍스트
+ * \param path	파일 경로를 저장할 충분한 공간의 메모리
+ */
+int
+CF_File_GetPath (const cf_ctx	ctx,
+				 char			* path)
+{
+	CF_FILE_CONTEXT * context = (CF_FILE_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_ARGS (path == NULL);
+
+	snprintf (path, sizeof (context->path), "%s", context->path);
+
+	return CF_OK;
+}
Index: /trunk/src/cf_list.c
===================================================================
--- /trunk/src/cf_list.c	(revision 150)
+++ /trunk/src/cf_list.c	(revision 151)
@@ -24,5 +24,5 @@
 		return CF_ERROR_DS_INVALID_ARGS
 
-/** 리스트 노드 (CF_Traverser의 구현) */
+/** 리스트 노드 (cf_traverser의 구현) */
 typedef struct __cf_node__
 {
@@ -32,5 +32,5 @@
 } CF_NODE;
 
-/** 리스트 컨텍스트 (CF_List_Ctx의 구현) */
+/** 리스트 컨텍스트 (cf_ctx의 구현) */
 typedef struct __cf_list__
 {
@@ -48,15 +48,15 @@
  */
 int
-CF_List_CreateCtx (CF_List_Ctx * ctx)
+CF_List_Create (cf_ctx * ctx)
 {
 	CF_LIST_CONTEXT * context = NULL;
 
-	ASSERT_ARGS (ctx == NULL);
-
-	context = (CF_LIST_CONTEXT *) calloc (sizeof (CF_LIST_CONTEXT), 1);
+	ASSERT_CTX (ctx);
+
+	context = NEWCTX (CF_LIST_CONTEXT);
 	if (context == NULL)
 		return CF_ERROR_DS_CREATE_CTX;
 
-	*ctx = (CF_List_Ctx) context;
+	*ctx = (cf_ctx) context;
 
 	return CF_OK;
@@ -71,5 +71,5 @@
  */
 int
-CF_List_DestroyCtx (CF_List_Ctx ctx)
+CF_List_Destroy (cf_ctx ctx)
 {
 	CF_LIST_CONTEXT * context = (CF_LIST_CONTEXT *) ctx;
@@ -85,5 +85,5 @@
 
 /**
- * 리스트 탐색자(Traverser)를 Front 위치로 설정
+ * 리스트 탐색자(traverser)를 Front 위치로 설정
  *
  * \return 성공 시, CF_OK; 실패 시, 오류 코드
@@ -93,6 +93,6 @@
  */
 int
-CF_List_Front (CF_List_Ctx	ctx,
-			   CF_Traverser	* traverser)
+CF_List_Front (cf_ctx		ctx,
+			   cf_traverser	* traverser)
 {
 	CF_LIST_CONTEXT * context = (CF_LIST_CONTEXT *) ctx;
@@ -101,11 +101,11 @@
 	ASSERT_TRAVERSER (traverser);
 
-	*traverser = (CF_Traverser *) context->front;
-
-	return CF_OK;
-}
-
-/**
- * 리스트 탐색자(Traverser)를 Rear 위치로 설정
+	*traverser = (cf_traverser *) context->front;
+
+	return CF_OK;
+}
+
+/**
+ * 리스트 탐색자(traverser)를 Rear 위치로 설정
  *
  * \return 성공 시, CF_OK; 실패 시, 오류 코드
@@ -115,6 +115,6 @@
  */
 int
-CF_List_Rear (CF_List_Ctx	ctx,
-			  CF_Traverser	* traverser)
+CF_List_Rear (cf_ctx		ctx,
+			  cf_traverser	* traverser)
 {
 	CF_LIST_CONTEXT * context = (CF_LIST_CONTEXT *) ctx;
@@ -123,11 +123,59 @@
 	ASSERT_TRAVERSER (traverser);
 
-	*traverser = (CF_Traverser *) context->rear;
-
-	return CF_OK;
-}
-
-/**
- * 리스트에 새 데이터 삽입
+	*traverser = (cf_traverser *) context->rear;
+
+	return CF_OK;
+}
+
+/**
+ * 리스트 처음에 새 데이터 삽입
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		리스트 컨텍스트
+ * \param element	삽입할 데이터 주소
+ */
+int
+CF_List_AddFront (cf_ctx		ctx,
+				  const void	* element)
+{
+	int				result = 0;
+	cf_traverser	trav = NULL;
+
+	ASSERT_CTX (ctx);
+
+	result = CF_List_Front (ctx, &trav);
+	if (result < 0)
+		return result;
+
+	return CF_List_InsertBefore (ctx, trav, element);
+}
+
+/**
+ * 리스트 끝에 새 데이터 삽입
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		리스트 컨텍스트
+ * \param element	삽입할 데이터 주소
+ */
+int
+CF_List_AddRear (cf_ctx		ctx,
+				 const void	* element)
+{
+	int				result = 0;
+	cf_traverser	trav = NULL;
+
+	ASSERT_CTX (ctx);
+
+	result = CF_List_Rear (ctx, &trav);
+	if (result < 0)
+		return result;
+
+	return CF_List_InsertAfter (ctx, trav, element);
+}
+
+/**
+ * 리스트 탐색자(traverser)의 앞에 새 데이터 삽입
  *
  * \return 성공 시, CF_OK; 실패 시, 오류 코드
@@ -135,25 +183,18 @@
  * \param ctx		리스트 컨텍스트
  * \param traverser	리스트 탐색자
- * \param direction	탐색자의 전/후를 지정
  * \param element	삽입할 데이터 주소
- *
- * \remarks
- * traverser가 NULL일 때,
- * direction이 CF_DIRECTION_BEFORE라면 Front 위치이고
- * direction이 CF_DIRECTION_AFTER라면 Rear 위치에 삽입
- */
-int
-CF_List_Insert (CF_List_Ctx			ctx,
-				const CF_Traverser	traverser,
-				const CF_DIRECTION	direction,
-				const void			* element)
+ */
+int
+CF_List_InsertBefore (cf_ctx				ctx,
+					  const cf_traverser	traverser,
+					  const void			* element)
 {
 	CF_LIST_CONTEXT	* context = (CF_LIST_CONTEXT *) ctx;
-	CF_NODE		* node = NULL;
-	CF_NODE		* newnode = NULL;
-
-	ASSERT_CTX (ctx);
-
-	newnode = (CF_NODE *) calloc (sizeof (CF_NODE), 1);
+	CF_NODE			* node = NULL;
+	CF_NODE			* newnode = NULL;
+
+	ASSERT_CTX (ctx);
+
+	newnode = NEWCTX (CF_NODE);
 	if (newnode == NULL)
 		return CF_ERROR_DS_CREATE_NODE;
@@ -169,36 +210,71 @@
 		}
 
-		if (direction == CF_DIRECTION_BEFORE)
+		node = traverser ? (CF_NODE *) traverser : context->front;
+
+		newnode->next = node;
+		if (node)
 		{
-			node = traverser ? (CF_NODE *) traverser : context->front;
-
-			newnode->next = node;
-			if (node)
-			{
-				newnode->prev = node->prev;
-				node->prev  = newnode;
-				if (newnode->prev)
-					newnode->prev->next = newnode;
-			}
-
-			if (node == context->front)
-				context->front = newnode;
+			newnode->prev = node->prev;
+			node->prev  = newnode;
+			if (newnode->prev)
+				newnode->prev->next = newnode;
 		}
-		else /* if (direction == CF_DIRECTION_AFTER) */
+
+		if (node == context->front)
+			context->front = newnode;
+	} NO_CATCH;
+
+	context->size++;
+
+	return CF_OK;
+}
+
+/**
+ * 리스트 탐색자(traverser)의 뒤에 새 데이터 삽입
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		리스트 컨텍스트
+ * \param traverser	리스트 탐색자
+ * \param element	삽입할 데이터 주소
+ */
+int
+CF_List_InsertAfter (cf_ctx				ctx,
+					 const cf_traverser	traverser,
+					 const void			* element)
+{
+	CF_LIST_CONTEXT	* context = (CF_LIST_CONTEXT *) ctx;
+	CF_NODE			* node = NULL;
+	CF_NODE			* newnode = NULL;
+
+	ASSERT_CTX (ctx);
+
+	newnode = NEWCTX (CF_NODE);
+	if (newnode == NULL)
+		return CF_ERROR_DS_CREATE_NODE;
+
+	newnode->element = (void *) element;
+
+	TRY
+	{
+		if (CF_List_GetSize (ctx) == 0)
 		{
-			node = traverser ? (CF_NODE *) traverser : context->rear;
-
-			newnode->prev = node;
-			if (node)
-			{
-				newnode->next = node->next;
-				node->next = newnode;
-				if (newnode->next)
-					newnode->next->prev = newnode;
-			}
-
-			if (node == context->rear)
-				context->rear = newnode;
+			context->front = context->rear = newnode;
+			TRY_BREAK;
 		}
+
+		node = traverser ? (CF_NODE *) traverser : context->rear;
+
+		newnode->prev = node;
+		if (node)
+		{
+			newnode->next = node->next;
+			node->next = newnode;
+			if (newnode->next)
+				newnode->next->prev = newnode;
+		}
+
+		if (node == context->rear)
+			context->rear = newnode;
 	} NO_CATCH;
 
@@ -209,4 +285,47 @@
 
 /**
+ * 리스트 탐색자(traverser)의 자리에 새 데이터 삽입
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param traverser	리스트 탐색자
+ * \param element	할당할 데이터 주소
+ */
+int
+CF_List_Set (const cf_traverser	traverser,
+			 const void			* element)
+{
+	CF_NODE * node = (CF_NODE *) traverser;
+
+	ASSERT_TRAVERSER (traverser);
+
+	node->element = (void *) element;
+
+	return CF_OK;
+}
+
+/**
+ * 탐색자 위치의 데이터를 가져옴
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param traverser 리스트 탐색자
+ * \param element	데이터 주소
+ */
+int
+CF_List_Get (const cf_traverser	traverser,
+			 void				** element)
+{
+	CF_NODE * node = (CF_NODE *) traverser;
+
+	ASSERT_TRAVERSER (traverser);
+	ASSERT_ARGS (element == NULL);
+
+	*element = node->element;
+
+	return CF_OK;
+}
+
+/**
  * 리스트에서 탐색자 위치의 항목을 삭제
  *
@@ -217,6 +336,6 @@
  */
 int
-CF_List_Remove (CF_List_Ctx		ctx,
-				CF_Traverser	* traverser)
+CF_List_Remove (cf_ctx			ctx,
+				cf_traverser	* traverser)
 {
 	CF_LIST_CONTEXT	* context = (CF_LIST_CONTEXT *) ctx;
@@ -263,7 +382,7 @@
  */
 int
-CF_List_RemoveAll (CF_List_Ctx ctx)
-{
-	CF_Traverser traverser = NULL;
+CF_List_RemoveAll (cf_ctx ctx)
+{
+	cf_traverser traverser = NULL;
 
 	ASSERT_CTX (ctx);
@@ -279,26 +398,4 @@
 
 /**
- * 탐색자 위치의 데이터를 가져옴
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param traverser 리스트 탐색자
- * \param element	데이터 주소
- */
-int
-CF_List_GetElement (const CF_Traverser	traverser,
-					void				** element)
-{
-	CF_NODE * node = (CF_NODE *) traverser;
-
-	ASSERT_TRAVERSER (traverser);
-	ASSERT_ARGS (element == NULL);
-
-	*element = node->element;
-
-	return CF_OK;
-}
-
-/**
  * 탐색자 위치를 이전으로 이동
  *
@@ -308,5 +405,5 @@
  */
 int
-CF_List_Prev (CF_Traverser * traverser)
+CF_List_Prev (cf_traverser * traverser)
 {
 	CF_NODE * node = (CF_NODE *) *traverser;
@@ -316,5 +413,5 @@
 
 	node = node->prev;
-	*traverser = (CF_Traverser *) node;
+	*traverser = (cf_traverser *) node;
 	if (node == NULL)
 		return CF_ERROR_DS_NO_MORE;
@@ -331,5 +428,5 @@
  */
 int
-CF_List_Next (CF_Traverser * traverser)
+CF_List_Next (cf_traverser * traverser)
 {
 	CF_NODE * node = (CF_NODE *) *traverser;
@@ -339,5 +436,5 @@
 
 	node = node->next;
-	*traverser = (CF_Traverser *) node;
+	*traverser = (cf_traverser *) node;
 	if (node == NULL)
 		return CF_ERROR_DS_NO_MORE;
@@ -354,5 +451,5 @@
  */
 int
-CF_List_GetSize (CF_List_Ctx ctx)
+CF_List_GetSize (cf_ctx ctx)
 {
 	CF_LIST_CONTEXT * context = (CF_LIST_CONTEXT *) ctx;
Index: /trunk/src/cf_local.h
===================================================================
--- /trunk/src/cf_local.h	(revision 150)
+++ /trunk/src/cf_local.h	(revision 151)
@@ -6,4 +6,6 @@
 #ifndef __CF_LOCAL_H__
 #define __CF_LOCAL_H__
+
+#include <stdlib.h>
 
 /** 파일 이름 및 경로 길이 */
@@ -18,4 +20,12 @@
 #define CATCH_ELSE				else
 
+/**
+ * 유틸 매크로
+ *
+ * \remarks
+ * header는 별도로 include 해야 함
+ */
+#define NEWCTX(__ctx)			((__ctx *) calloc (sizeof (__ctx), 1))
+
 /** non-compatible function */
 #if defined(_WIN32) || defined(_WIN64)
Index: /trunk/src/cf_log.c
===================================================================
--- /trunk/src/cf_log.c	(revision 150)
+++ /trunk/src/cf_log.c	(revision 151)
@@ -19,4 +19,5 @@
 #include "cf_local.h"
 #include "cf_error.h"
+#include "cf_util.h"
 
 #include <stdio.h>
@@ -29,6 +30,7 @@
 # include <Windows.h>
 #else
-# include <sys/time.h>
 #endif
+
+#define LOG_BUFFER_DEFAULT_SIZE			128 * 1024
 
 #define ASSERT_CTX(__ctx)	\
@@ -36,153 +38,23 @@
 		return CF_ERROR_LOG_INVALID_CTX
 
-#define ASSERT_INIT()					\
-	if (gLogPool.ctxPool == NULL	||	\
-		gLogPool.poolSize <= 0		)	\
-		return CF_ERROR_LOG_NOT_INITIALIZE
-
-#define ASSERT_MAPID(__mapid)			\
-	if (gLogPool.poolSize <= __mapid)	\
-		return CF_ERROR_LOG_INVALID_MAPID
-
-#define ASSERT_MAPPED_CTX(__mapid)			\
-	if (gLogPool.ctxPool[__mapid] != NULL)	\
-		return CF_ERROR_LOG_ALREADY_MAPPED_ID
-
-#define ASSERT_NOT_MAPPED_CTX(__mapid)		\
-	if (gLogPool.ctxPool[__mapid] == NULL)	\
-		return CF_ERROR_LOG_NOT_MAPPED_ID
-
-#define LOG_BUFFER_DEFAULT_SIZE			128 * 1024
-
-#define LOG_DATETIME_LENGTH				sizeof ("0000-00-00 00:00:00.000") - 1
-
-/** 로그 컨텍스트 (Opaque) */
-typedef void *	CF_Log_Ctx;
-
-typedef struct __cf_util_datetime__
-{
-	int year;
-	int month;
-	int day;
-	int week; /* SUN:0 ~ SAT:6 */
-
-	int hour;
-	int min;
-	int sec;
-	int usec;
-} CF_LOG_DATETIME;
-
-/** 로그 컨텍스트 (CF_Log_Ctx의 구현) */
+#define ASSERT_ARGS(x)	\
+	if ((x))			\
+		return CF_ERROR_LOG_INVALID_ARGS
+
+/** 로그 컨텍스트 (cf_ctx의 구현) */
 typedef struct __cf_log_ctx__
 {
 	char			path[NAME_LENGTH + 1];
-	int				fd;
+	cf_ctx			file;
 	char			* buffer;
 	size_t			size;	/* entire size of buffer */
 	size_t			length; /* data length in current */
-	CF_Mutex_Ctx	mutex;
+	cf_ctx	mutex;
 } CF_LOG_CONTEXT;
-
-typedef struct __cf_log_array__
-{
-	CF_Log_Ctx	* ctxPool;
-	int			poolSize;
-} CF_LOG_POOL;
-
-static CF_LOG_POOL	gLogPool;
-
-#if defined(_WIN32) || defined(_WIN64)
-/* {{{ */
-struct timezone
-{
-	int tz_minuteswest;	/* minutes W of Greenwich */
-	int tz_dsttime;		/* type of dst correction */
-};
-
-int gettimeofday (struct timeval *tv, struct timezone *tz)
-{
-	FILETIME			ft;
-	unsigned __int64	buf =0;
-	//static int tzflag = 0;
-
-	if (NULL != tv)
-	{
-		GetSystemTimeAsFileTime (&ft);
-
-		buf |=	ft.dwHighDateTime;
-		buf <<=	32;
-		buf |=	ft.dwLowDateTime;
-
-		if (buf)
-		{
-			buf /= 10;
-			buf -= ((369 * 365 + 89) * (unsigned __int64) 86400) * 1000000;
-		}
-
-		tv->tv_sec = (long)(buf / 1000000UL);
-		tv->tv_usec = (long)(buf % 1000000UL);
-	}
-
-	/*
-	if (NULL != tz)
-	{
-		if (!tzflag)
-		{
-			_tzset();
-			tzflag++;
-		}
-
-		// Adjust for the timezone west of Greenwich
-		tz->tz_minuteswest = _timezone / 60;
-		tz->tz_dsttime = _daylight;
-	}
-	*/
-
-	return 0;
-}
-/* }}} */
-#endif
-
-static int
-CF_Log_Local_GetTime (CF_LOG_DATETIME * dt)
-{
-	struct timeval	timeVal;
-	struct tm		* timeSt;
-
-	gettimeofday (&timeVal, NULL);
-	timeSt = localtime ((const time_t *)&timeVal.tv_sec);
-
-	dt->year	= timeSt->tm_year + 1900;
-	dt->month	= timeSt->tm_mon + 1;
-	dt->day		= timeSt->tm_mday;
-	dt->week	= timeSt->tm_wday;
-
-	dt->hour	= timeSt->tm_hour;
-	dt->min		= timeSt->tm_min;
-	dt->sec		= timeSt->tm_sec;
-
-	dt->usec	= (int) timeVal.tv_usec;
-
-	return CF_OK;
-}
-
-static int
-CF_Log_Local_GetTimeString (char * buffer)
-{
-	CF_LOG_DATETIME dt;
-	CF_Log_Local_GetTime (&dt);
-
-	snprintf (buffer, LOG_DATETIME_LENGTH,
-			  "%04d-%02d-%02d %02d:%02d:%02d.%03d",
-			  dt.year, dt.month, dt.day,
-			  dt.hour, dt.min, dt.sec, dt.usec);
-
-	return CF_OK;
-}
 
 static int
 CF_Log_Local_Flush (CF_LOG_CONTEXT * ctx)
 {
-	if (CF_File_Write (ctx->fd, ctx->buffer, ctx->length) < 0)
+	if (CF_File_Write (ctx->file, ctx->buffer, ctx->length) < 0)
 		return CF_ERROR_LOG_FLUSH;
 
@@ -208,17 +80,21 @@
 				   const size_t		demandSize)
 {
-	int result = CF_OK;
+	int result = 0;
+
+	size_t writeSize;
+	size_t remainSize;
 
 	if (ctx->size > 0) /* 버퍼단위 버퍼링.... */
 	{
-		size_t writeSize;
-		size_t remainSize;
-
 		remainSize = demandSize;
 		while (remainSize)
 		{
-			writeSize = (ctx->size - ctx->length) < remainSize ? (ctx->size - ctx->length) : remainSize;
-
-			memcpy (ctx->buffer + ctx->length, buffer + demandSize - remainSize, writeSize);
+			writeSize = (ctx->size - ctx->length) < remainSize
+					  ? (ctx->size - ctx->length)
+					  : remainSize;
+
+			memcpy (ctx->buffer + ctx->length,
+					buffer + demandSize - remainSize,
+					writeSize);
 			ctx->length += writeSize;
 
@@ -247,12 +123,12 @@
  * \param ctx 로그 컨텍스트
  */
-static int
-CF_Log_SetMultiThread (CF_Log_Ctx ctx)
-{
-	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
-
-	ASSERT_CTX (ctx);
-
-	if (CF_Mutex_CreateCtx (&context->mutex) < 0)
+int
+CF_Log_SetMultiThread (cf_ctx ctx)
+{
+	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
+
+	ASSERT_CTX (ctx);
+
+	if (CF_Mutex_Create (&context->mutex) < 0)
 		return CF_ERROR_LOG_SET_MULTITHREAD;
 
@@ -267,12 +143,12 @@
  * \param ctx 로그 컨텍스트
  */
-static int
-CF_Log_UnsetMultiThread (CF_Log_Ctx ctx)
-{
-	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
-
-	ASSERT_CTX (ctx);
-
-	if (CF_Mutex_DestoryCtx (context->mutex) < 0)
+int
+CF_Log_UnsetMultiThread (cf_ctx ctx)
+{
+	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
+
+	ASSERT_CTX (ctx);
+
+	if (CF_Mutex_Destory (context->mutex) < 0)
 		return CF_ERROR_LOG_UNSET_MULTITHREAD;
 
@@ -293,19 +169,21 @@
  */
 static int
-CF_Log_Local_WriteVA (CF_Log_Ctx	ctx,
-					  const char	* prefix,
-					  const char	* fmt,
-					  va_list		valist)
+CF_Log_Local_WriteVA (CF_LOG_CONTEXT	* context,
+					  const char		* prefix,
+					  const char		* fmt,
+					  va_list			valist)
 {
 #define BUF_LEN	16 * 1024
-	CF_LOG_CONTEXT	* context = (CF_LOG_CONTEXT *) ctx;
-	char		buffer[BUF_LEN + 1] = {0x00,};
-	char		datetime[LOG_DATETIME_LENGTH + 1] = {0x00,};
-	int			length = 0;
-	int			result = 0;
-
-	ASSERT_CTX (ctx);
-
-	CF_Log_Local_GetTimeString (datetime);
+	char	buffer[BUF_LEN + 1] = {0x00,};
+	char	datetime[CF_UTIL_DATETIME_LENGTH + 1] = {0x00,};
+	int		length = 0;
+	int		result = 0;
+
+	CF_UTIL_DATETIME dt;
+
+	ASSERT_CTX (context);
+
+	CF_Util_GetCurrentTime (&dt);
+	CF_Util_GetTimeString (&dt, datetime);
 	length = snprintf (buffer, BUF_LEN, "[%s][%s] ", datetime, prefix);
 	vsnprintf (&buffer[length], BUF_LEN - (size_t)length, fmt, valist);
@@ -329,13 +207,15 @@
  */
 int
-CF_Log_WriteCtx (CF_Log_Ctx	ctx,
-				 const char	* prefix,
-				 const char	* fmt, ...)
-{
+CF_Log_Write (cf_ctx		ctx,
+			  const char	* prefix,
+			  const char	* fmt, ...)
+{
+	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
+
 	int		result = 0;
 	va_list	valist;
 
 	va_start (valist, fmt);
-	result = CF_Log_Local_WriteVA (ctx, prefix, fmt, valist);
+	result = CF_Log_Local_WriteVA (context, prefix, fmt, valist);
 	va_end (valist);
 
@@ -350,9 +230,10 @@
  * \param ctx 로그 컨텍스트
  */
-static int
-CF_Log_FlushCtx (CF_Log_Ctx ctx)
-{
-	CF_LOG_CONTEXT	* context = (CF_LOG_CONTEXT *) ctx;
-	int			result = 0;
+int
+CF_Log_Flush (cf_ctx ctx)
+{
+	int result = 0;
+
+	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
 
 	ASSERT_CTX (ctx);
@@ -372,6 +253,6 @@
  * \param ctx 로그 컨텍스트
  */
-static int
-CF_Log_DestroyCtx (CF_Log_Ctx ctx)
+int
+CF_Log_Destroy (cf_ctx ctx)
 {
 	CF_LOG_CONTEXT * context = (CF_LOG_CONTEXT *) ctx;
@@ -381,5 +262,5 @@
 	if (context->size > 0)
 	{
-		CF_Log_FlushCtx (ctx);
+		CF_Log_Flush (ctx);
 		free (context->buffer);
 		context->buffer = NULL;
@@ -387,8 +268,10 @@
 	}
 
-	CF_File_Close (context->fd);
-
-	CF_Mutex_DestoryCtx (context->mutex);
+	CF_File_Close (context->file);
+
+	CF_Mutex_Destory (context->mutex);
 	context->mutex = NULL;
+
+	free (context);
 
 	return CF_OK;
@@ -406,8 +289,8 @@
  * \see CF_LOG_DEFAULT_BUFFER, CF_LOG_NO_BUFFER
  */
-static int
-CF_Log_CreateCtx (CF_Log_Ctx	* ctx,
-				  const char	* path,
-				  const int		memsize)
+int
+CF_Log_Create (cf_ctx		* ctx,
+			   const char	* path,
+			   const int	memsize)
 {
 	int result = 0;
@@ -417,12 +300,12 @@
 			 : memsize;
 
-	CF_LOG_CONTEXT	* context = NULL;
-
-	if (path == NULL)
-		return CF_ERROR_LOG_INVALID_ARGS;
+	CF_LOG_CONTEXT * context = NULL;
+
+	ASSERT_CTX (ctx);
+	ASSERT_ARGS (path == NULL);
 
 	TRY
 	{
-		context = (CF_LOG_CONTEXT *) calloc (sizeof (CF_LOG_CONTEXT), 1);
+		context = NEWCTX (CF_LOG_CONTEXT);
 		if (context == NULL)
 		{
@@ -431,11 +314,11 @@
 		}
 
-		context->fd = CF_File_Open (path, fileFlag);
-		if (context->fd < 0)
+		result = CF_File_Open (&context->file, path, fileFlag);
+		if (result < 0)
 		{
 			result = CF_ERROR_LOG_CREATE_FILE;
 			TRY_BREAK;
 		}
-		snprintf (context->path, sizeof (context->path) -1, "%s", path);
+		snprintf (context->path, sizeof (context->path) - 1, "%s", path);
 
 		if (size > 0)
@@ -450,249 +333,11 @@
 		}
 
-		*ctx = (CF_Log_Ctx) context;
+		*ctx = (cf_ctx) context;
 	}
 	CATCH_IF (result < 0)
 	{
-		CF_Log_DestroyCtx ((CF_Log_Ctx) context);
-	}
-
-	return result;
-}
-
-/**
- * 로그 컨텍스트에 아이디 넘버 할당<br />
- * 로그 기록 시, 아이디 넘버를 사용하면 해당 로그로 기록할 수 있음
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid	부여할 아이디 넘버
- * \param ctx	로그 컨텍스트
- *
- * \remarks 반드시 먼저 초기화 해야하며, 초기화 시에 주어진 번호보다 작은 아이디 넘버를 사용
- */
-static int
-CF_Log_MapCtxID (const int			mapid,
-				 const CF_Log_Ctx	ctx)
-{
-	ASSERT_INIT ();
-	ASSERT_MAPID (mapid);
-	ASSERT_MAPPED_CTX (mapid);
-
-	gLogPool.ctxPool[mapid] = ctx;
-
-	return CF_OK;
-}
-
-/**
- * 아이디 넘버에 해당하는 로그를 닫고 해당하는 컨텍스트를 해제
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid 로그의 아이디 넘버
- *
- * \remarks 아이디 넘버에 해당하는 컨텍스트가 해제되므로 주의
- */
-static int
-CF_Log_UnmapCtxID (const int mapid)
-{
-	ASSERT_INIT ();
-	ASSERT_MAPID (mapid);
-	ASSERT_NOT_MAPPED_CTX (mapid);
-
-	CF_Log_DestroyCtx (gLogPool.ctxPool[mapid]);
-
-	free (gLogPool.ctxPool[mapid]);
-	gLogPool.ctxPool[mapid] = NULL;
-
-	return CF_OK;
-}
-
-/**
- * 아이디 넘버에 해당하는 로그 컨텍스트를 얻기
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid	로그의 아이디 넘버
- * \param ctx	로그 컨텍스트 받을 주소
- */
-static int
-CF_Log_GetMappedCtx (const int	mapid,
-					 CF_Log_Ctx	* ctx)
-{
-	ASSERT_INIT ();
-	ASSERT_MAPID (mapid);
-	ASSERT_NOT_MAPPED_CTX (mapid);
-
-	*ctx = gLogPool.ctxPool[mapid];
-
-	return CF_OK;
-}
-
-/**
- * 로그를 사용하기 위해 초기화
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param poolSize	로그 풀 크기로, 로그 아이디 넘버의 최대 값
- */
-int
-CF_Log_Initialize (const int poolSize)
-{
-	memset (&gLogPool, 0x00, sizeof (CF_LOG_POOL));
-
-	if (poolSize > 0)
-	{
-		gLogPool.ctxPool =
-			(CF_Log_Ctx *) calloc ((size_t) poolSize, sizeof (CF_Log_Ctx));
-		if (gLogPool.ctxPool == NULL)
-			return CF_ERROR_LOG_INITIALIZE;
-		gLogPool.poolSize = poolSize;
-	}
-
-	return CF_OK;
-}
-
-/**
- * 로그가 모두 사용된 후 자원 해제
- *
- * \return CF_OK 반환
- */
-int
-CF_Log_Finalize (void)
-{
-	int mapid = 0;
-
-	for (mapid = 0 ; mapid < gLogPool.poolSize ; mapid++)
-	{
-		CF_Log_UnmapCtxID (mapid);
-	}
-
-	if (gLogPool.ctxPool != NULL)
-		free (gLogPool.ctxPool);
-
-	memset (&gLogPool, 0x00, sizeof (CF_LOG_POOL));
-
-	return CF_OK;
-}
-
-/**
- * 로그 열기
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid		로그의 아이디 넘버
- * \param path		로그 파일 경로
- * \param memsize	로그 버퍼 크기
- *
- * \see CF_LOG_DEFAULT_BUFFER, CF_LOG_NO_BUFFER
- */
-int
-CF_Log_Open (const int	mapid,
-			 const char	* path,
-			 const int	memsize)
-{
-	int			result = 0;
-	CF_Log_Ctx	ctx = NULL;
-
-	result = CF_Log_CreateCtx (&ctx, path, memsize);
-	if (result < 0)
-		return result;
-
-	result = CF_Log_MapCtxID (mapid, ctx);
-	if (result < 0)
-		CF_Log_DestroyCtx (ctx);
-
-	return result;
-}
-
-/**
- * 로그 닫기
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid 로그의 아이디 넘버
- */
-int
-CF_Log_Close (const int mapid)
-{
-	return CF_Log_UnmapCtxID (mapid);
-}
-
-/**
- * 로그 버퍼의 데이터를 즉시 로그 파일에 쓰기
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid 로그의 아이디 넘버
- */
-int
-CF_Log_Flush (const int mapid)
-{
-	int			result = 0;
-	CF_Log_Ctx	ctx = NULL;
-
-	result = CF_Log_GetMappedCtx (mapid, &ctx);
-	if (result < 0)
-		return result;
-
-	result = CF_Log_FlushCtx (ctx);
-
-	return result;
-}
-
-/**
- * 로그 컨텍스트에 멀티쓰레드 모드 설정
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드 
- *
- * \param mapid	로그의 아이디 넘버
- * \param flag	설정/해제 bool 플래그
- *
- * \see CF_BOOL
- */
-int
-CF_Log_SetMT (const int		mapid,
-			  const CF_BOOL	flag)
-{
-	int			result = 0;
-	CF_Log_Ctx	ctx = NULL;
-
-	result = CF_Log_GetMappedCtx (mapid, &ctx);
-	if (result < 0)
-		return result;
-
-	result = (flag) ? CF_Log_SetMultiThread (ctx) :
-					  CF_Log_UnsetMultiThread (ctx);
-
-	return result;
-}
-
-/**
- * 로그 쓰기
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param mapid		로그의 아이디 넘버
- * \param prefix	로그의 프리픽스 문자열
- * \param fmt		포맷 스트링
- * \param ...		가변 인자
- */
-int
-CF_Log_Write (const int		mapid,
-			  const char	* prefix,
-			  const char	* fmt, ...)
-{
-	int			result = 0;
-	CF_Log_Ctx	ctx = NULL;
-	va_list		valist;
-
-	result = CF_Log_GetMappedCtx (mapid, &ctx);
-	if (result < 0)
-		return result;
-
-	va_start (valist, fmt);
-	result = CF_Log_Local_WriteVA (ctx, prefix, fmt, valist);
-	va_end (valist);
-
-	return result;
-}
+		CF_Log_Destroy ((cf_ctx) context);
+	}
+
+	return result;
+}
Index: /trunk/src/cf_mutex.c
===================================================================
--- /trunk/src/cf_mutex.c	(revision 150)
+++ /trunk/src/cf_mutex.c	(revision 151)
@@ -21,6 +21,6 @@
 #endif // #if defined(_WIN32) || defined(_WIN64)
 
-#define ASSERT_MUTEX_CTX(__ctx)	\
-	if (__ctx == NULL)			\
+#define ASSERT_CTX(__ctx)	\
+	if (__ctx == NULL)		\
 		return CF_ERROR_MUTEX_INVALID_CTX
 
@@ -38,5 +38,5 @@
  */
 int
-CF_Mutex_CreateCtx (CF_Mutex_Ctx * ctx)
+CF_Mutex_Create (cf_ctx * ctx)
 {
 	int result = 0;
@@ -44,5 +44,7 @@
 	CF_MUTEX_CONTEXT * context = NULL;
 
-	context = (CF_MUTEX_CONTEXT *) calloc (sizeof (CF_MUTEX_CONTEXT), 1);
+	ASSERT_CTX (ctx);
+
+	context = NEWCTX (CF_MUTEX_CONTEXT);
 	if (context == NULL)
 		return CF_ERROR_MUTEX_CREATE_CTX;
@@ -70,5 +72,5 @@
 	CATCH_IF (result < 0)
 	{
-		CF_Mutex_DestoryCtx ((CF_Mutex_Ctx) context);
+		CF_Mutex_Destory ((cf_ctx) context);
 	}
 
@@ -84,9 +86,9 @@
  */
 int
-CF_Mutex_DestoryCtx (CF_Mutex_Ctx ctx)
+CF_Mutex_Destory (cf_ctx ctx)
 {
-	CF_MUTEX_CONTEXT * context = ctx;
+	CF_MUTEX_CONTEXT * context = (CF_MUTEX_CONTEXT *) ctx;
 
-	ASSERT_MUTEX_CTX (ctx);
+	ASSERT_CTX (ctx);
 
 #if defined(_WIN32) || defined(_WIN64)
@@ -112,9 +114,9 @@
  */
 int
-CF_Mutex_Lock (CF_Mutex_Ctx ctx)
+CF_Mutex_Lock (cf_ctx ctx)
 {
-	CF_MUTEX_CONTEXT * context = ctx;
+	CF_MUTEX_CONTEXT * context = (CF_MUTEX_CONTEXT *) ctx;
 
-	ASSERT_MUTEX_CTX (ctx);
+	ASSERT_CTX (ctx);
 
 #if defined(_WIN32) || defined(_WIN64)
@@ -135,9 +137,9 @@
  */
 int
-CF_Mutex_Unlock (CF_Mutex_Ctx ctx)
+CF_Mutex_Unlock (cf_ctx ctx)
 {
-	CF_MUTEX_CONTEXT * context = ctx;
+	CF_MUTEX_CONTEXT * context = (CF_MUTEX_CONTEXT *) ctx;
 
-	ASSERT_MUTEX_CTX (ctx);
+	ASSERT_CTX (ctx);
 
 #if defined(_WIN32) || defined(_WIN64)
Index: /trunk/src/cf_queue.c
===================================================================
--- /trunk/src/cf_queue.c	(revision 150)
+++ /trunk/src/cf_queue.c	(revision 151)
@@ -8,7 +8,32 @@
 #include "cf_queue.h"
 #include "cf_list.h"
+#include "cf_local.h"
 #include "cf_error.h"
 
 #include <stdio.h>
+
+static int
+CF_Queue_Local_Get (cf_ctx	ctx,
+					void	** element,
+					CF_BOOL	removeFlag)
+{
+	int				result = 0;
+	cf_ctx			list = (cf_ctx) ctx;
+	cf_traverser	trav = NULL;
+
+	result = CF_List_Front (list, &trav);
+	if (result < 0)
+		return result;
+
+	result = CF_List_Get (trav, element);
+	if (result < 0)
+		return result;
+
+	result = (removeFlag == CF_TRUE)
+		   ? CF_List_Remove (ctx, &trav)
+		   : CF_OK;
+
+	return result;
+}
 
 /**
@@ -20,7 +45,7 @@
  */
 int
-CF_Queue_CreateCtx (CF_Queue_Ctx * ctx)
+CF_Queue_Create (cf_ctx * ctx)
 {
-	return CF_List_CreateCtx ((CF_List_Ctx *) ctx);
+	return CF_List_Create ((cf_ctx *) ctx);
 }
 
@@ -33,7 +58,7 @@
  */
 int
-CF_Queue_DestroyCtx (CF_Queue_Ctx ctx)
+CF_Queue_Destroy (cf_ctx ctx)
 {
-	return CF_List_DestroyCtx (ctx);
+	return CF_List_Destroy (ctx);
 }
 
@@ -47,16 +72,10 @@
  */
 int
-CF_Queue_Put (CF_Queue_Ctx	ctx,
+CF_Queue_Put (cf_ctx		ctx,
 			  const void	* element)
 {
-	int				result = 0;
-	CF_List_Ctx		list = (CF_List_Ctx) ctx;
-	CF_Traverser	traverser = NULL;
+	cf_ctx list = (cf_ctx) ctx;
 
-	result = CF_List_Rear (list, &traverser);
-	if (result < 0)
-		return result;
-
-	return CF_List_Insert (list, traverser, CF_DIRECTION_AFTER, element);
+	return CF_List_AddRear (list, element);
 }
 
@@ -70,20 +89,8 @@
  */
 int
-CF_Queue_Get (CF_Queue_Ctx	ctx,
-			  void			** element)
+CF_Queue_Get (cf_ctx	ctx,
+			  void		** element)
 {
-	int			result = 0;
-	CF_List_Ctx	list = (CF_List_Ctx) ctx;
-	CF_Traverser	traverser = NULL;
-
-	result = CF_Queue_Front (ctx, element);
-	if (result < 0)
-		return result;
-
-	result = CF_List_Front (list, &traverser);
-	if (result < 0)
-		return result;
-
-	return CF_List_Remove (ctx, &traverser);
+	return CF_Queue_Local_Get (ctx, element, CF_TRUE);
 }
 
@@ -97,16 +104,8 @@
  */
 int
-CF_Queue_Front (CF_Queue_Ctx 	ctx,
-				void			** element)
+CF_Queue_Front (cf_ctx 	ctx,
+				void	** element)
 {
-	int				result = 0;
-	CF_List_Ctx		list = (CF_List_Ctx) ctx;
-	CF_Traverser	traverser = NULL;
-
-	result = CF_List_Front (list, &traverser);
-	if (result < 0)
-		return result;
-
-	return CF_List_GetElement (traverser, element);
+	return CF_Queue_Local_Get (ctx, element, CF_FALSE);
 }
 
@@ -119,6 +118,6 @@
  */
 int
-CF_Queue_GetSize (CF_Queue_Ctx ctx)
+CF_Queue_GetSize (cf_ctx ctx)
 {
-	return CF_List_GetSize ((CF_List_Ctx) ctx);
+	return CF_List_GetSize ((cf_ctx) ctx);
 }
Index: /trunk/src/cf_socket.c
===================================================================
--- /trunk/src/cf_socket.c	(revision 150)
+++ /trunk/src/cf_socket.c	(revision 151)
@@ -9,4 +9,5 @@
 #include "cf_local.h"
 #include "cf_error.h"
+#include "cf_util.h"
 
 #include <stdio.h>
@@ -33,6 +34,18 @@
 #endif
 
+#define ASSERT_CTX(__ctx)	\
+	if (__ctx == NULL)		\
+		return CF_ERROR_SOCKET_INVALID_CTX
+
+#define ASSERT_ARGS(x)	\
+	if ((x))			\
+		return CF_ERROR_SOCKET_INVALID_ARGS
+
 #define ASSERT_INIT()					\
 	if (!CF_Socket_IsInitialized ())	\
+		return CF_ERROR_SOCKET_NOT_INITIALIZED 
+
+#define TRY_INIT()					\
+	if (CF_Socket_Initialize ())	\
 		return CF_ERROR_SOCKET_NOT_INITIALIZED 
 
@@ -45,10 +58,18 @@
 # define sa_family_t		unsigned short
 # define close(__sock)		closesocket(__sock)
-# define GET_SYSTEM_ERROR()	WSAGetLastError ()
 # define ERROR_INTR			WSAEINTR
 #else
-# define GET_SYSTEM_ERROR()	errno
 # define ERROR_INTR			EINTR
 #endif
+
+#define MAX_IP_LENGTH	256
+
+typedef struct __cf_socket_ctx__
+{
+	int				sock;
+	int				timeout;
+	char			ip[MAX_IP_LENGTH];
+	unsigned short	port;
+} CF_SOCKET_CONTEXT;
 
 static CF_BOOL gInitialized = CF_FALSE;
@@ -64,8 +85,6 @@
 	int flags = fcntl (sock, F_GETFL, 0);
 
-	if (boolean)
-		flags |=  O_NONBLOCK;
-	else
-		flags &= ~O_NONBLOCK;
+	if (boolean)	flags |=  O_NONBLOCK;
+	else			flags &= ~O_NONBLOCK;
 
 	fcntl (sock, F_SETFL, flags);
@@ -74,148 +93,8 @@
 
 static int
-CF_Socket_Local_SetLinger (const int sock)
-{
-	struct linger linger;
-
-	linger.l_onoff = 1;
-	linger.l_linger = 0;
-
-	return CF_Socket_SetOption (sock,
-								SO_LINGER,
-								&linger,
-								sizeof (linger));
-}
-
-static int
-CF_Socket_Local_SetReUseAddr (const int sock)
-{
-	int reuseaddr = 1;
-
-	return CF_Socket_SetOption (sock,
-								SO_REUSEADDR,
-								&reuseaddr,
-								sizeof (reuseaddr));
-}
-
-static int
-CF_Socket_Local_CheckTimeout (const int	sock,
-							  const int	timeout)
-{
-	int				result = 0;
-	fd_set			readfds;
-	struct timeval	tv;
-	int				error;
-
-	if (!(timeout > CF_SOCKET_NO_TIMEOUT))
-		return CF_OK;
-
-	tv.tv_sec = timeout;
-	tv.tv_usec = 0;
-
-	FD_ZERO (&readfds);
-	FD_SET (sock, &readfds);
-
-	while ((result = select (sock + 1, &readfds, NULL, NULL, &tv)) < 0)
-	{
-		error = GET_SYSTEM_ERROR ();
-		if (error != ERROR_INTR)
-		{
-			result = CF_ERROR_SOCKET_TIMEOUT;
-			return result;
-		}
-	}
-
-	if (FD_ISSET (sock, &readfds) == 0)
-	{
-		return CF_ERROR_SOCKET_INTERNAL;
-	}
-
-	return CF_OK;
-}
-
-/**
- * 소켓의 초기화 상태 확인
- *
- * \return 초기화 된 경우, CF_TRUE; 그렇지 않은 경우, CF_FALSE
- */
-CF_BOOL
-CF_Socket_IsInitialized (void)
-{
-	return gInitialized;
-}
-
-/**
- * 소켓 초기화
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- */
-int
-CF_Socket_Initialize (void)
-{
-#if defined(_WIN32) || defined(_WIN64)
-	WSADATA winsockData;
-	if (WSAStartup (MAKEWORD (2, 0), &winsockData))
-	   return CF_ERROR_SOCKET_INITIALIZE;
-#endif
-	gInitialized = CF_TRUE;
-	
-	return CF_OK;
-}
-
-/**
- * 소켓 해제
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- */
-int
-CF_Socket_Finalize (void)
-{
-	ASSERT_INIT ();
-
-#if defined(_WIN32) || defined(_WIN64)
-   	if (WSACleanup ())
-	   return CF_ERROR_SOCKET_FINALIZE;
-#endif
-
-	return CF_OK;
-}
-
-/**
- * 소켓 닫기
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param sock 소켓
- */
-int
-CF_Socket_Close (const int sock)
-{
-	int result = 0;
-
-	ASSERT_SOCKET (sock);
-
-	result = close (sock);
-
-	if (result != 0)
-		return CF_ERROR_SOCKET_CLOSE;
-
-	return CF_OK;
-}
-
-/**
- * 소켓 옵션 설정
- *
- * \return 성공 시 CF_OK; 실패 시, 오류 코드
- *
- * \param sock		소켓
- * \param optname	옵션 이름
- * \param optval	설정할 옵션 값의 메모리
- * \param optlen	설정할 옵션의 길이
- */
-int
-CF_Socket_SetOption (const int		sock,
-					 const int		optname,
-					 const void		* optval,
-					 const size_t	optlen)
+CF_Socket_Local_SetOption (const int	sock,
+						   const int	optname,
+						   const void	* optval,
+						   const size_t	optlen)
 {
 	int	result = 0;
@@ -238,19 +117,9 @@
 }
 
-/**
- * 소켓 옵션 얻기
- *
- * \return 성공 시 CF_OK; 실패 시, 오류 코드
- *
- * \param sock		소켓
- * \param optname	옵션 이름
- * \param optval	옵션 값을 가져올 메모리
- * \param optlen	옵션 길이를 가져올 메모리
- */
-int
-CF_Socket_GetOption (const int	sock,
-					 const int	optname,
-					 void		* optval,
-					 size_t		* optlen)
+static int
+CF_Socket_Local_GetOption (const int	sock,
+						   const int	optname,
+						   void			* optval,
+						   size_t		* optlen)
 {
 	int	result = 0;
@@ -273,37 +142,203 @@
 }
 
+static int
+CF_Socket_Local_SetLinger (const int sock)
+{
+	struct linger linger;
+
+	linger.l_onoff = 1;
+	linger.l_linger = 0;
+
+	return CF_Socket_Local_SetOption (sock,
+									  SO_LINGER,
+									  &linger,
+									  sizeof (linger));
+}
+
+static int
+CF_Socket_Local_SetReUseAddr (const int sock)
+{
+	int reuseaddr = 1;
+
+	return CF_Socket_Local_SetOption (sock,
+									  SO_REUSEADDR,
+									  &reuseaddr,
+									  sizeof (reuseaddr));
+}
+
+static int
+CF_Socket_Local_CheckTimeout (const int	sock,
+							  const int	timeout)
+{
+	int				result = 0;
+	fd_set			readfds;
+	struct timeval	tv;
+	int				error;
+
+	if (timeout <= CF_SOCKET_NO_TIMEOUT)
+		return CF_OK;
+
+	tv.tv_sec = timeout;
+	tv.tv_usec = 0;
+
+	FD_ZERO (&readfds);
+	FD_SET (sock, &readfds);
+
+	while ((result = select (sock + 1, &readfds, NULL, NULL, &tv)) < 0)
+	{
+		error = CF_Util_GetSystemError ();
+		if (error != ERROR_INTR)
+		{
+			result = CF_ERROR_SOCKET_TIMEOUT;
+			return result;
+		}
+	}
+
+	if (FD_ISSET (sock, &readfds) == 0)
+		return CF_ERROR_SOCKET_CHECK_DESC_SET;
+
+	return CF_OK;
+}
+
+/**
+ * 소켓의 초기화 상태 확인
+ *
+ * \return 초기화 된 경우, CF_TRUE; 그렇지 않은 경우, CF_FALSE
+ */
+static CF_BOOL
+CF_Socket_IsInitialized (void)
+{
+	return gInitialized;
+}
+
+/**
+ * 소켓 초기화
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ */
+int
+CF_Socket_Initialize (void)
+{
+	if (!CF_Socket_IsInitialized ())
+	{
+#if defined(_WIN32) || defined(_WIN64)
+		WSADATA winsockData;
+		if (WSAStartup (MAKEWORD (2, 0), &winsockData))
+			return CF_ERROR_SOCKET_INITIALIZE;
+#endif
+		gInitialized = CF_TRUE;
+	}
+	
+	return CF_OK;
+}
+
+/**
+ * 소켓 해제
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ */
+int
+CF_Socket_Finalize (void)
+{
+	ASSERT_INIT ();
+
+#if defined(_WIN32) || defined(_WIN64)
+   	if (WSACleanup ())
+	   return CF_ERROR_SOCKET_FINALIZE;
+#endif
+
+	return CF_OK;
+}
+
+/**
+ * 소켓 컨텍스트 생성
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	소켓 컨텍스트
+ */
+int
+CF_Socket_Create (cf_ctx * ctx)
+{
+	int result = 0;
+
+	CF_SOCKET_CONTEXT * context = NULL;
+
+	ASSERT_CTX (ctx);
+
+	TRY
+	{
+		context = NEWCTX (CF_SOCKET_CONTEXT);
+		if (context == NULL)
+		{
+			result = CF_ERROR_SOCKET_CREATE_CTX;
+			TRY_BREAK;
+		}
+
+		context->sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
+		if (context->sock < 0)
+		{
+			result = CF_ERROR_SOCKET_CREATE;
+			TRY_BREAK;
+		}
+
+		context->timeout = CF_SOCKET_NO_TIMEOUT;
+		*ctx = (CF_SOCKET_CONTEXT *) context;
+	}
+	CATCH_IF (result < 0)
+	{
+		CF_Socket_Close (context);
+	}
+
+	return result;
+}
+
+/**
+ * 소켓 닫기
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	소켓 컨텍스트
+ */
+int
+CF_Socket_Close (cf_ctx ctx)
+{
+	int result = 0;
+	int sock = 0;
+
+	CF_SOCKET_CONTEXT * context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_SOCKET (context->sock);
+
+	sock = context->sock;
+
+	free (context);
+
+	result = close (sock);
+
+	if (result != 0)
+		return CF_ERROR_SOCKET_CLOSE;
+
+	return CF_OK;
+}
+
 /**
  * 소켓 연결
  *
- * \return 성공 시, 연결된 소켓; 실패 시, 오류 코드
- *
- * \param ip		연결할 호스트의 주소 (도메인 이름 가능)
- * \param port		연결할 호스트의 포트번호
- */
-int
-CF_Socket_Connect (const char			* ip,
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	소켓 컨텍스트
+ * \param ip	연결할 호스트의 주소 (도메인 이름 가능)
+ * \param port	연결할 호스트의 포트번호
+ */
+int
+CF_Socket_Connect (cf_ctx				ctx,
+				   const char			* ip,
 				   const unsigned short	port)
-{
-	return CF_Socket_ConnectTimeout (ip, port, CF_SOCKET_NO_TIMEOUT);
-}
-
-/**
- * 타임아웃 동안 소켓 연결
- *
- * \return 성공 시, 연결된 소켓; 실패 시, 오류 코드
- *
- * \param ip		연결할 호스트의 주소 (도메인 이름 가능)
- * \param port		연결할 호스트의 포트번호
- * \param timeout	타임아웃 (초)
- *
- * \see CF_SOCKET_NO_TIMEOUT
- */
-int
-CF_Socket_ConnectTimeout (const char			* ip,
-						  const unsigned short	port,
-						  const int				timeout)
 {
 	int					result = 0;
 	int					sock = 0;
+	int					timeout = 0;
 	struct sockaddr_in	address;
 	struct hostent		* hostEnt;
@@ -315,10 +350,14 @@
 	fd_set				writefds;
 
-	ASSERT_INIT ();
-
-	/* 1. create socket */
-	sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
-	if (sock < 0)
-		return CF_ERROR_SOCKET_CREATE;
+	CF_SOCKET_CONTEXT	* context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (ctx);
+	TRY_INIT ();
+
+	/* 1. get and set socket info. */
+	sock = context->sock;
+	snprintf (context->ip, sizeof (context->ip), "%s", ip);
+	context->port = port;
+	timeout = context->timeout;
 
 	/* 2. set data */
@@ -390,5 +429,5 @@
 			retval = 0;
 
-			result = CF_Socket_GetOption (sock, SO_ERROR, &retval, &length);
+			result = CF_Socket_GetOption (ctx, SO_ERROR, &retval, &length);
 			if (result < 0)
 			{
@@ -410,5 +449,5 @@
 	CATCH_IF (result < 0)
 	{
-		CF_Socket_Close (sock);
+		CF_Socket_Close (ctx);
 		return result;
 	}
@@ -417,5 +456,5 @@
 		CF_Socket_Local_SetNonBlocking (sock, CF_FALSE);
 
-	return sock;
+	return result;
 }
 
@@ -423,11 +462,13 @@
  * 서버 열기
  *
- * \return 성공 시, 서버 소켓; 실패 시, 오류 코드
- *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		소켓 컨텍스트
  * \param port		서버 포트
  * \param backlog	listen 시의 backlog 수
  */
 int
-CF_Socket_Server (const unsigned short	port,
+CF_Socket_Server (cf_ctx				ctx,
+				  const unsigned short	port,
 				  const int				backlog)
 {
@@ -436,9 +477,11 @@
 	struct sockaddr_in	address;
 
-	ASSERT_INIT ();
-
-	sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
-	if (sock < 0)
-		return CF_ERROR_SOCKET_CREATE;
+	CF_SOCKET_CONTEXT	* context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (ctx);
+	TRY_INIT ();
+
+	sock = context->sock;
+	context->port = port;
 
 	address.sin_family		= AF_INET;
@@ -462,4 +505,8 @@
 		}
 
+		snprintf (context->ip, sizeof (context->ip),
+				  "%s",
+				  inet_ntoa(address.sin_addr));
+
 		result = listen (sock, backlog);
 		if (result < 0)
@@ -471,32 +518,49 @@
 	CATCH_IF (result < 0)
 	{
-		CF_Socket_Close (sock);
-		return result;
-	}
-
-	return sock;
-}
-
-/**
- * 소켓 연결
- *
- * \return 성공 시, 연결된 소켓; 실패 시, 오류 코드
- *
- * \param sock	서버 소켓
- */
-int
-CF_Socket_Accept (const int sock)
-{
-	int					sockClient = 0;
+		CF_Socket_Close (ctx);
+	}
+
+	return result;
+}
+
+/**
+ * 소켓 연결 받기
+ *
+ * \return 성공 시, CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		소켓 컨텍스트
+ * \param client	연결을 수락할 client 소켓 컨텍스트
+ */
+int
+CF_Socket_Accept (const cf_ctx	ctx,
+				  cf_ctx		* client)
+{
+	int					result = 0;
 	struct sockaddr_in	address;
 	socklen_t			len = sizeof (address);
 
-	ASSERT_SOCKET (sock);
-
-	sockClient = accept (sock, (struct sockaddr *) &address, &len);
-	if (sockClient < 0)
+	CF_SOCKET_CONTEXT	* clntctx = NULL;
+	CF_SOCKET_CONTEXT	* context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_CTX (client);
+	ASSERT_SOCKET (context->sock);
+
+	result = CF_Socket_Create ((cf_ctx *)&clntctx);
+	if (result < 0)
+		return result;
+
+	close (clntctx->sock);
+
+	clntctx->sock = accept (context->sock, (struct sockaddr *) &address, &len);
+	if (clntctx->sock < 0)
+	{
+		CF_Socket_Close ((cf_ctx *)clntctx);
 		return CF_ERROR_SOCKET_ACCEPT;
-
-	return sockClient;
+	}
+
+	*client = (cf_ctx) clntctx;
+
+	return CF_OK;
 }
 
@@ -506,39 +570,20 @@
  * \return 성공 시, CF_OK; 실패 시, 오류 코드
  *
- * \param sock	소켓
- * \param buf	송신할 데이터
+ * \param ctx	소켓 컨텍스트 * \param buf	송신할 데이터
  * \param len	송신할 데이터의 길이
  */
 int
-CF_Socket_Send (const int		sock,
+CF_Socket_Send (const cf_ctx	ctx,
 				const void		* buf,
 				const size_t	len)
 {
-	return CF_Socket_SendTimeout (sock, buf, len, CF_SOCKET_NO_TIMEOUT);
-}
-
-/**
- * 타임아웃 동안 데이터 송신
- *
- * \return 성공 시, CF_OK; 실패 시, 오류 코드
- *
- * \param sock		소켓
- * \param buf		송신할 데이터
- * \param len		송신할 데이터의 길이
- * \param timeout	타임아웃 (초)
- *
- * \see CF_SOCKET_NO_TIMEOUT
- */
-int
-CF_Socket_SendTimeout (const int	sock,
-					   const void	* buf,
-					   const size_t	len,
-					   const int	timeout)
-{
 	int result = 0;
 
-	ASSERT_SOCKET (sock);
-
-	result = (int) send (sock, buf, len, 0);
+	CF_SOCKET_CONTEXT	* context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_SOCKET (context->sock);
+
+	result = (int) send (context->sock, buf, len, 0);
 	if (result != len)
 		return CF_ERROR_SOCKET_SEND;
@@ -552,43 +597,25 @@
  * \return 성공 시, 수신한 데이터의 길이; 실패 시, 오류 코드
  *
- * \param sock	소켓
+ * \param ctx	소켓 컨텍스트
  * \param buf	데이터를 수신할 버퍼
  * \param len	데이터를 수신할 버퍼의 최대 크기
  */
 int
-CF_Socket_Recv (const int		sock,
+CF_Socket_Recv (const cf_ctx	ctx,
 				void			* buf,
 				const size_t	len)
 {
-	return CF_Socket_RecvTimeout (sock, buf, len, CF_SOCKET_NO_TIMEOUT);
-}
-
-/**
- * 타임아웃 동안 데이터 수신
- *
- * \return 성공 시, 수신한 데이터의 길이; 실패 시, 오류 코드
- *
- * \param sock		소켓
- * \param buf		데이터를 수신할 버퍼
- * \param len		데이터를 수신할 버퍼의 최대 크기
- * \param timeout	타임아웃 (초)
- *
- * \see CF_SOCKET_NO_TIMEOUT
- */
-int
-CF_Socket_RecvTimeout (const int	sock,
-					   void			* buf,
-					   const size_t	len,
-					   const int	timeout)
-{
 	int result = 0;
 
-	ASSERT_SOCKET (sock);
-
-	result = CF_Socket_Local_CheckTimeout (sock, timeout);
+	CF_SOCKET_CONTEXT	* context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_SOCKET (context->sock);
+
+	result = CF_Socket_Local_CheckTimeout (context->sock, context->timeout);
 	if (result < 0)
 		return result;
 
-	result = (int) recv (sock, buf, len, 0);
+	result = (int) recv (context->sock, buf, len, 0);
 	if (result < 0)
 		return CF_ERROR_SOCKET_RECV;
@@ -596,2 +623,118 @@
 	return result;
 }
+
+/**
+ * 소켓 옵션 설정
+ *
+ * \return 성공 시 CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		소켓 컨텍스트
+ * \param optname	옵션 이름
+ * \param optval	설정할 옵션 값의 메모리
+ * \param optlen	설정할 옵션의 길이
+ */
+int
+CF_Socket_SetOption (const cf_ctx	ctx,
+					 const int		optname,
+					 const void		* optval,
+					 const size_t	optlen)
+{
+	CF_SOCKET_CONTEXT * context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+
+	return CF_Socket_Local_SetOption (context->sock,
+									  optname,
+									  optval,
+									  optlen);
+}
+
+/**
+ * 소켓 옵션 얻기
+ *
+ * \return 성공 시 CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx		소켓 컨텍스트
+ * \param optname	옵션 이름
+ * \param optval	옵션 값을 가져올 메모리
+ * \param optlen	옵션 길이를 가져올 메모리
+ */
+int
+CF_Socket_GetOption (const cf_ctx	ctx,
+					 const int		optname,
+					 void			* optval,
+					 size_t			* optlen)
+{
+	CF_SOCKET_CONTEXT * context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+
+	return CF_Socket_Local_GetOption (context->sock,
+									  optname,
+									  optval,
+									  optlen);
+}
+
+/**
+ * 소켓 컨텍스트에 타임아웃 설정
+ *
+ * \return CF_OK 반환
+ *
+ * \param ctx		소켓 컨텍스트
+ * \param timeout	설정할 타임아웃 시간
+ */
+int
+CF_Socket_SetTimeOut (cf_ctx	ctx,
+					  int		timeout)
+{
+	CF_SOCKET_CONTEXT * context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+
+	context->timeout = timeout;
+
+	return CF_OK;
+}
+
+/**
+ * 소켓 컨텍스트에 타임아웃 설정
+ *
+ * \return 성공 시 CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	소켓 컨텍스트
+ * \param ip	ip 주소를 저장할 충분한 공간의 메모리
+ */
+int
+CF_Socket_GetIP (const cf_ctx	ctx,
+				 char			* ip)
+{
+	CF_SOCKET_CONTEXT * context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_CTX (context);
+	ASSERT_ARGS (ip == NULL);
+
+	snprintf (ip, sizeof (context->ip), "%s", context->ip);
+
+	return CF_OK;
+}
+
+/**
+ * 소켓 컨텍스트에 타임아웃 설정
+ *
+ * \return 성공 시 CF_OK; 실패 시, 오류 코드
+ *
+ * \param ctx	소켓 컨텍스트
+ * \param port	포트 번호 저장할 포인터
+ */
+int
+CF_Socket_GetPort (const cf_ctx		ctx,
+				   unsigned short	* port)
+{
+	CF_SOCKET_CONTEXT * context = (CF_SOCKET_CONTEXT *) ctx;
+
+	ASSERT_ARGS (port == NULL);
+
+	*port = context->port;
+
+	return CF_OK;
+}
Index: /trunk/src/cf_stack.c
===================================================================
--- /trunk/src/cf_stack.c	(revision 150)
+++ /trunk/src/cf_stack.c	(revision 151)
@@ -8,7 +8,32 @@
 #include "cf_stack.h"
 #include "cf_list.h"
+#include "cf_local.h"
 #include "cf_error.h"
 
 #include <stdio.h>
+
+static int
+CF_Stack_Local_Get (cf_ctx	ctx,
+					void	** element,
+					CF_BOOL	removeFlag)
+{
+	int				result = 0;
+	cf_ctx			list = (cf_ctx) ctx;
+	cf_traverser	trav = NULL;
+
+	result = CF_List_Front (list, &trav);
+	if (result < 0)
+		return result;
+
+	result = CF_List_Get (trav, element);
+	if (result < 0)
+		return result;
+
+	result = (removeFlag == CF_TRUE)
+		   ? CF_List_Remove (ctx, &trav)
+		   : CF_OK;
+
+	return result;
+}
 
 /**
@@ -20,7 +45,7 @@
  */
 int
-CF_Stack_CreateCtx (CF_Stack_Ctx * ctx)
+CF_Stack_Create (cf_ctx * ctx)
 {
-	return CF_List_CreateCtx ((CF_List_Ctx *) ctx);
+	return CF_List_Create ((cf_ctx *) ctx);
 }
 
@@ -33,7 +58,7 @@
  */
 int
-CF_Stack_DestroyCtx (CF_Stack_Ctx ctx)
+CF_Stack_Destroy (cf_ctx ctx)
 {
-	return CF_List_DestroyCtx (ctx);
+	return CF_List_Destroy (ctx);
 }
 
@@ -47,16 +72,10 @@
  */
 int
-CF_Stack_Push (CF_Stack_Ctx	ctx,
+CF_Stack_Push (cf_ctx		ctx,
 			   const void	* element)
 {
-	int				result = 0;
-	CF_List_Ctx		list = (CF_List_Ctx) ctx;
-	CF_Traverser	traverser = NULL;
+	cf_ctx list = (cf_ctx) ctx;
 
-	result = CF_List_Front (list, &traverser);
-	if (result < 0)
-		return result;
-
-	return CF_List_Insert (list, traverser, CF_DIRECTION_BEFORE, element);
+	return CF_List_AddFront (list, element);
 }
 
@@ -70,20 +89,8 @@
  */
 int
-CF_Stack_Pop (CF_Stack_Ctx	ctx,
-			  void			** element)
+CF_Stack_Pop (cf_ctx	ctx,
+			  void		** element)
 {
-	int			result = 0;
-	CF_List_Ctx	list = (CF_List_Ctx) ctx;
-	CF_Traverser	traverser = NULL;
-
-	result = CF_Stack_Top (ctx, element);
-	if (result < 0)
-		return result;
-
-	result = CF_List_Front (list, &traverser);
-	if (result < 0)
-		return result;
-
-	return CF_List_Remove (ctx, &traverser);
+	return CF_Stack_Local_Get (ctx, element, CF_TRUE);
 }
 
@@ -97,16 +104,8 @@
  */
 int
-CF_Stack_Top (CF_Stack_Ctx 	ctx,
-			  void			** element)
+CF_Stack_Top (cf_ctx 	ctx,
+			  void		** element)
 {
-	int				result = 0;
-	CF_List_Ctx		list = (CF_List_Ctx) ctx;
-	CF_Traverser	traverser = NULL;
-
-	result = CF_List_Front (list, &traverser);
-	if (result < 0)
-		return result;
-
-	return CF_List_GetElement (traverser, element);
+	return CF_Stack_Local_Get (ctx, element, CF_FALSE);
 }
 
@@ -119,6 +118,6 @@
  */
 int
-CF_Stack_GetSize (CF_Stack_Ctx ctx)
+CF_Stack_GetSize (cf_ctx ctx)
 {
-	return CF_List_GetSize ((CF_List_Ctx) ctx);
+	return CF_List_GetSize ((cf_ctx) ctx);
 }
Index: /trunk/src/cf_thread.c
===================================================================
--- /trunk/src/cf_thread.c	(revision 150)
+++ /trunk/src/cf_thread.c	(revision 151)
@@ -7,4 +7,5 @@
  */
 #include "cf_thread.h"
+#include "cf_local.h"
 #include "cf_error.h"
 
@@ -24,5 +25,5 @@
 #endif // #if defined(_WIN32) || defined(_WIN64)
 
-#define ASSERT_THREAD_CTX(__ctx)	\
+#define ASSERT_CTX(__ctx)	\
 	if (__ctx == NULL)				\
 		return CF_ERROR_THREAD_INVALID_CTX
@@ -47,11 +48,11 @@
  */
 int
-CF_Thread_CreateCtx (CF_Thread_Ctx		* ctx,
-					 CF_Thread_Function	callback,
-					 void				* arg)
+CF_Thread_Create (cf_ctx				* ctx,
+				  CF_Thread_Function	callback,
+				  void					* arg)
 {
 	CF_THREAD_CONTEXT * context = NULL;
 
-	context = (CF_THREAD_CONTEXT *) calloc (sizeof (CF_THREAD_CONTEXT), 1);
+	context = NEWCTX (CF_THREAD_CONTEXT);
 	if (context == NULL)
 		return CF_ERROR_THREAD_CREATE_CTX;
@@ -60,5 +61,5 @@
 	context->arg		= arg;
 
-	*ctx = (CF_Thread_Ctx) context;
+	*ctx = (cf_ctx) context;
 
 	return CF_OK;
@@ -74,6 +75,8 @@
  * \remarks
  * pthread에서 지원되는 스케줄링 정책은 SCHED_OTHER, SCHED_FIFO, SCHED_RR 등이 존재 <br />
- * 일반적으로 설정되는 스케줄링 정책의 기본값은 SCHED_OTHER이며, 솔라리스 환경에서 SCHED_OTHER는 TS(timesharing) 방식으로 명시되어 있음 <br />
- * 그러나 개발 단계에서 테스트된 동작은 SCHED_FIFO와 동일하였으며, 때문에 솔라리스 환경에서는 스케줄링 정책을 SCHED_RR로 명시하도록 함 <br />
+ * 일반적으로 설정되는 스케줄링 정책의 기본값은 SCHED_OTHER이며,
+ * 솔라리스 환경에서 SCHED_OTHER는 TS(timesharing) 방식으로 명시되어 있음 <br />
+ * 그러나 개발 단계에서 테스트된 동작은 SCHED_FIFO와 동일하였으며,
+ * 때문에 솔라리스 환경에서는 스케줄링 정책을 SCHED_RR로 명시하도록 함 <br />
  * <br />
  * 참고 url <br />
@@ -82,5 +85,5 @@
  */
 int
-CF_Thread_Start (CF_Thread_Ctx ctx)
+CF_Thread_Start (cf_ctx ctx)
 {
 	int result = 0;
@@ -88,5 +91,5 @@
 	CF_THREAD_CONTEXT * context = (CF_THREAD_CONTEXT *) ctx;
 
-	ASSERT_THREAD_CTX (ctx);
+	ASSERT_CTX (ctx);
 
 #if defined(_WIN32) || defined(_WIN64)
@@ -138,9 +141,9 @@
  */
 int
-CF_Thread_DestroyCtx (CF_Thread_Ctx ctx)
+CF_Thread_Destroy (cf_ctx ctx)
 {
 	CF_THREAD_CONTEXT * context = (CF_THREAD_CONTEXT *) ctx;
 
-	ASSERT_THREAD_CTX (ctx);
+	ASSERT_CTX (ctx);
 
 #if defined(_WIN32) || defined(_WIN64)
@@ -163,5 +166,5 @@
  */
 int
-CF_Thread_Join (CF_Thread_Ctx ctx)
+CF_Thread_Join (cf_ctx ctx)
 {
 	CF_THREAD_CONTEXT * context = (CF_THREAD_CONTEXT *) ctx;
@@ -169,5 +172,5 @@
 	char status[16] = {0x00,};
 
-	ASSERT_THREAD_CTX (ctx);
+	ASSERT_CTX (ctx);
 
 #if defined(_WIN32) || defined(_WIN64)
Index: /trunk/src/cf_util.c
===================================================================
--- /trunk/src/cf_util.c	(revision 151)
+++ /trunk/src/cf_util.c	(revision 151)
@@ -0,0 +1,126 @@
+/**
+ * \file cf_util.c
+ *
+ * \author myusgun <myusgun@gmail.com>
+ *
+ * \brief 유틸 구현
+ */
+#include "cf_util.h"
+#include "cf_error.h"
+
+#include <stdio.h>
+#include <time.h>
+
+#if defined(_WIN32) || defined(_WIN64)
+# include <windows.h>
+#else
+# include <sys/time.h>
+# include <errno.h>
+#endif
+
+#define ASSERT_ARGS(x)	\
+	if ((x))			\
+		return CF_ERROR_UTIL_INVALID_ARGS
+
+#if defined(_WIN32) || defined(_WIN64)
+/* {{{ */
+struct timezone
+{
+	int tz_minuteswest;	/* minutes W of Greenwich */
+	int tz_dsttime;		/* type of dst correction */
+};
+
+static int
+gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+	FILETIME			ft;
+	unsigned __int64	buf =0;
+	//static int tzflag = 0;
+
+	if (NULL != tv)
+	{
+		GetSystemTimeAsFileTime (&ft);
+
+		buf |=	ft.dwHighDateTime;
+		buf <<=	32;
+		buf |=	ft.dwLowDateTime;
+
+		if (buf)
+		{
+			buf /= 10;
+			buf -= ((369 * 365 + 89) * (unsigned __int64) 86400) * 1000000;
+		}
+
+		tv->tv_sec = (long)(buf / 1000000UL);
+		tv->tv_usec = (long)(buf % 1000000UL);
+	}
+
+	/*
+	if (NULL != tz)
+	{
+		if (!tzflag)
+		{
+			_tzset();
+			tzflag++;
+		}
+
+		// Adjust for the timezone west of Greenwich
+		tz->tz_minuteswest = _timezone / 60;
+		tz->tz_dsttime = _daylight;
+	}
+	*/
+
+	return 0;
+}
+/* }}} */
+#endif
+
+int
+CF_Util_GetSystemError (void)
+{
+#if defined(_WIN32) || defined(_WIN64)
+	return WSAGetLastError ();
+#else
+	return errno;
+#endif
+}
+
+int
+CF_Util_GetCurrentTime (CF_UTIL_DATETIME * dt)
+{
+	struct timeval	timeVal;
+	struct tm		* timebuf;
+
+	ASSERT_ARGS (dt == NULL);
+
+	gettimeofday (&timeVal, NULL);
+	timebuf = localtime ((const time_t *)&timeVal.tv_sec);
+
+	dt->year	= timebuf->tm_year + 1900;
+	dt->month	= timebuf->tm_mon + 1;
+	dt->day		= timebuf->tm_mday;
+	dt->week	= timebuf->tm_wday;
+
+	dt->hour	= timebuf->tm_hour;
+	dt->min		= timebuf->tm_min;
+	dt->sec		= timebuf->tm_sec;
+
+	dt->usec	= (int) timeVal.tv_usec;
+
+	return CF_OK;
+}
+
+int
+CF_Util_GetTimeString (const CF_UTIL_DATETIME	* dt,
+					   char						* buffer)
+{
+	ASSERT_ARGS (dt     == NULL);
+	ASSERT_ARGS (buffer == NULL);
+
+	snprintf (buffer, CF_UTIL_DATETIME_LENGTH,
+			  "%04d-%02d-%02d %02d:%02d:%02d.%03d",
+			  dt->year, dt->month, dt->day,
+			  dt->hour, dt->min, dt->sec, dt->usec);
+
+	return CF_OK;
+}
Index: /trunk/src/makefile
===================================================================
--- /trunk/src/makefile	(revision 150)
+++ /trunk/src/makefile	(revision 151)
@@ -20,4 +20,5 @@
 					cf_stack		\
 					cf_bitwise		\
+					cf_util			\
 
 TARGET_NAME		= cf
@@ -46,5 +47,5 @@
 # link
 $(TARGET_PATH)/%.$(EXT_SHARED): $(OBJS)
-	$(LD) $(SHARED_FLAGS) -o $@ $? $(LIBS)
+	$(LD) $(SHARED_FLAGS) -o $@ $(LIBS) $?
 
 $(TARGET_PATH)/%.$(EXT_STATIC): $(OBJS)
@@ -53,9 +54,9 @@
 # compile
 $(OBJ_PATH)/%.o: %.$(SOURCE_TYPE)
-	$(CC) $(CFLAGS) $(CDEFS) $(INCLUDES) -o $@ -c $?
+	$(CC) $(CFLAGS) -c $(CDEFS) $(INCLUDES) -o $@ $?
 
 # doxygen
 $(DOXYGEN_OUTPUT_PATH):
-ifeq ($(DOXYGEN_CREATE),YES)
+ifeq ($(DOXYGEN_CREATE),yes)
 ifeq ($(DOXYGEN),)
 	@echo "doxygen was not found."
@@ -69,5 +70,5 @@
 clean:
 	rm -rf $(TARGET_PATH) $(OBJ_PATH)
-ifeq ($(DOXYGEN_CREATE),YES)
+ifeq ($(DOXYGEN_CREATE),yes)
 	rm -rf $(DOXYGEN_OUTPUT_PATH)
 endif
Index: /trunk/test/codec.c
===================================================================
--- /trunk/test/codec.c	(revision 150)
+++ /trunk/test/codec.c	(revision 151)
@@ -25,7 +25,6 @@
 
 	CF_DEBUG_PRINT (stderr, "= Convert hex to binary =\n");
-	if (CF_Codec_Hex_Decode (encode, bin, &length) < 0) {
-		// error
-	}
+	if (CF_Codec_Hex_Decode (encode, bin, &length) < 0)
+		CF_DEBUG_PRINT (stderr, "error\n");
 	else
 		CF_DEBUG_PRINT_BIN (stderr, bin, length, "bin    : %s\n", bin);
Index: /trunk/test/debug.c
===================================================================
--- /trunk/test/debug.c	(revision 150)
+++ /trunk/test/debug.c	(revision 151)
@@ -8,5 +8,6 @@
 #include <string.h>
 
-void callee3 (void) {
+void callee3 (void)
+{
 	CF_DEBUG_BEGIN_FUNCTION;
 
@@ -18,5 +19,6 @@
 }
 
-void callee2 (void) {
+void callee2 (void)
+{
 	CF_DEBUG_BEGIN_FUNCTION;
 
@@ -28,5 +30,6 @@
 }
 
-void callee1 (void) {
+void callee1 (void)
+{
 	CF_DEBUG_BEGIN_FUNCTION;
 
@@ -38,5 +41,6 @@
 }
 
-int main (void) {
+int main (void)
+{
 	char data[] =
 		"【 曲名 : 사랑하고 있는데 】\n"
Index: /trunk/test/file.c
===================================================================
--- /trunk/test/file.c	(revision 150)
+++ /trunk/test/file.c	(revision 151)
@@ -6,6 +6,8 @@
 #include <stdio.h>
 
-int main (void) {
-	int fd = 0;
+int main (void)
+{
+	cf_ctx fd = 0;
+	int result = 0;
 	char *dir1 = "./dir1/test";
 	char *dir2 = "dir2/test";
@@ -21,6 +23,6 @@
 	}
 
-	fd = CF_File_Create (name);
-	if (fd < 0) {
+	result = CF_File_Open (&fd, name, CF_FILE_CREATE|CF_FILE_RW|CF_FILE_TRUNC);
+	if (result < 0) {
 		// error
 	}
@@ -30,6 +32,6 @@
 	CF_File_Close (fd);
 
-	fd = CF_File_Open (name, CF_FILE_READ);
-	if (fd < 0) {
+	result = CF_File_Open (&fd, name, CF_FILE_READ);
+	if (result < 0) {
 		// error
 	}
Index: /trunk/test/list.c
===================================================================
--- /trunk/test/list.c	(revision 150)
+++ /trunk/test/list.c	(revision 151)
@@ -11,8 +11,8 @@
 	int				result = 0;
 	long long int	element = 0;
-	CF_List_Ctx		ctx = NULL;
-	CF_Traverser	trav = NULL;
+	cf_ctx			list = NULL;
+	cf_traverser	trav = NULL;
 
-	result = CF_List_CreateCtx (&ctx);
+	result = CF_List_Create (&list);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -20,10 +20,10 @@
 	for (iter = 0 ; iter < 10 ; iter++)
 	{
-		result = CF_List_Insert (ctx, trav, CF_DIRECTION_BEFORE, (void *)iter);
+		result = CF_List_InsertBefore (list, trav, (void *)iter);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
 	}
 
-	result = CF_List_Front (ctx, &trav);
+	result = CF_List_Front (list, &trav);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -36,15 +36,15 @@
 	}
 
-	result = CF_List_Insert (ctx, trav, CF_DIRECTION_BEFORE, (void *)100);
+	result = CF_List_InsertBefore (list, trav, (void *)100);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
 
-	result = CF_List_Insert (ctx, trav, CF_DIRECTION_AFTER, (void *)200);
+	result = CF_List_InsertAfter (list, trav, (void *)200);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
 
-	for (CF_List_Front (ctx, &trav) ; trav != NULL ; CF_List_Next (&trav))
+	for (CF_List_Front (list, &trav) ; trav != NULL ; CF_List_Next (&trav))
 	{
-		result = CF_List_GetElement (trav, (void **)&element);
+		result = CF_List_Get (trav, (void **)&element);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -53,5 +53,5 @@
 	}
 
-	result = CF_List_DestroyCtx (ctx);
+	result = CF_List_Destroy (list);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
Index: /trunk/test/log.c
===================================================================
--- /trunk/test/log.c	(revision 150)
+++ /trunk/test/log.c	(revision 151)
@@ -10,9 +10,10 @@
 #include <stdio.h>
 
-CF_Mutex_Ctx globalMutex;
+#define COUNT	5
 
-#define LOG_MT		1
+cf_ctx	globalLog;
+cf_ctx	globalMutex;
 
-int test_log_mt (void * arg)
+int worker (void * arg)
 {
 	static int cnt = 0;
@@ -32,5 +33,5 @@
 	for (i = 0 ; i < 10000 ; i++)
 	{
-		CF_Log_Write (LOG_MT, "LOG_MT", "[%d] multi-threadedlogging test %d\n", th, i);
+		CF_Log_Write (globalLog, "LOG_MT", "[%d] multi-threadedlogging test %d\n", th, i);
 	}
 
@@ -42,49 +43,32 @@
 int main (void)
 {
-	int				i, j;
-	char			idname[16] = {0x00,};
-	CF_Thread_Ctx	tid[10];
+	int		i, j;
+	cf_ctx	tid[COUNT];
 
 	/* initialize */
-	if (CF_Log_Initialize (10) < 0)
+	if (CF_Log_Create (&globalLog, "log.txt", CF_LOG_NO_BUFFER) < 0)
+		CF_DEBUG_PRINT (stderr, "failed to open log\n");
+
+	for (j = 0 ; j < 10000 ; j++)
 	{
-		fprintf (stderr, "failed to init. log\n");
-		return -1;
-	}
-
-	for (i = 0 ; i < 10 ; i++)
-	{
-		sprintf (idname, "logid%d.txt", i);
-		if (CF_Log_Open (i, idname, CF_LOG_NO_BUFFER) < 0)
-			fprintf (stderr, "failed to open log\n");
-	}
-
-	for (i = 0 ; i < 10 ; i++)
-	{
-		for (j = 0 ; j < 10000 ; j++)
-		{
-			int result = CF_Log_Write (i, "LOG_ID_TEST", "turn %d\n", j); 
-			if (result < 0)
-				fprintf (stderr, "failed to write log %d\n", result);
-		}
-
-		if (CF_Log_Close (i) < 0)
-			fprintf (stderr, "failed to close log\n");
+		int result = CF_Log_Write (globalLog, "LOG_ID_TEST", "turn %d\n", j); 
+		if (result < 0)
+			CF_DEBUG_PRINT (stderr, "failed to write log %d\n", result);
 	}
 
 	/* mt {{{ */
-	if (CF_Log_Open (LOG_MT, "log_mt.txt", CF_LOG_DEFAULT_BUFFER) < 0)
+	if (CF_Log_Create (&globalLog, "log_mt.txt", CF_LOG_NO_BUFFER) < 0)
 		CF_DEBUG_PRINT (stderr, "create log ctx error\n");
 
-	if (CF_Log_SetMT (LOG_MT, CF_TRUE) < 0)
-		CF_DEBUG_PRINT (stderr, "set multi-threading mode error\n");
-
-	if (CF_Mutex_CreateCtx (&globalMutex) < 0) {
+	if (CF_Mutex_Create (&globalMutex) < 0) {
 		// error
 	}
 
-	for (i = 0 ; i < 10 ; i++)
+	if (CF_Log_SetMultiThread (globalLog) < 0)
+		CF_DEBUG_PRINT (stderr, "set multi-threading mode error\n");
+
+	for (i = 0 ; i < COUNT ; i++)
 	{
-		if (CF_Thread_CreateCtx (&tid[i], test_log_mt, &i) < 0)
+		if (CF_Thread_Create (&tid[i], worker, &i) < 0)
 		{
 			CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", i);
@@ -93,5 +77,5 @@
 	}
 
-	for (i = 0 ; i < 10 ; i++)
+	for (i = 0 ; i < COUNT ; i++)
 	{
 		if (CF_Thread_Start (tid[i]) < 0)
@@ -102,13 +86,16 @@
 	}
 
-	for (i = 0 ; i < 10 ; i++)
+	for (i = 0 ; i < COUNT ; i++)
 	{
 		if (CF_Thread_Join (tid[i]) < 0)
 			CF_DEBUG_PRINT (stderr, "failed to join %dth thread\n", i);
-		if (CF_Thread_DestroyCtx (tid[i]) < 0)
+		if (CF_Thread_Destroy (tid[i]) < 0)
 			CF_DEBUG_PRINT (stderr, "failed to release %dth thread\n", i);
 	}
 
-	if (CF_Mutex_DestoryCtx (globalMutex) < 0) {
+	if (CF_Log_UnsetMultiThread (globalLog) < 0)
+		CF_DEBUG_PRINT (stderr, "set multi-threading mode error\n");
+
+	if (CF_Mutex_Destory (globalMutex) < 0) {
 		// error
 	}
@@ -116,5 +103,5 @@
 
 	/* finalize */
-	CF_Log_Finalize ();
+	CF_Log_Destroy (globalLog);
 
 	return 0;
Index: /trunk/test/queue.c
===================================================================
--- /trunk/test/queue.c	(revision 150)
+++ /trunk/test/queue.c	(revision 151)
@@ -6,4 +6,6 @@
 #include "cf_debug.h"
 
+#define	COUNT	5
+
 int main (void)
 {
@@ -11,15 +13,15 @@
 	int				result = 0;
 	long long int	element = 0;
-	CF_Queue_Ctx	ctx = NULL;
+	cf_ctx			queue = NULL;
 
 	// create
-	result = CF_Queue_CreateCtx (&ctx);
+	result = CF_Queue_Create (&queue);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
 
 	// insert
-	for (iter = 0 ; iter < 10 ; iter++)
+	for (iter = 0 ; iter < COUNT ; iter++)
 	{
-		result = CF_Queue_Put (ctx, (void *)iter);
+		result = CF_Queue_Put (queue, (void *)iter);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -27,7 +29,7 @@
 
 	// move next
-	for (iter = 0 ; iter < 10 ; iter++)
+	for (iter = 0 ; iter < COUNT ; iter++)
 	{
-		result = CF_Queue_Front (ctx, (void **)&element);
+		result = CF_Queue_Front (queue, (void **)&element);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -35,5 +37,5 @@
 			CF_DEBUG_PRINT (stderr, "front : %4d\n", element);
 
-		result = CF_Queue_Get (ctx, (void **)&element);
+		result = CF_Queue_Get (queue, (void **)&element);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -45,5 +47,5 @@
 
 	// destroy
-	result = CF_Queue_DestroyCtx (ctx);
+	result = CF_Queue_Destroy (queue);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
Index: /trunk/test/socket.c
===================================================================
--- /trunk/test/socket.c	(revision 150)
+++ /trunk/test/socket.c	(revision 151)
@@ -8,12 +8,15 @@
 #include <string.h>
 
-#define LOG_SOCKET		0
-#define THREAD_POOL		1
+#define THREAD_POOL		2
 #define PORT			1234
-
-int socket_echo_server (void * arg)
+#define COUNT			2
+
+cf_ctx gLog;
+
+int server_worker (void * arg)
 {
-	int srvsock = *((int *)arg);
-	int clntsock = 0;
+	cf_ctx srvsock = (cf_ctx)arg;
+	cf_ctx clntsock = NULL;
+	int result = 0;
 	int recvd = 0;
 	char buf[1024] = {0x00,};
@@ -21,13 +24,13 @@
 
 	/*------------------------------------------------------------*/
-	clntsock = CF_Socket_Accept (srvsock);
-	if (clntsock < 0)
+	result = CF_Socket_Accept (srvsock, &clntsock);
+	if (result < 0)
 	{
 		CF_DEBUG_PRINT (stderr, "failed to accept on server\n");
 		return -1;
 	}
-	CF_Log_Write (LOG_SOCKET, "SERVER", "accepted\n");
-
-	for (i = 0 ; i < 5 ; i++)
+	CF_Log_Write (gLog, "SERVER", "accepted\n");
+
+	for (i = 0 ; i < COUNT ; i++)
 	{
 		if ((recvd = CF_Socket_Recv (clntsock, buf, sizeof (buf))) < 0)
@@ -36,6 +39,6 @@
 			return -2;
 		}
-		CF_Log_Write (LOG_SOCKET, "SERVER", "recv {%s}\n", buf);
-		CF_DEBUG_PRINT (stderr, "[SERVER] recv {%s}\n", buf);
+		CF_Log_Write (gLog, "SERVER", "recv {%s}\n", buf);
+		CF_DEBUG_PRINT (stderr, "recv {%s}\n", buf);
 
 		if (CF_Socket_Send (clntsock, buf, (size_t)recvd) < 0)
@@ -43,6 +46,6 @@
 			return -3;
 		}
-		CF_Log_Write (LOG_SOCKET, "SERVER", "resp {%s}\n", buf);
-		CF_DEBUG_PRINT (stderr, "[SERVER] resp {%s}\n", buf);
+		CF_Log_Write (gLog, "SERVER", "resp {%s}\n", buf);
+		CF_DEBUG_PRINT (stderr, "resp {%s}\n", buf);
 	}
 
@@ -53,7 +56,8 @@
 }
 
-int socket_echo_client (void * arg)
+int client_worker (void * arg)
 {
-	int sock = 0;
+	cf_ctx sock = NULL;
+	int result = 0;
 	int recvd = 0;
 	char buf[1024] = {0x00,};
@@ -63,21 +67,28 @@
 
 	/*------------------------------------------------------------*/
-	sock = CF_Socket_Connect ("localhost", PORT);
-	if (sock < 0)
+	result = CF_Socket_Create (&sock);
+	if (result < 0)
+	{
+		CF_DEBUG_PRINT (stderr, "failed to create\n");
+		return -1;
+	}
+
+	result = CF_Socket_Connect (sock, "localhost", PORT);
+	if (result < 0)
 	{
 		CF_DEBUG_PRINT (stderr, "failed to connect on client\n");
-		return -1;
-	}
-	CF_Log_Write (LOG_SOCKET, "CLIENT", "connected\n");
-
-	for (i = 0 ; i < 5 ; i++)
+		return -2;
+	}
+	CF_Log_Write (gLog, "CLIENT", "connected\n");
+
+	for (i = 0 ; i < COUNT ; i++)
 	{
 		if (CF_Socket_Send (sock, buf, sizeof (buf)) < 0)
 		{
 			CF_DEBUG_PRINT (stderr, "failed to send on client %d\n", errno);
-			return -2;
-		}
-		CF_Log_Write (LOG_SOCKET, "CLIENT", "sent {%s}\n", buf);
-		CF_DEBUG_PRINT (stderr, "[CLIENT] sent {%s}\n", buf);
+			return -3;
+		}
+		CF_Log_Write (gLog, "CLIENT", "sent {%s}\n", buf);
+		CF_DEBUG_PRINT (stderr, "sent {%s}\n", buf);
 
 		memset (buf, 0x00, sizeof (buf));
@@ -86,8 +97,8 @@
 		{
 			CF_DEBUG_PRINT (stderr, "failed to recv on client\n");
-			return -3;
-		}
-		CF_Log_Write (LOG_SOCKET, "CLIENT", "recv {%s}\n", buf);
-		CF_DEBUG_PRINT (stderr, "[CLIENT] recv {%s}\n", buf);
+			return -4;
+		}
+		CF_Log_Write (gLog, "CLIENT", "recv {%s}\n", buf);
+		CF_DEBUG_PRINT (stderr, "recv {%s}\n", buf);
 	}
 
@@ -100,30 +111,34 @@
 int main ()
 {
-	CF_Thread_Ctx stid[THREAD_POOL];
-	CF_Thread_Ctx ctid[THREAD_POOL];
-
-	int sock = 0;
+	cf_ctx stid[THREAD_POOL];
+	cf_ctx ctid[THREAD_POOL];
+
+	char ip[256] = {0x00,};
+	unsigned short port = 0;
+	cf_ctx sock = 0;
+	int result = 0;
 	int iter = 0;
 
 	/*------------------------------------------------------------*/
-	if (CF_Log_Initialize (1) < 0)
-	{
-		fprintf (stderr, "failed to init. log\n");
+	if (CF_Log_Create (&gLog, "socket.txt", CF_LOG_DEFAULT_BUFFER) < 0)
+		CF_DEBUG_PRINT (stderr, "failed to open log\n");
+
+	CF_Log_Write (gLog, "LOG_MULTITHREAD", "multi-threaded logging test with socket\n");
+
+	if (CF_Socket_Initialize () < 0)
+	{
+		CF_DEBUG_PRINT (stderr, "failed to initialize socket\n");
 		return -1;
 	}
-
-	if (CF_Log_Open (LOG_SOCKET, "socket.txt", CF_LOG_DEFAULT_BUFFER) < 0)
-		CF_DEBUG_PRINT (stderr, "failed to open log\n");
-
-	CF_Log_Write (LOG_SOCKET, "LOG_MULTITHREAD", "multi-threaded logging test with socket\n");
-
-	if (CF_Socket_Initialize () < 0)
-	{
-		CF_DEBUG_PRINT (stderr, "failed to initialize socket\n");
+	CF_Log_Write (gLog, "SOCKET", "socket initialized\n");
+
+	result = CF_Socket_Create (&sock);
+	if (result < 0)
+	{
+		CF_DEBUG_PRINT (stderr, "failed to create\n");
 		return -2;
 	}
-	CF_Log_Write (LOG_SOCKET, "SOCKET", "socket initialized\n");
-
-	sock = CF_Socket_Server (PORT, 5);
+
+	result = CF_Socket_Server (sock, PORT, 5);
 	if (sock < 0)
 	{
@@ -131,24 +146,28 @@
 		return -3;
 	}
-	CF_Log_Write (LOG_SOCKET, "SOCKET", "socket ready\n");
-
-	for (iter = 0 ; iter < THREAD_POOL ; iter++)
-	{
-		if (CF_Thread_CreateCtx (&stid[iter], socket_echo_server, &sock) < 0)
+	CF_Socket_GetIP (sock, ip);
+	CF_Socket_GetPort (sock, &port);
+	CF_Log_Write (gLog, "SOCKET", "socket ready [%s:%d]\n", ip, port);
+	CF_DEBUG_PRINT (stderr, "socket ready [%s:%d]\n", ip, port);
+ 
+
+	for (iter = 0 ; iter < THREAD_POOL ; iter++)
+	{
+		if (CF_Thread_Create (&stid[iter], server_worker, sock) < 0)
 		{
 			CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", iter);
 			return -4;
 		}
-		CF_Log_Write (LOG_SOCKET, "SOCKET", "create server thread-%d\n", iter);
-	}
-
-	for (iter = 0 ; iter < THREAD_POOL ; iter++)
-	{
-		if (CF_Thread_CreateCtx (&ctid[iter], socket_echo_client, &sock) < 0)
+		CF_Log_Write (gLog, "SOCKET", "create server thread-%d\n", iter);
+	}
+
+	for (iter = 0 ; iter < THREAD_POOL ; iter++)
+	{
+		if (CF_Thread_Create (&ctid[iter], client_worker, &sock) < 0)
 		{
 			CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", iter);
 			return -5;
 		}
-		CF_Log_Write (LOG_SOCKET, "SOCKET", "create client thread-%d\n", iter);
+		CF_Log_Write (gLog, "SOCKET", "create client thread-%d\n", iter);
 	}
 
@@ -174,10 +193,10 @@
 	{
 		CF_Thread_Join (ctid[iter]);
-		CF_Thread_DestroyCtx (ctid[iter]);
+		CF_Thread_Destroy (ctid[iter]);
 
 		CF_Thread_Join (stid[iter]);
-		CF_Thread_DestroyCtx (stid[iter]);
-
-		CF_Log_Write (LOG_SOCKET, "SOCKET", "join server thread-%d\n", iter);
+		CF_Thread_Destroy (stid[iter]);
+
+		CF_Log_Write (gLog, "SOCKET", "join server thread-%d\n", iter);
 	}
 
@@ -186,7 +205,5 @@
 	CF_Socket_Finalize ();
 
-	CF_Log_Close (LOG_SOCKET);
-
-	CF_Log_Finalize ();
+	CF_Log_Destroy (gLog);
 	/*------------------------------------------------------------*/
 
Index: /trunk/test/stack.c
===================================================================
--- /trunk/test/stack.c	(revision 150)
+++ /trunk/test/stack.c	(revision 151)
@@ -6,4 +6,6 @@
 #include "cf_debug.h"
 
+#define	COUNT	5
+
 int main (void)
 {
@@ -11,15 +13,15 @@
 	int				result = 0;
 	long long int	element = 0;
-	CF_Stack_Ctx	ctx = NULL;
+	cf_ctx			stack = NULL;
 
 	// create
-	result = CF_Stack_CreateCtx (&ctx);
+	result = CF_Stack_Create (&stack);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
 
 	// insert
-	for (iter = 0 ; iter < 10 ; iter++)
+	for (iter = 0 ; iter < COUNT ; iter++)
 	{
-		result = CF_Stack_Push (ctx, (void *)iter);
+		result = CF_Stack_Push (stack, (void *)iter);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -27,7 +29,7 @@
 
 	// move next
-	for (iter = 0 ; iter < 10 ; iter++)
+	for (iter = 0 ; iter < COUNT ; iter++)
 	{
-		result = CF_Stack_Top (ctx, (void **)&element);
+		result = CF_Stack_Top (stack, (void **)&element);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -35,5 +37,5 @@
 			CF_DEBUG_PRINT (stderr, "top   : %4d\n", element);
 
-		result = CF_Stack_Pop (ctx, (void **)&element);
+		result = CF_Stack_Pop (stack, (void **)&element);
 		if (result < 0)
 			CF_DEBUG_PRINT (stderr, "error %d\n", result);
@@ -45,5 +47,5 @@
 
 	// destroy
-	result = CF_Stack_DestroyCtx (ctx);
+	result = CF_Stack_Destroy (stack);
 	if (result < 0)
 		CF_DEBUG_PRINT (stderr, "error %d\n", result);
Index: /trunk/test/thread.c
===================================================================
--- /trunk/test/thread.c	(revision 150)
+++ /trunk/test/thread.c	(revision 151)
@@ -8,7 +8,10 @@
 #include <stdio.h>
 
-CF_Mutex_Ctx globalMutex;
+#define	COUNT	5
 
-int worker (void * arg) {
+cf_ctx globalMutex;
+
+int worker (void * arg)
+{
 	if (CF_Mutex_Lock (globalMutex) < 0) { // for critical section
 		// error
@@ -24,19 +27,20 @@
 }
 
-int main (void) {
-	CF_Thread_Ctx tid[10];
-	int i = 0;
+int main (void)
+{
+	cf_ctx	tid[COUNT];
+	int		i = 0;
 
-	if (CF_Mutex_CreateCtx (&globalMutex) < 0) {
+	if (CF_Mutex_Create (&globalMutex) < 0) {
 		// error
 	}
 
-	for (i = 0 ; i < 10 ; i++) {
-		if (CF_Thread_CreateCtx (&tid[i], worker, NULL) < 0) {
+	for (i = 0 ; i < COUNT ; i++) {
+		if (CF_Thread_Create (&tid[i], worker, NULL) < 0) {
 			// error
 		}
 	}
 
-	for (i = 0 ; i < 10 ; i++) {
+	for (i = 0 ; i < COUNT ; i++) {
 		if (CF_Thread_Start (tid[i]) < 0) {
 			// error
@@ -44,5 +48,5 @@
 	}
 
-	for (i = 0 ; i < 10 ; i++) {
+	for (i = 0 ; i < COUNT ; i++) {
 		if (CF_Thread_Join (tid[i]) < 0) { // block
 			// error
@@ -50,11 +54,11 @@
 	}
 
-	for (i = 0 ; i < 10 ; i++) {
-		if (CF_Thread_DestroyCtx (tid[i]) < 0) {
+	for (i = 0 ; i < COUNT ; i++) {
+		if (CF_Thread_Destroy (tid[i]) < 0) {
 			// error
 		}
 	}
 
-	if (CF_Mutex_DestoryCtx (globalMutex) < 0) {
+	if (CF_Mutex_Destory (globalMutex) < 0) {
 		// error
 	}
Index: /trunk/test/util.c
===================================================================
--- /trunk/test/util.c	(revision 151)
+++ /trunk/test/util.c	(revision 151)
@@ -0,0 +1,21 @@
+/**
+ * @file	util.c
+ * @author	myusgun <myusgun@gmail.com>
+ */
+#include "cf_util.h"
+#include <stdio.h>
+
+int main (void)
+{
+	CF_UTIL_DATETIME dt;
+
+	char buf[CF_UTIL_DATETIME_LENGTH + 1] = {0x00,};
+
+	CF_Util_GetCurrentTime (&dt);
+
+	CF_Util_GetTimeString (&dt, buf);
+
+	printf ("current time : %s\n", buf);
+
+	return 0;
+}
