Changeset 109 in libcf


Ignore:
Timestamp:
06/04/13 14:25:10 (11 years ago)
Author:
cheese
Message:

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

Location:
trunk
Files:
7 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_base.h

    r105 r109  
    3333
    3434/** boolean 타입 */
    35 typedef enum {
     35typedef enum
     36{
    3637    CF_FALSE = 0,   /**< 거짓 */
    3738    CF_TRUE = 1     /**< 참 */
    38 } E_CF_BOOL,
    39 /**
    40  * boolean 타입
    41  * @see E_CF_BOOL
    42  */
    43     CF_BOOL;
     39} CF_BOOL;
    4440
    4541/** 성공 시, 반환 값 */
     
    4743/** 오류 코드 */
    4844#define CF_ERROR                        -1
    49 
    50 /** 파일 이름 및 경로 길이 */
    51 #define NAME_LENGTH                     128
    5245
    5346/** Windows 에서의 함수 EXPORT 구문 정의 */
  • trunk/include/cf_error.h

    r88 r109  
    5353#define CF_ERROR_THREAD                     CF_ERROR_BASE * 4
    5454/*------------------------------------------------------------*/
    55 #define CF_ERROR_THREAD_ALLOC               CF_ERROR_THREAD - 1
     55#define CF_ERROR_THREAD_CREATE_CTX          CF_ERROR_THREAD - 1
    5656#define CF_ERROR_THREAD_CREATE              CF_ERROR_THREAD - 2
    5757#define CF_ERROR_THREAD_INVALID_ARGS        CF_ERROR_THREAD - 3
     
    7676#define CF_ERROR_DEBUG_POP_CALLSTACK        CF_ERROR_DEBUG - 3
    7777#define CF_ERROR_DEBUG_PEEK_CALLSTACK       CF_ERROR_DEBUG - 4
    78 #define CF_ERROR_DEBUG_ALLOCATE_CTX         CF_ERROR_DEBUG - 5
     78#define CF_ERROR_DEBUG_CREATE_CTX           CF_ERROR_DEBUG - 5
    7979/* }}} debug */
    8080
     
    9494#define CF_ERROR_LOG_NOT_INITIALIZE         CF_ERROR_LOG - 11
    9595#define CF_ERROR_LOG_INVALID_ARGS           CF_ERROR_LOG - 12
    96 #define CF_ERROR_LOG_ALLOCATE_CTX           CF_ERROR_LOG - 13
     96#define CF_ERROR_LOG_CREATE_CTX             CF_ERROR_LOG - 13
    9797#define CF_ERROR_LOG_CREATE_FILE            CF_ERROR_LOG - 14
    9898#define CF_ERROR_LOG_ALLOCATE_BUFFER        CF_ERROR_LOG - 15
     
    107107/* }}} codec */
    108108
     109/* data structure - list/queue/stack {{{ */
     110#define CF_ERROR_DS                         CF_ERROR_BASE * 9
     111/*------------------------------------------------------------*/
     112#define CF_ERROR_DS_INVALID_CTX             CF_ERROR_DS - 1
     113#define CF_ERROR_DS_INVALID_TRAVERSER       CF_ERROR_DS - 2
     114#define CF_ERROR_DS_INVALID_ARGS            CF_ERROR_DS - 3
     115#define CF_ERROR_DS_CREATE_CTX              CF_ERROR_DS - 4
     116#define CF_ERROR_DS_CREATE_NODE             CF_ERROR_DS - 5
     117#define CF_ERROR_DS_NO_MORE                 CF_ERROR_DS - 6
     118/* }}} data structure - list/queue/stack */
    109119
    110120#endif // #ifndef __CF_ERROR_H__
  • trunk/include/cf_file.h

    r94 r109  
    1515
    1616/** 파일 열기 옵션 플래그 */
    17 typedef enum {
     17typedef enum
     18{
    1819    CF_FILE_READ        = 0x0001,   /**< 읽기 전용 */
    1920    CF_FILE_WRITE       = 0x0002,   /**< 쓰기 전용 */
     
    2223    CF_FILE_TRUNC       = 0x0010,   /**< 파일이 존재하면 비우기 */
    2324    CF_FILE_APPEND      = 0x0020    /**< 파일이 존재하면 이어서 쓰기 */
    24 } E_CF_FILE_FLAG, CF_FILE_FLAG;
     25} CF_FILE_FLAG;
    2526
    2627#ifdef __cplusplus
     
    5152CF_File_GetSize         (const char * path);
    5253
     54CF_EXPORT CF_BOOL
     55CF_File_Exists          (const char * path);
     56
    5357CF_EXPORT int
    5458CF_File_MakeDirectory   (const char * path);
  • trunk/include/cf_log.h

    r108 r109  
    1515
    1616/** 로그 옵션 플래그 */
    17 typedef enum {
     17typedef enum
     18{
    1819    CF_LOG_DEFAULT_BUFFER   = -1,   /**< 기본 버퍼 크기 사용 */
    1920    CF_LOG_NO_BUFFER        = 0,    /**< 버퍼없이 파일에 바로 쓰기 */
    20 } E_CF_LOG_OPTION, CF_LOG_OPTION;
     21} CF_LOG_OPTION;
    2122
    2223#ifdef __cplusplus
  • trunk/include/cf_socket.h

    r73 r109  
    55 * @remark TCP 소켓 지원
    66 *
    7  * @example socket_server.c
    8  * @example socket_client.c
     7 * @example socket.c
    98 */
    109#ifndef __CF_SOCKET_H__
     
    6362
    6463CF_EXPORT int
    65 CF_Socket_Send              (const int  sock,
    66                              const void * buf,
    67                              const int  len);
     64CF_Socket_Send              (const int      sock,
     65                             const void     * buf,
     66                             const size_t   len);
    6867
    6968CF_EXPORT int
    70 CF_Socket_SendTimeout       (const int  sock,
    71                              const void * buf,
    72                              const int  len,
    73                              const int  timeout);
     69CF_Socket_SendTimeout       (const int      sock,
     70                             const void     * buf,
     71                             const size_t   len,
     72                             const int      timeout);
    7473
    7574CF_EXPORT int
    76 CF_Socket_Recv              (const int  sock,
    77                              void       * buf,
    78                              const int  len);
     75CF_Socket_Recv              (const int      sock,
     76                             void           * buf,
     77                             const size_t   len);
    7978
    8079CF_EXPORT int
    81 CF_Socket_RecvTimeout       (const int  sock,
    82                              void       * buf,
    83                              const int  len,
    84                              const int  timeout);
     80CF_Socket_RecvTimeout       (const int      sock,
     81                             void           * buf,
     82                             const size_t   len,
     83                             const int      timeout);
    8584
    8685#ifdef __cplusplus
  • trunk/include/cf_thread.h

    r66 r109  
    1616
    1717/** 스레드 아이디 */
    18 typedef void *  CF_Thread;
     18typedef void *  CF_Thread_Ctx;
    1919
    2020/** 뮤텍스 아이디 */
    21 typedef void *  CF_Mutex;
     21typedef void *  CF_Mutex_Ctx;
    2222
    2323#ifdef __cplusplus
     
    2626
    2727CF_EXPORT int
    28 CF_Thread_Create    (CF_Thread          * threadID,
    29                     CF_Thread_Function callback,
    30                     void               * arg);
     28CF_Thread_CreateCtx     (CF_Thread_Ctx      * threadID,
     29                        CF_Thread_Function callback,
     30                        void               * arg);
    3131
    3232CF_EXPORT int
    33 CF_Thread_Release   (CF_Thread * threadID);
     33CF_Thread_DestroyCtx    (CF_Thread_Ctx * threadID);
    3434
    3535CF_EXPORT int
    36 CF_Thread_Join      (CF_Thread * threadID);
     36CF_Thread_Join          (CF_Thread_Ctx * threadID);
    3737
    3838CF_EXPORT int
    39 CF_Mutex_Create     (CF_Mutex * mutex);
     39CF_Mutex_CreateCtx      (CF_Mutex_Ctx * mutex);
    4040
    4141CF_EXPORT int
    42 CF_Mutex_Destory    (CF_Mutex * mutex);
     42CF_Mutex_DestoryCtx     (CF_Mutex_Ctx * mutex);
    4343
    4444CF_EXPORT int
    45 CF_Mutex_Lock       (CF_Mutex * mutex);
     45CF_Mutex_Lock           (CF_Mutex_Ctx * mutex);
    4646
    4747CF_EXPORT int
    48 CF_Mutex_Unlock     (CF_Mutex * mutex);
     48CF_Mutex_Unlock         (CF_Mutex_Ctx * mutex);
    4949
    5050#ifdef __cplusplus
  • trunk/src/cf_debug.c

    r107 r109  
    2525        return CF_ERROR_DEBUG_INVALID_CTX
    2626
    27 /**
    28  * 디버그 컨텍스트
    29  *
    30  * @remark change from public to private
    31  */
     27/** 디버그 컨텍스트 (Opaque) */
    3228typedef void *  CF_Debug_Ctx;
    3329
    34 /* *
    35  * 콜스택 데이터
    36  *
    37  * @remark change from public to private
    38  */
     30/** 콜스택 인터페이스 */
    3931typedef struct cf_debug_callStack {
    4032    char    file[NAME_LENGTH + 1];      /* *< 파일 이름 */
     
    4335} CF_Debug_CallStack;
    4436
     37/** 콜스택 컨텍스트 */
    4538typedef struct __cf_debug_callstack__
    4639{
     
    5245
    5346    struct __cf_debug_callstack__   * caller;
    54 } S_CF_DEBUG_CALLSTACK, CF_DEBUG_CALLSTACK;
    55 
     47} CF_DEBUG_CALLSTACK;
     48
     49/** 디버그 컨텍스트 (CF_Debug_Ctx의 구현) */
    5650typedef struct __cf_debug_ctx__
    5751{
    58     char        file[NAME_LENGTH + 1];
    59     char        func[NAME_LENGTH + 1];
    60     int         line;
    61 
    62     CF_Mutex    mutex;
     52    int             fd;
     53    CF_Mutex_Ctx    mutex;
    6354
    6455    CF_DEBUG_CALLSTACK  callstack;
    65 } S_CF_DEBUG_CTX, CF_DEBUG_CTX;
     56} CF_DEBUG_CTX;
    6657
    6758CF_Debug_Ctx    gDebugSingleCtx = NULL;
    68 
    69 static int
    70 CF_Debug_Local_UpdateCtx (CF_Debug_Ctx  ctx,
    71                           const char    * file,
    72                           const char    * func,
    73                           const int     line)
    74 {
    75     CF_DEBUG_CTX * context = (CF_DEBUG_CTX *) ctx;
    76 
    77     ASSERT_CTX (ctx);
    78 
    79     strncpy (context->file, file, strlen (file));
    80     strncpy (context->func, func, strlen (func));
    81     context->line = line;
    82 
    83     return CF_OK;
    84 }
    8559
    8660static int
     
    232206    context->callstack.caller = push;
    233207
    234     CF_Debug_Local_UpdateCtx (ctx, file, func, line);
    235 
    236208    return CF_OK;
    237209}
     
    294266        return CF_ERROR_DEBUG_PEEK_CALLSTACK;
    295267
    296     memset (context->file, 0x00, sizeof (context->file));
    297     memset (context->func, 0x00, sizeof (context->func));
    298     context->line = 0;
    299 
    300     /* restore current context */
    301     if (pop->caller != NULL)
    302     {
    303         CF_Debug_Local_UpdateCtx (ctx,
    304                                   pop->caller->file,
    305                                   pop->caller->func,
    306                                   pop->caller->line);
    307     }
    308 
    309268    context->callstack.caller = pop->caller;
    310269    free (pop);
     
    333292
    334293    if (context->mutex)
    335         CF_Mutex_Destory (&context->mutex);
     294        CF_Mutex_DestoryCtx (&context->mutex);
    336295
    337296    free (context);
     
    357316        if (context == NULL)
    358317        {
    359             result = CF_ERROR_DEBUG_ALLOCATE_CTX;
     318            result = CF_ERROR_DEBUG_CREATE_CTX;
    360319            TRY_BREAK;
    361320        }
    362321
    363         result = CF_Mutex_Create (&context->mutex);
     322        result = CF_Mutex_CreateCtx (&context->mutex);
    364323        if (result < 0)
    365324        {
  • trunk/src/cf_file.c

    r95 r109  
    219219
    220220/**
     221 * 파일 및 디렉터리 존재 여부 검사
     222 *
     223 * @return 존재 시, CF_TRUE; 아니면, CF_FALSE
     224 *
     225 * @param path 파일 및 디렉터리 경로
     226 */
     227CF_BOOL
     228CF_File_Exists (const char * path)
     229{
     230    return (access (path, F_OK) == 0) ? CF_TRUE : CF_FALSE;
     231}
     232
     233/**
    221234 * 디렉터리 생성
    222235 *
     
    244257            continue;
    245258
    246         if (access (stepPath, F_OK) == 0)
     259        if (CF_File_Exists (stepPath))
    247260            continue;
    248261
  • trunk/src/cf_local.h

    r66 r109  
    66#define __CF_LOCAL_H__
    77
     8/** 파일 이름 및 경로 길이 */
     9#define NAME_LENGTH                     128
     10
     11/** 예외 처리 */
    812#define TRY                     do
    913#define TRY_BREAK               break
     
    1317#define CATCH_ELSE              else
    1418
     19/** non-compatible function */
    1520#if defined(_WIN32) || defined(_WIN64)
    1621# define snprintf       _snprintf
  • trunk/src/cf_log.c

    r108 r109  
    5757#define LOG_DATETIME_LENGTH             sizeof ("0000-00-00 00:00:00.000") - 1
    5858
    59 /**
    60  * 로그 컨텍스트
    61  *
    62  * @remark change from public to private
    63  */
     59/** 로그 컨텍스트 (Opaque) */
    6460typedef void *  CF_Log_Ctx;
    6561
     
    7571    int sec;
    7672    int usec;
    77 } S_CF_LOG_DATETIME, CF_LOG_DATETIME;
    78 
     73} CF_LOG_DATETIME;
     74
     75/** 로그 컨텍스트 (CF_Log_Ctx의 구현) */
    7976typedef struct __cf_log_ctx__ {
    80     char        path[NAME_LENGTH + 1];
    81     int         fd;
    82     char        * buffer;
    83     size_t      size;   /* entire size of buffer */
    84     size_t      length; /* data length in current */
    85     CF_Mutex    mutex;
    86 } S_CF_LOG_CTX, CF_LOG_CTX;
     77    char            path[NAME_LENGTH + 1];
     78    int             fd;
     79    char            * buffer;
     80    size_t          size;   /* entire size of buffer */
     81    size_t          length; /* data length in current */
     82    CF_Mutex_Ctx    mutex;
     83} CF_LOG_CTX;
    8784
    8885typedef struct __cf_log_array__ {
    8986    CF_Log_Ctx  * ctxPool;
    9087    int         ctxSize;
    91 } S_CF_LOG_ARRAY, CF_LOG_ARRAY;
     88} CF_LOG_ARRAY;
    9289
    9390static CF_LOG_ARRAY gLogArray;
     
    257254    ASSERT_CTX (ctx);
    258255
    259     if (CF_Mutex_Create (&context->mutex) < 0)
     256    if (CF_Mutex_CreateCtx (&context->mutex) < 0)
    260257        return CF_ERROR_LOG_SET_MULTITHREAD;
    261258
     
    279276    ASSERT_CTX (ctx);
    280277
    281     if (CF_Mutex_Destory (&context->mutex) < 0)
     278    if (CF_Mutex_DestoryCtx (&context->mutex) < 0)
    282279        return CF_ERROR_LOG_UNSET_MULTITHREAD;
    283280
     
    371368    CF_File_Close (context->fd);
    372369
    373     CF_Mutex_Destory (&context->mutex);
     370    CF_Mutex_DestoryCtx (&context->mutex);
    374371    context->mutex = NULL;
    375372
     
    409406        if (context == NULL)
    410407        {
    411             result = CF_ERROR_LOG_ALLOCATE_CTX;
     408            result = CF_ERROR_LOG_CREATE_CTX;
    412409            TRY_BREAK;
    413410        }
  • trunk/src/cf_socket.c

    r104 r109  
    510510 */
    511511int
    512 CF_Socket_Send (const int   sock,
    513                 const void  * buf,
    514                 const int   len)
     512CF_Socket_Send (const int       sock,
     513                const void      * buf,
     514                const size_t    len)
    515515{
    516516    return CF_Socket_SendTimeout (sock, buf, len, CF_SOCKET_NO_TIMEOUT);
     
    532532CF_Socket_SendTimeout (const int    sock,
    533533                       const void   * buf,
    534                        const int    len,
     534                       const size_t len,
    535535                       const int    timeout)
    536536{
     
    539539    ASSERT_SOCKET (sock);
    540540
    541     result = (int) send (sock, buf, (size_t) len, 0);
     541    result = (int) send (sock, buf, len, 0);
    542542    if (result != len)
    543543        return CF_ERROR_SOCKET_SEND;
     
    556556 */
    557557int
    558 CF_Socket_Recv (const int   sock,
    559                 void        * buf,
    560                 const int   len)
     558CF_Socket_Recv (const int       sock,
     559                void            * buf,
     560                const size_t    len)
    561561{
    562562    return CF_Socket_RecvTimeout (sock, buf, len, CF_SOCKET_NO_TIMEOUT);
     
    578578CF_Socket_RecvTimeout (const int    sock,
    579579                       void         * buf,
    580                        const int    len,
     580                       const size_t len,
    581581                       const int    timeout)
    582582{
     
    589589        return result;
    590590
    591     result = (int) recv (sock, buf, (size_t) len, 0);
     591    result = (int) recv (sock, buf, len, 0);
    592592    if (result < 0)
    593593        return CF_ERROR_SOCKET_RECV;
  • trunk/src/cf_thread.c

    r85 r109  
    6565 */
    6666int
    67 CF_Thread_Create (CF_Thread             * threadID,
    68                   CF_Thread_Function    callback,
    69                   void                  * arg)
     67CF_Thread_CreateCtx (CF_Thread_Ctx      * threadID,
     68                    CF_Thread_Function callback,
     69                     void               * arg)
    7070{
    7171    int result = 0;
     
    106106    *threadID = (THREAD_TYPE *) calloc (sizeof (THREAD_TYPE), 1);
    107107    if (*threadID == NULL)
    108         return CF_ERROR_THREAD_ALLOC;
     108        return CF_ERROR_THREAD_CREATE_CTX;
    109109
    110110    result = pthread_create ((THREAD_TYPE *) *threadID, attr, f, arg);
    111111    if (result)
    112112    {
    113         CF_Thread_Release (threadID);
     113        CF_Thread_DestroyCtx (threadID);
    114114        return CF_ERROR_THREAD_CREATE;
    115115    }
     
    129129 */
    130130int
    131 CF_Thread_Release (CF_Thread * threadID)
     131CF_Thread_DestroyCtx (CF_Thread_Ctx * threadID)
    132132{
    133133    ASSERT_THREAD (*threadID);
     
    144144 */
    145145int
    146 CF_Thread_Join (CF_Thread * threadID)
     146CF_Thread_Join (CF_Thread_Ctx * threadID)
    147147{
    148148    ASSERT_THREAD (*threadID);
     
    168168 */
    169169int
    170 CF_Mutex_Create (CF_Mutex * mutex)
     170CF_Mutex_CreateCtx (CF_Mutex_Ctx * mutex)
    171171{
    172172    int result = 0;
     
    197197 */
    198198int
    199 CF_Mutex_Destory (CF_Mutex * mutex)
     199CF_Mutex_DestoryCtx (CF_Mutex_Ctx * mutex)
    200200{
    201201    ASSERT_MUTEX (*mutex);
     
    216216 */
    217217int
    218 CF_Mutex_Lock (CF_Mutex * mutex)
     218CF_Mutex_Lock (CF_Mutex_Ctx * mutex)
    219219{
    220220    ASSERT_MUTEX (*mutex);
     
    237237 */
    238238int
    239 CF_Mutex_Unlock (CF_Mutex * mutex)
     239CF_Mutex_Unlock (CF_Mutex_Ctx * mutex)
    240240{
    241241    ASSERT_MUTEX (*mutex);
  • trunk/src/makefile

    r83 r109  
    1515                    cf_log          \
    1616                    cf_codec        \
     17                    cf_list         \
     18                    cf_queue        \
     19                    cf_stack        \
    1720
    1821TARGET_NAME     = cf
  • trunk/test/log.c

    r108 r109  
    99#include <stdio.h>
    1010
    11 CF_Mutex globalMutex;
     11CF_Mutex_Ctx globalMutex;
    1212
    1313#define LOG_MT      1
     
    4141int main (void)
    4242{
    43     int         i, j;
    44     char        idname[16] = {0x00,};
    45     CF_Thread   tid[10];
     43    int             i, j;
     44    char            idname[16] = {0x00,};
     45    CF_Thread_Ctx   tid[10];
    4646
    4747    /* initialize */
     
    7979        CF_DEBUG_PRINT (stderr, "set multi-threading mode error\n");
    8080
    81     if (CF_Mutex_Create (&globalMutex) < 0) {
     81    if (CF_Mutex_CreateCtx (&globalMutex) < 0) {
    8282        // error
    8383    }
     
    8585    for (i = 0 ; i < 10 ; i++)
    8686    {
    87         if (CF_Thread_Create (&tid[i], test_log_mt, &i) < 0)
     87        if (CF_Thread_CreateCtx (&tid[i], test_log_mt, &i) < 0)
    8888        {
    8989            CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", i);
     
    9696        if (CF_Thread_Join (&tid[i]) < 0)
    9797            CF_DEBUG_PRINT (stderr, "failed to join %dth thread\n", i);
    98         if (CF_Thread_Release (&tid[i]) < 0)
     98        if (CF_Thread_DestroyCtx (&tid[i]) < 0)
    9999            CF_DEBUG_PRINT (stderr, "failed to release %dth thread\n", i);
    100100    }
    101101
    102     if (CF_Mutex_Destory (&globalMutex) < 0) {
     102    if (CF_Mutex_DestoryCtx (&globalMutex) < 0) {
    103103        // error
    104104    }
  • trunk/test/socket.c

    r108 r109  
    3939        CF_DEBUG_PRINT (stderr, "[SERVER] recv {%s}\n", buf);
    4040
    41         if (CF_Socket_Send (clntsock, buf, recvd) < 0)
     41        if (CF_Socket_Send (clntsock, buf, (size_t)recvd) < 0)
    4242        {
    4343            return -3;
     
    100100int main ()
    101101{
    102     CF_Thread stid[THREAD_POOL];
    103     CF_Thread ctid[THREAD_POOL];
     102    CF_Thread_Ctx stid[THREAD_POOL];
     103    CF_Thread_Ctx ctid[THREAD_POOL];
    104104
    105105    int sock = 0;
     
    135135    for (iter = 0 ; iter < THREAD_POOL ; iter++)
    136136    {
    137         if (CF_Thread_Create (&stid[iter], socket_echo_server, &sock) < 0)
     137        if (CF_Thread_CreateCtx (&stid[iter], socket_echo_server, &sock) < 0)
    138138        {
    139139            CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", iter);
     
    145145    for (iter = 0 ; iter < THREAD_POOL ; iter++)
    146146    {
    147         if (CF_Thread_Create (&ctid[iter], socket_echo_client, &sock) < 0)
     147        if (CF_Thread_CreateCtx (&ctid[iter], socket_echo_client, &sock) < 0)
    148148        {
    149149            CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", iter);
     
    156156    {
    157157        CF_Thread_Join (&ctid[iter]);
    158         CF_Thread_Release (&ctid[iter]);
     158        CF_Thread_DestroyCtx (&ctid[iter]);
    159159
    160160        CF_Thread_Join (&stid[iter]);
    161         CF_Thread_Release (&stid[iter]);
     161        CF_Thread_DestroyCtx (&stid[iter]);
    162162
    163163        CF_Log_Write (LOG_SOCKET, "SOCKET", "join server thread-%d\n", iter);
  • trunk/test/thread.c

    r66 r109  
    77#include <stdio.h>
    88
    9 CF_Mutex globalMutex;
     9CF_Mutex_Ctx globalMutex;
    1010
    1111int worker (void * arg) {
     
    2424
    2525int main (void) {
    26     CF_Thread tid[10];
     26    CF_Thread_Ctx tid[10];
    2727    int i = 0;
    2828
    29     if (CF_Mutex_Create (&globalMutex) < 0) {
     29    if (CF_Mutex_CreateCtx (&globalMutex) < 0) {
    3030        // error
    3131    }
    3232
    3333    for (i = 0 ; i < 10 ; i++) {
    34         if (CF_Thread_Create (&tid[i], worker, NULL) < 0) {
     34        if (CF_Thread_CreateCtx (&tid[i], worker, NULL) < 0) {
    3535            // error
    3636        }
     
    4444
    4545    for (i = 0 ; i < 10 ; i++) {
    46         if (CF_Thread_Release (&tid[i]) < 0) {
     46        if (CF_Thread_DestroyCtx (&tid[i]) < 0) {
    4747            // error
    4848        }
    4949    }
    5050
    51     if (CF_Mutex_Destory (&globalMutex) < 0) {
     51    if (CF_Mutex_DestoryCtx (&globalMutex) < 0) {
    5252        // error
    5353    }
  • trunk/windows/libcf/libcf.vcproj

    r68 r109  
    188188            </File>
    189189            <File
     190                RelativePath="..\..\src\cf_list.c"
     191                >
     192            </File>
     193            <File
    190194                RelativePath="..\..\src\cf_local.h"
    191195                >
     
    196200            </File>
    197201            <File
     202                RelativePath="..\..\src\cf_queue.c"
     203                >
     204            </File>
     205            <File
    198206                RelativePath="..\..\src\cf_socket.c"
     207                >
     208            </File>
     209            <File
     210                RelativePath="..\..\src\cf_stack.c"
    199211                >
    200212            </File>
  • trunk/windows/test/test.vcproj

    r105 r109  
    186186            </File>
    187187            <File
     188                RelativePath="..\..\test\list.c"
     189                >
     190            </File>
     191            <File
    188192                RelativePath="..\..\test\log.c"
    189193                >
    190194            </File>
    191195            <File
     196                RelativePath="..\..\test\queue.c"
     197                >
     198            </File>
     199            <File
    192200                RelativePath="..\..\test\socket.c"
     201                >
     202            </File>
     203            <File
     204                RelativePath="..\..\test\stack.c"
    193205                >
    194206            </File>
Note: See TracChangeset for help on using the changeset viewer.