Index: trunk/src/cf_debug.c
===================================================================
--- trunk/src/cf_debug.c	(revision 147)
+++ 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;
 
