Ignore:
Timestamp:
Nov 7, 2005 3:47:28 PM (18 years ago)
Author:
bennylp
Message:

Added file I/O and file access API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjlib/src/pj/ioqueue_winnt.c

    r11 r18  
    3636 
    3737/* 
    38  * OVERLAP structure for send and receive. 
     38 * OVERLAPPPED structure for send and receive. 
    3939 */ 
    4040typedef struct ioqueue_overlapped 
     
    7676}; 
    7777 
     78/* Type of handle in the key. */ 
     79enum handle_type 
     80{ 
     81    HND_IS_UNKNOWN, 
     82    HND_IS_FILE, 
     83    HND_IS_SOCKET, 
     84}; 
     85 
    7886/* 
    7987 * Structure for individual socket. 
     
    8492    HANDLE              hnd; 
    8593    void               *user_data; 
     94    enum handle_type    hnd_type; 
    8695#if PJ_HAS_TCP 
    8796    int                 connecting; 
     
    318327    rec->ioqueue = ioqueue; 
    319328    rec->hnd = (HANDLE)sock; 
     329    rec->hnd_type = HND_IS_SOCKET; 
    320330    rec->user_data = user_data; 
    321331    pj_memcpy(&rec->cb, cb, sizeof(pj_ioqueue_callback)); 
     
    364374    } 
    365375#endif 
     376    if (key->hnd_type == HND_IS_FILE) { 
     377        CloseHandle(key->hnd); 
     378    } 
    366379    return PJ_SUCCESS; 
    367380} 
     
    506519 
    507520    PJ_CHECK_STACK(); 
    508     PJ_ASSERT_RETURN(key && op_key && buffer, PJ_EINVAL); 
     521    PJ_ASSERT_RETURN(key && op_key && buffer && length, PJ_EINVAL); 
    509522 
    510523    op_key_rec = (union operation_key*)op_key->internal__; 
Note: See TracChangeset for help on using the changeset viewer.