Changeset 788


Ignore:
Timestamp:
Oct 24, 2006 5:13:30 PM (18 years ago)
Author:
bennylp
Message:

Bulk of PJLIB implementations on Symbian: exception framework, errno, OS core, Unicode, pool backend, log (to console), socket, address resolution, select, etc. IOQueue still doesn't work.

Location:
pjproject/branches/symbian
Files:
8 added
35 edited
1 moved

Legend:

Unmodified
Added
Removed
  • pjproject/branches/symbian/pjlib/include/pj/compat/setjmp.h

    r65 r788  
    7979# endif   /* _ASM */ 
    8080 
     81#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 
     82    /* Symbian framework don't use setjmp/longjmp */ 
    8183#else 
    8284#  warning "setjmp()/longjmp() is not implemented" 
  • pjproject/branches/symbian/pjlib/include/pj/errno.h

    r289 r788  
    190190 
    191191/** 
     192 * Use this macro to generate error message text for your error code, 
     193 * so that they look uniformly as the rest of the libraries. 
     194 * 
     195 * @param code  The error code 
     196 * @param msg   The error test. 
     197 */ 
     198#ifndef PJ_BUILD_ERR 
     199#   define PJ_BUILD_ERR(code,msg) { code, msg " (" #code ")" } 
     200#endif 
     201 
     202 
     203/** 
    192204 * @hideinitializer 
    193205 * Unknown error has been reported. 
     
    285297 */ 
    286298#define PJ_ERRNO_SPACE_SIZE     50000 
     299 
     300/** 
     301 * See errno.c. 
     302 */ 
     303#define PJ_ERRNO_SPACE_GAP      10000 
    287304 
    288305/** 
  • pjproject/branches/symbian/pjlib/include/pj/except.h

    r68 r788  
    238238#define PJ_GET_EXCEPTION()  GetExceptionCode() 
    239239 
     240 
     241#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 
     242 
     243/***************************************************************************** 
     244 ** 
     245 ** IMPLEMENTATION OF EXCEPTION USING SYMBIAN LEAVE/TRAP FRAMEWORK 
     246 ** 
     247 ****************************************************************************/ 
     248 
     249class TPjException 
     250{ 
     251public: 
     252    int code_; 
     253}; 
     254 
     255#define PJ_USE_EXCEPTION 
     256#define PJ_TRY                  try 
     257//#define PJ_CATCH(id)           
     258#define PJ_CATCH_ANY            catch (const TPjException & pj_excp_) 
     259#define PJ_END 
     260#define PJ_THROW(x_id)          do { TPjException e; e.code_=x_id; throw e;} while (0) 
     261#define PJ_GET_EXCEPTION()      pj_excp_.code_ 
     262 
    240263#else 
     264 
    241265/***************************************************************************** 
    242266 ** 
  • pjproject/branches/symbian/pjlib/src/pj/compat/string_compat.c

    r692 r788  
    5252{ 
    5353    int ret; 
    54      
    5554    va_list arg; 
     55 
     56    PJ_UNUSED_ARG(len); 
     57 
    5658    va_start(arg, s2); 
    5759    ret = vsprintf(s1, s2, arg); 
     
    6365PJ_DEF(int) vsnprintf(char *s1, pj_size_t len, const char *s2, va_list arg) 
    6466{ 
     67    PJ_UNUSED_ARG(len); 
    6568    return vsprintf(s1,s2,arg); 
    6669} 
  • pjproject/branches/symbian/pjlib/src/pj/errno.c

    r330 r788  
    141141    pj_assert(buf && bufsize); 
    142142 
    143     if (statcode < PJ_ERRNO_START + PJ_ERRNO_SPACE_SIZE) { 
     143    if (statcode < PJ_ERRNO_START + PJ_ERRNO_SPACE_SIZE - PJ_ERRNO_SPACE_GAP) { 
    144144        len = pj_ansi_snprintf( buf, bufsize, "Unknown error %d", statcode); 
    145145 
    146     } else if (statcode < PJ_ERRNO_START_STATUS + PJ_ERRNO_SPACE_SIZE) { 
     146    } else if (statcode < PJ_ERRNO_START_STATUS + PJ_ERRNO_SPACE_SIZE - PJ_ERRNO_SPACE_GAP) { 
    147147        len = pjlib_error(statcode, buf, bufsize); 
    148148 
    149     } else if (statcode < PJ_ERRNO_START_SYS + PJ_ERRNO_SPACE_SIZE) { 
     149    } else if (statcode < PJ_ERRNO_START_SYS + PJ_ERRNO_SPACE_SIZE - PJ_ERRNO_SPACE_GAP) { 
    150150        len = platform_strerror(PJ_STATUS_TO_OS(statcode), buf, bufsize); 
    151151 
  • pjproject/branches/symbian/pjlib/src/pj/ioqueue_symbian.cpp

    r686 r788  
    1818 */ 
    1919#include <pj/ioqueue.h> 
     20#include <pj/assert.h> 
     21#include <pj/errno.h> 
     22#include <pj/list.h> 
     23#include <pj/lock.h> 
     24#include <pj/pool.h> 
     25#include <pj/string.h> 
     26 
     27#include "os_symbian.h" 
     28 
     29class CIoqueueCallback; 
     30 
     31/* 
     32 * IO Queue structure. 
     33 */ 
     34struct pj_ioqueue_t 
     35{ 
     36    int              eventCount; 
     37    CPjTimeoutTimer *timeoutTimer; 
     38}; 
     39 
     40 
     41///////////////////////////////////////////////////////////////////////////// 
     42// Class to encapsulate asynchronous socket operation. 
     43// 
     44class CIoqueueCallback : public CActive 
     45{ 
     46public: 
     47    CIoqueueCallback(pj_ioqueue_t *ioqueue, 
     48                     pj_ioqueue_key_t *key, pj_sock_t sock,  
     49                     const pj_ioqueue_callback *cb, void *user_data) 
     50    : CActive(CActive::EPriorityStandard), 
     51          ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), cb_(cb),  
     52          user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE) 
     53    { 
     54        CActiveScheduler::Add(this); 
     55    } 
     56 
     57    // 
     58    // Start asynchronous recv() operation 
     59    // 
     60    pj_status_t StartRead(pj_ioqueue_op_key_t *op_key,  
     61                          void *buf, pj_ssize_t *size, unsigned flags, 
     62                          pj_sockaddr_t *addr, int *addrlen) 
     63    { 
     64        PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); 
     65        PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); 
     66 
     67        pending_data_.read_.op_key_ = op_key; 
     68        pending_data_.read_.addr_ = addr; 
     69        pending_data_.read_.addrlen_ = addrlen; 
     70 
     71        aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size); 
     72 
     73        type_ = TYPE_READ; 
     74        SetActive(); 
     75        sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus); 
     76 
     77        return PJ_EPENDING; 
     78    } 
     79 
     80 
     81    // 
     82    // Start asynchronous accept() operation. 
     83    // 
     84    pj_status_t StartAccept(pj_ioqueue_op_key_t *op_key, 
     85                            pj_sock_t *new_sock, 
     86                            pj_sockaddr_t *local, 
     87                            pj_sockaddr_t *remote, 
     88                            int *addrlen ) 
     89    { 
     90        PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); 
     91        PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); 
     92 
     93        pending_data_.accept_.op_key_ = op_key; 
     94        pending_data_.accept_.new_sock_ = new_sock; 
     95        pending_data_.accept_.local_ = local; 
     96        pending_data_.accept_.remote_ = remote; 
     97        pending_data_.accept_.addrlen_ = addrlen; 
     98 
     99        // Create blank socket 
     100        blank_sock_.Open(PjSymbianOS::Instance()->SocketServ()); 
     101 
     102        type_ = TYPE_ACCEPT; 
     103        SetActive(); 
     104        sock_->Socket().Accept(blank_sock_, iStatus); 
     105 
     106        return PJ_EPENDING; 
     107    } 
     108 
     109 
     110    // 
     111    // Completion callback. 
     112    // 
     113    void RunL() 
     114    { 
     115        Type cur_type = type_; 
     116 
     117        type_ = TYPE_NONE; 
     118 
     119        if (cur_type == TYPE_READ) { 
     120            // 
     121            // Completion of asynchronous RecvFrom() 
     122            // 
     123 
     124            /* Clear op_key (save it to temp variable first!) */ 
     125            pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; 
     126            pending_data_.read_.op_key_ = NULL; 
     127 
     128            // Handle failure condition 
     129            if (iStatus != KErrNone) { 
     130                cb_->on_read_complete(key_, op_key, -PJ_RETURN_OS_ERROR(iStatus.Int())); 
     131                return; 
     132            } 
     133 
     134            if (pending_data_.read_.addr_) { 
     135                PjSymbianOS::Addr2pj(aAddress_,  
     136                                     *(pj_sockaddr_in*)pending_data_.read_.addr_); 
     137                pending_data_.read_.addr_ = NULL; 
     138            } 
     139            if (pending_data_.read_.addrlen_) { 
     140                *pending_data_.read_.addrlen_ = sizeof(pj_sockaddr_in); 
     141                pending_data_.read_.addrlen_ = NULL; 
     142            } 
     143 
     144            /* Call callback */ 
     145            cb_->on_read_complete(key_, op_key, aBufferPtr_.Length()); 
     146 
     147        } else if (cur_type == TYPE_ACCEPT) { 
     148            // 
     149            // Completion of asynchronous Accept() 
     150            // 
     151             
     152            /* Clear op_key (save it to temp variable first!) */ 
     153            pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; 
     154            pending_data_.read_.op_key_ = NULL; 
     155 
     156            // Handle failure condition 
     157            if (iStatus != KErrNone) { 
     158                if (pending_data_.accept_.new_sock_) 
     159                    *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; 
     160 
     161                cb_->on_accept_complete(key_, op_key, PJ_INVALID_SOCKET, 
     162                                        -PJ_RETURN_OS_ERROR(iStatus.Int())); 
     163                return; 
     164            } 
     165 
     166            CPjSocket *pjNewSock = new CPjSocket(blank_sock_); 
     167 
     168            if (pending_data_.accept_.new_sock_) { 
     169                *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock; 
     170                pending_data_.accept_.new_sock_ = NULL; 
     171            } 
     172 
     173            if (pending_data_.accept_.local_) { 
     174                TInetAddr aAddr; 
     175                blank_sock_.LocalName(aAddr); 
     176                PjSymbianOS::Addr2pj(aAddr, *(pj_sockaddr_in*)pending_data_.accept_.local_); 
     177                pending_data_.accept_.local_ = NULL; 
     178            } 
     179 
     180            if (pending_data_.accept_.remote_) { 
     181                TInetAddr aAddr; 
     182                blank_sock_.RemoteName(aAddr); 
     183                PjSymbianOS::Addr2pj(aAddr, *(pj_sockaddr_in*)pending_data_.accept_.remote_); 
     184                pending_data_.accept_.remote_ = NULL; 
     185            } 
     186 
     187            if (pending_data_.accept_.addrlen_) { 
     188                *pending_data_.accept_.addrlen_ = sizeof(pj_sockaddr_in); 
     189                pending_data_.accept_.addrlen_ = NULL; 
     190            } 
     191 
     192            // Call callback. 
     193            cb_->on_accept_complete(key_, op_key, (pj_sock_t)pjNewSock, PJ_SUCCESS); 
     194        } 
     195 
     196        ioqueue_->eventCount++; 
     197    } 
     198 
     199    // 
     200    // CActive's DoCancel() 
     201    // 
     202    void DoCancel() 
     203    { 
     204        if (type_ == TYPE_READ) 
     205            sock_->Socket().CancelRecv(); 
     206        else if (type_ == TYPE_ACCEPT) 
     207            sock_->Socket().CancelAccept(); 
     208 
     209        type_ = TYPE_NONE; 
     210    } 
     211 
     212    // 
     213    // Cancel operation and call callback. 
     214    // 
     215    void CancelOperation(pj_ioqueue_op_key_t *op_key, pj_ssize_t bytes_status) 
     216    { 
     217        Type cur_type = type_; 
     218 
     219        Cancel(); 
     220 
     221        if (cur_type == TYPE_READ) 
     222            cb_->on_read_complete(key_, op_key, bytes_status); 
     223        else if (cur_type == TYPE_ACCEPT) 
     224            ; 
     225    } 
     226 
     227    // 
     228    // Accessors 
     229    // 
     230    void* get_user_data() const 
     231    { 
     232        return user_data_; 
     233    } 
     234    void set_user_data(void *user_data) 
     235    { 
     236        user_data_ = user_data; 
     237    } 
     238    pj_ioqueue_op_key_t *get_op_key() const 
     239    { 
     240        return pending_data_.common_.op_key_; 
     241    } 
     242    CPjSocket* get_pj_socket() 
     243    { 
     244        return sock_; 
     245    } 
     246 
     247private: 
     248    // Type of pending operation. 
     249    enum Type { 
     250        TYPE_NONE, 
     251        TYPE_READ, 
     252        TYPE_ACCEPT, 
     253    }; 
     254 
     255    // Static data. 
     256    pj_ioqueue_t                *ioqueue_; 
     257    pj_ioqueue_key_t            *key_; 
     258    CPjSocket                   *sock_; 
     259    const pj_ioqueue_callback   *cb_; 
     260    void                        *user_data_; 
     261 
     262    // Symbian data. 
     263    TPtr8                        aBufferPtr_; 
     264    TInetAddr                    aAddress_; 
     265 
     266    // Application data. 
     267    Type                         type_; 
     268 
     269    union Pending_Data 
     270    { 
     271        struct Common 
     272        { 
     273            pj_ioqueue_op_key_t *op_key_; 
     274        } common_; 
     275 
     276        struct Pending_Read 
     277        { 
     278            pj_ioqueue_op_key_t *op_key_; 
     279            pj_sockaddr_t       *addr_; 
     280            int                 *addrlen_; 
     281        } read_; 
     282 
     283        struct Pending_Accept 
     284        { 
     285            pj_ioqueue_op_key_t *op_key_; 
     286            pj_sock_t           *new_sock_; 
     287            pj_sockaddr_t       *local_; 
     288            pj_sockaddr_t       *remote_; 
     289            int                 *addrlen_; 
     290        } accept_; 
     291    }; 
     292 
     293    union Pending_Data           pending_data_; 
     294    RSocket                     blank_sock_; 
     295}; 
     296 
     297 
     298 
     299 
     300/* 
     301 * IO Queue key structure. 
     302 */ 
     303struct pj_ioqueue_key_t 
     304{ 
     305    CIoqueueCallback    *cbObj; 
     306}; 
    20307 
    21308 
     
    25312PJ_DEF(const char*) pj_ioqueue_name(void) 
    26313{ 
    27     return "symbian"; 
    28 } 
    29  
     314    return "ioqueue-symbian"; 
     315} 
     316 
     317 
     318/* 
     319 * Create a new I/O Queue framework. 
     320 */ 
     321PJ_DEF(pj_status_t) pj_ioqueue_create(  pj_pool_t *pool,  
     322                                        pj_size_t max_fd, 
     323                                        pj_ioqueue_t **p_ioqueue) 
     324{ 
     325    pj_ioqueue_t *ioq; 
     326 
     327    PJ_UNUSED_ARG(max_fd); 
     328 
     329    ioq = (pj_ioqueue_t*) pj_pool_zalloc(pool, sizeof(pj_ioqueue_t)); 
     330    ioq->timeoutTimer = CPjTimeoutTimer::NewL(); 
     331    *p_ioqueue = ioq; 
     332    return PJ_SUCCESS; 
     333} 
     334 
     335 
     336/* 
     337 * Destroy the I/O queue. 
     338 */ 
     339PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioq ) 
     340{ 
     341    delete ioq->timeoutTimer; 
     342    ioq->timeoutTimer = NULL; 
     343 
     344    return PJ_SUCCESS; 
     345} 
     346 
     347 
     348/* 
     349 * Set the lock object to be used by the I/O Queue.  
     350 */ 
     351PJ_DEF(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioq,  
     352                                         pj_lock_t *lock, 
     353                                         pj_bool_t auto_delete ) 
     354{ 
     355    /* Don't really need lock for now */ 
     356    PJ_UNUSED_ARG(ioq); 
     357     
     358    if (auto_delete) { 
     359        pj_lock_destroy(lock); 
     360    } 
     361 
     362    return PJ_SUCCESS; 
     363} 
     364 
     365 
     366/* 
     367 * Register a socket to the I/O queue framework.  
     368 */ 
     369PJ_DEF(pj_status_t) pj_ioqueue_register_sock( pj_pool_t *pool, 
     370                                              pj_ioqueue_t *ioq, 
     371                                              pj_sock_t sock, 
     372                                              void *user_data, 
     373                                              const pj_ioqueue_callback *cb, 
     374                                              pj_ioqueue_key_t **p_key ) 
     375{ 
     376    pj_ioqueue_key_t *key; 
     377 
     378    key = (pj_ioqueue_key_t*) pj_pool_alloc(pool, sizeof(pj_ioqueue_key_t)); 
     379    key->cbObj = new CIoqueueCallback(ioq, key, sock, cb, user_data); 
     380 
     381    *p_key = key; 
     382    return PJ_SUCCESS; 
     383} 
     384 
     385/* 
     386 * Unregister from the I/O Queue framework.  
     387 */ 
     388PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key ) 
     389{ 
     390    if (key == NULL || key->cbObj == NULL) 
     391        return PJ_SUCCESS; 
     392 
     393    // Close socket. 
     394    key->cbObj->get_pj_socket()->Socket().Close(); 
     395    delete key->cbObj->get_pj_socket(); 
     396 
     397    // Delete async object 
     398    delete key->cbObj; 
     399    key->cbObj = NULL; 
     400 
     401    return PJ_SUCCESS; 
     402} 
     403 
     404 
     405/* 
     406 * Get user data associated with an ioqueue key. 
     407 */ 
     408PJ_DEF(void*) pj_ioqueue_get_user_data( pj_ioqueue_key_t *key ) 
     409{ 
     410    return key->cbObj->get_user_data(); 
     411} 
     412 
     413 
     414/* 
     415 * Set or change the user data to be associated with the file descriptor or 
     416 * handle or socket descriptor. 
     417 */ 
     418PJ_DEF(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key, 
     419                                              void *user_data, 
     420                                              void **old_data) 
     421{ 
     422    if (old_data) 
     423        *old_data = key->cbObj->get_user_data(); 
     424    key->cbObj->set_user_data(user_data); 
     425 
     426    return PJ_SUCCESS; 
     427} 
     428 
     429 
     430/* 
     431 * Initialize operation key. 
     432 */ 
     433PJ_DEF(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key, 
     434                                     pj_size_t size ) 
     435{ 
     436    pj_memset(op_key, 0, size); 
     437} 
     438 
     439 
     440/* 
     441 * Check if operation is pending on the specified operation key. 
     442 */ 
     443PJ_DEF(pj_bool_t) pj_ioqueue_is_pending( pj_ioqueue_key_t *key, 
     444                                         pj_ioqueue_op_key_t *op_key ) 
     445{ 
     446    return key->cbObj->get_op_key()==op_key && 
     447           key->cbObj->IsActive(); 
     448} 
     449 
     450 
     451/* 
     452 * Post completion status to the specified operation key and call the 
     453 * appropriate callback.  
     454 */ 
     455PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key, 
     456                                                pj_ioqueue_op_key_t *op_key, 
     457                                                pj_ssize_t bytes_status ) 
     458{ 
     459    if (pj_ioqueue_is_pending(key, op_key)) { 
     460        key->cbObj->CancelOperation(op_key, bytes_status); 
     461    } 
     462    return PJ_SUCCESS; 
     463} 
     464 
     465 
     466#if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0 
     467/** 
     468 * Instruct I/O Queue to accept incoming connection on the specified  
     469 * listening socket. 
     470 */ 
     471PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, 
     472                                       pj_ioqueue_op_key_t *op_key, 
     473                                       pj_sock_t *new_sock, 
     474                                       pj_sockaddr_t *local, 
     475                                       pj_sockaddr_t *remote, 
     476                                       int *addrlen ) 
     477{ 
     478     
     479    return key->cbObj->StartAccept(op_key, new_sock, local, remote, addrlen); 
     480} 
     481 
     482 
     483/* 
     484 * Initiate non-blocking socket connect. 
     485 */ 
     486PJ_DEF(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key, 
     487                                        const pj_sockaddr_t *addr, 
     488                                        int addrlen ) 
     489{ 
     490    PJ_ASSERT_RETURN(addrlen == sizeof(pj_sockaddr_in), PJ_EINVAL); 
     491 
     492    RSocket &rSock = key->cbObj->get_pj_socket()->Socket(); 
     493    TInetAddr inetAddr; 
     494    PjSymbianOS::pj2Addr(*(const pj_sockaddr_in*)addr, inetAddr); 
     495    TRequestStatus reqStatus; 
     496 
     497    // We don't support async connect for now. 
     498    PJ_TODO(IOQUEUE_SUPPORT_ASYNC_CONNECT); 
     499 
     500    rSock.Connect(inetAddr, reqStatus); 
     501    User::WaitForRequest(reqStatus); 
     502 
     503    if (reqStatus == KErrNone) 
     504        return PJ_SUCCESS; 
     505 
     506    return PJ_RETURN_OS_ERROR(reqStatus.Int()); 
     507} 
     508 
     509 
     510#endif  /* PJ_HAS_TCP */ 
     511 
     512/* 
     513 * Poll the I/O Queue for completed events. 
     514 */ 
     515PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioq, 
     516                             const pj_time_val *timeout) 
     517{ 
     518    CPjTimeoutTimer *timer; 
     519 
     520    if (timeout) { 
     521        if (!ioq->timeoutTimer->IsActive()) 
     522            timer = ioq->timeoutTimer; 
     523        else 
     524            timer = CPjTimeoutTimer::NewL(); 
     525 
     526        timer->StartTimer(timeout->sec*1000 + timeout->msec); 
     527 
     528    } else { 
     529        timer = NULL; 
     530    } 
     531 
     532    ioq->eventCount = 0; 
     533 
     534    do { 
     535        PjSymbianOS::Instance()->WaitForActiveObjects(); 
     536    } while (ioq->eventCount == 0 && !timer->HasTimedOut()); 
     537 
     538    if (!timer->HasTimedOut()) 
     539        timer->Cancel(); 
     540 
     541    if (timer != ioq->timeoutTimer) 
     542        delete timer; 
     543 
     544    return ioq->eventCount; 
     545} 
     546 
     547 
     548/* 
     549 * Instruct the I/O Queue to read from the specified handle. 
     550 */ 
     551PJ_DEF(pj_status_t) pj_ioqueue_recv( pj_ioqueue_key_t *key, 
     552                                     pj_ioqueue_op_key_t *op_key, 
     553                                     void *buffer, 
     554                                     pj_ssize_t *length, 
     555                                     pj_uint32_t flags ) 
     556{ 
     557    return pj_ioqueue_recvfrom(key, op_key, buffer, length, flags, NULL, NULL); 
     558} 
     559 
     560 
     561/* 
     562 * This function behaves similarly as #pj_ioqueue_recv(), except that it is 
     563 * normally called for socket, and the remote address will also be returned 
     564 * along with the data. 
     565 */ 
     566PJ_DEF(pj_status_t) pj_ioqueue_recvfrom( pj_ioqueue_key_t *key, 
     567                                         pj_ioqueue_op_key_t *op_key, 
     568                                         void *buffer, 
     569                                         pj_ssize_t *length, 
     570                                         pj_uint32_t flags, 
     571                                         pj_sockaddr_t *addr, 
     572                                         int *addrlen) 
     573{ 
     574    if (key->cbObj->IsActive()) 
     575        return PJ_EBUSY; 
     576 
     577    return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen); 
     578} 
     579 
     580 
     581/* 
     582 * Instruct the I/O Queue to write to the handle. 
     583 */ 
     584PJ_DEF(pj_status_t) pj_ioqueue_send( pj_ioqueue_key_t *key, 
     585                                     pj_ioqueue_op_key_t *op_key, 
     586                                     const void *data, 
     587                                     pj_ssize_t *length, 
     588                                     pj_uint32_t flags ) 
     589{ 
     590    TRequestStatus reqStatus; 
     591    TPtrC8 aBuffer((const TUint8*)data, (TInt)*length); 
     592    TSockXfrLength aLen; 
     593     
     594    PJ_UNUSED_ARG(op_key); 
     595 
     596    // Forcing pending operation is not supported. 
     597    PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); 
     598 
     599    key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen); 
     600    User::WaitForRequest(reqStatus); 
     601 
     602    if (reqStatus.Int() != KErrNone) 
     603        return PJ_RETURN_OS_ERROR(reqStatus.Int()); 
     604 
     605    *length = aLen.Length(); 
     606    return PJ_SUCCESS; 
     607} 
     608 
     609 
     610/* 
     611 * Instruct the I/O Queue to write to the handle. 
     612 */ 
     613PJ_DEF(pj_status_t) pj_ioqueue_sendto( pj_ioqueue_key_t *key, 
     614                                       pj_ioqueue_op_key_t *op_key, 
     615                                       const void *data, 
     616                                       pj_ssize_t *length, 
     617                                       pj_uint32_t flags, 
     618                                       const pj_sockaddr_t *addr, 
     619                                       int addrlen) 
     620{ 
     621    TRequestStatus reqStatus; 
     622    TPtrC8 aBuffer; 
     623    TInetAddr inetAddr; 
     624    TSockXfrLength aLen; 
     625     
     626    PJ_UNUSED_ARG(op_key); 
     627 
     628    // Forcing pending operation is not supported. 
     629    PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); 
     630 
     631    // Must be pj_sockaddr_in for now. 
     632    PJ_ASSERT_RETURN(addrlen == sizeof(pj_sockaddr_in), PJ_EINVAL); 
     633 
     634    aBuffer.Set((const TUint8*)data, (TInt)*length); 
     635    PjSymbianOS::pj2Addr(*(const pj_sockaddr_in*)addr, inetAddr); 
     636    CPjSocket *pjSock = key->cbObj->get_pj_socket(); 
     637 
     638    pjSock->Socket().Send(aBuffer, flags, reqStatus, aLen); 
     639    User::WaitForRequest(reqStatus); 
     640 
     641    if (reqStatus.Int() != KErrNone) 
     642        return PJ_RETURN_OS_ERROR(reqStatus.Int()); 
     643 
     644    *length = aLen.Length(); 
     645    return PJ_SUCCESS; 
     646} 
     647 
  • pjproject/branches/symbian/pjlib/src/pj/log.c

    r315 r788  
    151151            log_buffer[len++] = '\n'; 
    152152        } 
    153         log_buffer[len++] = '\0'; 
     153        log_buffer[len] = '\0'; 
    154154    } else { 
    155155        len = sizeof(log_buffer)-1; 
  • pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp

    r692 r788  
    1818 */ 
    1919 
    20 #include <e32cmn.h> 
    21 #include <e32std.h> 
    22  
    2320#include <pj/os.h> 
    2421#include <pj/assert.h> 
     
    3128#include <pj/errno.h> 
    3229 
     30#include "os_symbian.h" 
     31 
    3332 
    3433#define PJ_MAX_TLS          32 
    3534#define DUMMY_MUTEX         ((pj_mutex_t*)101) 
    3635#define DUMMY_SEMAPHORE     ((pj_sem_t*)102) 
    37  
    38  
     36#define THIS_FILE           "os_core_symbian.c" 
     37  
    3938/* 
    4039 * Note: 
     
    6160 
    6261 
     62 
     63///////////////////////////////////////////////////////////////////////////// 
     64// 
     65// CPjTimeoutTimer implementation 
     66// 
     67 
     68CPjTimeoutTimer::CPjTimeoutTimer() 
     69: CActive(EPriorityNormal), hasTimedOut_(false) 
     70{ 
     71} 
     72 
     73CPjTimeoutTimer::~CPjTimeoutTimer() 
     74{ 
     75    if (IsActive()) 
     76        Cancel(); 
     77    timer_.Close(); 
     78} 
     79 
     80void CPjTimeoutTimer::ConstructL() 
     81{ 
     82    timer_.CreateLocal(); 
     83    CActiveScheduler::Add(this); 
     84} 
     85 
     86CPjTimeoutTimer *CPjTimeoutTimer::NewL() 
     87{ 
     88    CPjTimeoutTimer *self = new (ELeave) CPjTimeoutTimer; 
     89    CleanupStack::PushL(self); 
     90 
     91    self->ConstructL(); 
     92 
     93    CleanupStack::Pop(self); 
     94    return self; 
     95 
     96} 
     97 
     98void CPjTimeoutTimer::StartTimer(TUint miliSeconds) 
     99{ 
     100    if (IsActive()) 
     101        Cancel(); 
     102 
     103    hasTimedOut_ = false; 
     104    timer_.After(iStatus, miliSeconds * 1000); 
     105    SetActive(); 
     106} 
     107 
     108bool CPjTimeoutTimer::HasTimedOut() const 
     109{ 
     110    return hasTimedOut_; 
     111} 
     112 
     113void CPjTimeoutTimer::RunL() 
     114{ 
     115    hasTimedOut_ = true; 
     116} 
     117 
     118void CPjTimeoutTimer::DoCancel() 
     119{ 
     120    timer_.Cancel(); 
     121} 
     122 
     123TInt CPjTimeoutTimer::RunError(TInt aError) 
     124{ 
     125    PJ_UNUSED_ARG(aError); 
     126    return KErrNone; 
     127} 
     128 
     129 
     130 
     131///////////////////////////////////////////////////////////////////////////// 
     132// 
     133// PjSymbianOS implementation 
     134// 
     135 
     136PjSymbianOS::PjSymbianOS() 
     137: isSocketServInitialized_(false), isResolverInitialized_(false), 
     138  console_(NULL), selectTimeoutTimer_(NULL) 
     139{ 
     140} 
     141 
     142// Get PjSymbianOS instance 
     143PjSymbianOS *PjSymbianOS::Instance() 
     144{ 
     145    static PjSymbianOS instance_; 
     146    return &instance_; 
     147} 
     148 
     149 
     150// Initialize 
     151TInt PjSymbianOS::Initialize() 
     152{ 
     153    TInt err; 
     154 
     155    selectTimeoutTimer_ = CPjTimeoutTimer::NewL(); 
     156 
     157#if 0 
     158    pj_assert(console_ == NULL); 
     159    TRAPD(err, console_ = Console::NewL(_L("PJLIB"),  
     160                                        TSize(KConsFullScreen,KConsFullScreen))); 
     161    return err; 
     162#endif 
     163 
     164    if (!isSocketServInitialized_) { 
     165        err = socketServ_.Connect(); 
     166        if (err != KErrNone) 
     167            goto on_error; 
     168 
     169        isSocketServInitialized_ = true; 
     170    } 
     171 
     172    if (!isResolverInitialized_) { 
     173        err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream); 
     174        if (err != KErrNone) 
     175            goto on_error; 
     176 
     177        isResolverInitialized_ = true; 
     178    } 
     179 
     180    return KErrNone; 
     181 
     182on_error: 
     183    Shutdown(); 
     184    return err; 
     185} 
     186 
     187// Shutdown 
     188void PjSymbianOS::Shutdown() 
     189{ 
     190    if (isResolverInitialized_) { 
     191        hostResolver_.Close(); 
     192        isResolverInitialized_ = false; 
     193    } 
     194 
     195    if (isSocketServInitialized_) { 
     196        socketServ_.Close(); 
     197        isSocketServInitialized_ = false; 
     198    } 
     199 
     200    if (console_) { 
     201        delete console_; 
     202        console_ = NULL; 
     203    } 
     204 
     205    if (selectTimeoutTimer_) { 
     206        delete selectTimeoutTimer_; 
     207        selectTimeoutTimer_ = NULL; 
     208    } 
     209} 
     210 
     211// Convert to Unicode 
     212TInt PjSymbianOS::ConvertToUnicode(TDes16 &aUnicode, const TDesC8 &aForeign) 
     213{ 
     214#if 0 
     215    pj_assert(conv_ != NULL); 
     216    return conv_->ConvertToUnicode(aUnicode, aForeign, convToUnicodeState_); 
     217#else 
     218    return CnvUtfConverter::ConvertToUnicodeFromUtf8(aUnicode, aForeign); 
     219#endif 
     220} 
     221 
     222// Convert from Unicode 
     223TInt PjSymbianOS::ConvertFromUnicode(TDes8 &aForeign, const TDesC16 &aUnicode) 
     224{ 
     225#if 0 
     226    pj_assert(conv_ != NULL); 
     227    return conv_->ConvertFromUnicode(aForeign, aUnicode, convToAnsiState_); 
     228#else 
     229    return CnvUtfConverter::ConvertFromUnicodeToUtf8(aForeign, aUnicode); 
     230#endif 
     231} 
     232 
     233 
     234///////////////////////////////////////////////////////////////////////////// 
     235// 
     236// PJLIB os.h implementation 
     237// 
     238 
    63239PJ_DEF(pj_uint32_t) pj_getpid(void) 
    64240{ 
     
    66242} 
    67243 
     244 
     245PJ_DECL(void) pj_shutdown(void); 
    68246 
    69247/* 
     
    74252{ 
    75253    pj_ansi_strcpy(main_thread.obj_name, "pjthread"); 
    76     return PJ_SUCCESS; 
     254 
     255    // Initialize PjSymbianOS instance 
     256    PjSymbianOS *os = PjSymbianOS::Instance(); 
     257 
     258    PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS..")); 
     259 
     260    TInt err; 
     261    err = os->Initialize(); 
     262    if (err != KErrNone) 
     263        goto on_error; 
     264 
     265    PJ_LOG(5,(THIS_FILE, "PJLIB initialized.")); 
     266    return PJ_SUCCESS; 
     267 
     268on_error: 
     269    pj_shutdown(); 
     270    return PJ_RETURN_OS_ERROR(err); 
     271} 
     272 
     273 
     274PJ_DEF(void) pj_shutdown(void) 
     275{ 
     276    PjSymbianOS *os = PjSymbianOS::Instance(); 
     277    os->Shutdown(); 
     278} 
     279 
     280 
     281/* 
     282 * pj_thread_register(..) 
     283 */ 
     284PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, 
     285                                         pj_thread_desc desc, 
     286                                         pj_thread_t **thread_ptr) 
     287{ 
     288    PJ_UNUSED_ARG(cstr_thread_name); 
     289    PJ_UNUSED_ARG(desc); 
     290    PJ_UNUSED_ARG(thread_ptr); 
     291    return PJ_EINVALIDOP; 
    77292} 
    78293 
     
    150365PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec) 
    151366{ 
    152     PJ_UNUSED_ARG(msec); 
    153  
    154     /* Not supported either */ 
    155     return PJ_EINVALIDOP; 
     367    User::After(msec*1000); 
     368    return PJ_SUCCESS; 
    156369} 
    157370 
  • pjproject/branches/symbian/pjlib/src/pj/pool.c

    r433 r788  
    1919#include <pj/pool.h> 
    2020#include <pj/log.h> 
    21 #include <pj/except.h> 
    2221#include <pj/assert.h> 
    2322#include <pj/os.h> 
  • pjproject/branches/symbian/pjlib/src/pj/sock_bsd.c

    r496 r788  
    633633    PJ_ASSERT_RETURN(newsock != NULL, PJ_EINVAL); 
    634634 
     635    hello 
     636 
    635637#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 
    636638    if (addr) { 
  • pjproject/branches/symbian/pjlib/src/pj/sock_select_symbian.cpp

    r686 r788  
    1818 */ 
    1919#include <pj/sock_select.h> 
     20#include <pj/array.h> 
     21#include <pj/assert.h> 
     22#include <pj/os.h> 
     23#include "os_symbian.h" 
     24 
     25  
     26struct symbian_fd_set 
     27{ 
     28    unsigned     count; 
     29    CPjSocket   *sock[FD_SETSIZE]; 
     30}; 
    2031 
    2132 
    2233PJ_DEF(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp) 
    2334{ 
    24     PJ_TODO(PJ_FD_ZERO); 
     35    symbian_fd_set *fds = (symbian_fd_set *)fdsetp; 
     36    fds->count = 0; 
    2537} 
    2638 
     
    2840PJ_DEF(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp) 
    2941{ 
    30     PJ_TODO(PJ_FD_SET); 
     42    symbian_fd_set *fds = (symbian_fd_set *)fdsetp; 
     43 
     44    PJ_ASSERT_ON_FAIL(fds->count < FD_SETSIZE, return); 
     45    fds->sock[fds->count++] = (CPjSocket*)fd; 
    3146} 
    3247 
     
    3449PJ_DEF(void) PJ_FD_CLR(pj_sock_t fd, pj_fd_set_t *fdsetp) 
    3550{ 
    36     PJ_TODO(PJ_FD_CLR); 
     51    symbian_fd_set *fds = (symbian_fd_set *)fdsetp; 
     52    unsigned i; 
     53     
     54    for (i=0; i<fds->count; ++i) { 
     55        if (fds->sock[i] == (CPjSocket*)fd) { 
     56            pj_array_erase(fds->sock, sizeof(fds->sock[0]), fds->count, i); 
     57            --fds->count; 
     58            return; 
     59        } 
     60    } 
    3761} 
    3862 
     
    4064PJ_DEF(pj_bool_t) PJ_FD_ISSET(pj_sock_t fd, const pj_fd_set_t *fdsetp) 
    4165{ 
    42     PJ_TODO(PJ_FD_ISSET); 
    43     return 0; 
     66    symbian_fd_set *fds = (symbian_fd_set *)fdsetp; 
     67    unsigned i; 
     68     
     69    for (i=0; i<fds->count; ++i) { 
     70        if (fds->sock[i] == (CPjSocket*)fd) { 
     71            return PJ_TRUE; 
     72        } 
     73    } 
     74 
     75    return PJ_FALSE; 
    4476} 
    4577 
    4678PJ_DEF(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp) 
    4779{ 
    48     PJ_TODO(PJ_FD_COUNT); 
    49     return 0; 
     80    symbian_fd_set *fds = (symbian_fd_set *)fdsetp; 
     81    return fds->count; 
    5082} 
     83 
    5184 
    5285PJ_DEF(int) pj_sock_select( int n,  
     
    5689                            const pj_time_val *timeout) 
    5790{ 
    58     PJ_TODO(pj_sock_select); 
     91    CPjTimeoutTimer *pjTimer; 
     92    unsigned i; 
     93 
     94    PJ_UNUSED_ARG(n); 
     95    PJ_UNUSED_ARG(writefds); 
     96    PJ_UNUSED_ARG(exceptfds); 
     97 
     98    if (timeout) { 
     99        pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); 
     100        pjTimer->StartTimer(timeout->sec*1000 + timeout->msec); 
     101 
     102    } else { 
     103        pjTimer = NULL; 
     104    } 
     105 
     106    /* Scan for readable sockets */ 
     107 
     108    if (readfds) { 
     109        symbian_fd_set *fds = (symbian_fd_set *)readfds; 
     110 
     111        do { 
     112            /* Scan sockets for readily available data */ 
     113            for (i=0; i<fds->count; ++i) { 
     114                CPjSocket *pjsock = fds->sock[i]; 
     115 
     116                if (pjsock->Reader()) { 
     117                    if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { 
     118 
     119                        /* Found socket with data ready */ 
     120                        PJ_FD_ZERO(readfds); 
     121                        PJ_FD_SET((pj_sock_t)pjsock, readfds); 
     122 
     123                        /* Cancel timer, if any */ 
     124                        if (pjTimer) { 
     125                            pjTimer->Cancel(); 
     126                        } 
     127 
     128                        /* Clear writable and exception fd_set */ 
     129                        if (writefds) 
     130                            PJ_FD_ZERO(writefds); 
     131                        if (exceptfds) 
     132                            PJ_FD_ZERO(exceptfds); 
     133 
     134                        return 1; 
     135 
     136                    } else if (!pjsock->Reader()->IsActive()) 
     137                        pjsock->Reader()->StartRecvFrom(); 
     138 
     139                } else { 
     140                    pjsock->CreateReader(); 
     141                    pjsock->Reader()->StartRecvFrom(); 
     142                } 
     143            } 
     144 
     145            PjSymbianOS::Instance()->WaitForActiveObjects(); 
     146 
     147        } while (pjTimer==NULL || !pjTimer->HasTimedOut()); 
     148    } 
     149 
     150 
     151    /* Timeout */ 
     152 
     153    if (readfds) 
     154        PJ_FD_ZERO(readfds); 
     155    if (writefds) 
     156        PJ_FD_ZERO(writefds); 
     157    if (exceptfds) 
     158        PJ_FD_ZERO(exceptfds); 
     159 
    59160    return 0; 
    60161} 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/atomic.c

    r65 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/os.h> 
    2121 
    2222/** 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/echo_clt.c

    r65 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/os.h> 
     21#include <pj/sock.h> 
    2122 
    2223#if INCLUDE_ECHO_CLIENT 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/file.c

    r65 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/file_io.h> 
     21#include <pj/file_access.h> 
     22 
    2123 
    2224#if INCLUDE_FILE_TEST 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_perf.c

    r365 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/errno.h> 
     21#include <pj/ioqueue.h> 
     22#include <pj/log.h> 
     23#include <pj/os.h> 
     24#include <pj/pool.h> 
     25#include <pj/sock.h> 
    2126#include <pj/compat/high_precision.h> 
    2227 
     
    7378                             pj_ssize_t bytes_read) 
    7479{ 
    75     test_item *item = pj_ioqueue_get_user_data(key); 
     80    test_item *item = (test_item*)pj_ioqueue_get_user_data(key); 
    7681    pj_status_t rc; 
    7782    int data_is_available = 1; 
     
    151156                              pj_ssize_t bytes_sent) 
    152157{ 
    153     test_item *item = pj_ioqueue_get_user_data(key); 
     158    test_item *item = (test_item*)pj_ioqueue_get_user_data(key); 
    154159     
    155160    //TRACE_((THIS_FILE, "     write complete: sent = %d", bytes_sent)); 
     
    189194static int worker_thread(void *p) 
    190195{ 
    191     struct thread_arg *arg = p; 
     196    struct thread_arg *arg = (struct thread_arg *)p; 
    192197    const pj_time_val timeout = {0, 100}; 
    193198    int rc; 
     
    250255        return -10; 
    251256 
    252     items = pj_pool_alloc(pool, sockpair_cnt*sizeof(test_item)); 
    253     thread = pj_pool_alloc(pool, thread_cnt*sizeof(pj_thread_t*)); 
     257    items = (test_item *)pj_pool_alloc(pool, sockpair_cnt*sizeof(test_item)); 
     258    thread = (pj_thread_t **)pj_pool_alloc(pool, thread_cnt*sizeof(pj_thread_t*)); 
    254259 
    255260    TRACE_((THIS_FILE, "     creating ioqueue..")); 
     
    266271        items[i].ioqueue = ioqueue; 
    267272        items[i].buffer_size = buffer_size; 
    268         items[i].outgoing_buffer = pj_pool_alloc(pool, buffer_size); 
    269         items[i].incoming_buffer = pj_pool_alloc(pool, buffer_size); 
     273        items[i].outgoing_buffer = (char*)pj_pool_alloc(pool, buffer_size); 
     274        items[i].incoming_buffer = (char*)pj_pool_alloc(pool, buffer_size); 
    270275        items[i].bytes_recv = items[i].bytes_sent = 0; 
    271276 
     
    332337        struct thread_arg *arg; 
    333338 
    334         arg = pj_pool_zalloc(pool, sizeof(*arg)); 
     339        arg = (struct thread_arg *)pj_pool_zalloc(pool, sizeof(*arg)); 
    335340        arg->id = i; 
    336341        arg->ioqueue = ioqueue; 
     
    444449    enum { BUF_SIZE = 512 }; 
    445450    int i, rc; 
     451    enum 
     452    { 
     453        SOCK_DGRAM = 1, 
     454        SOCK_STREAM = 2, 
     455    }; 
    446456    struct { 
    447457        int         type; 
     
    451461    } test_param[] =  
    452462    { 
    453         { PJ_SOCK_DGRAM, "udp", 1, 1}, 
    454         { PJ_SOCK_DGRAM, "udp", 1, 2}, 
    455         { PJ_SOCK_DGRAM, "udp", 1, 4}, 
    456         { PJ_SOCK_DGRAM, "udp", 1, 8}, 
    457         { PJ_SOCK_DGRAM, "udp", 2, 1}, 
    458         { PJ_SOCK_DGRAM, "udp", 2, 2}, 
    459         { PJ_SOCK_DGRAM, "udp", 2, 4}, 
    460         { PJ_SOCK_DGRAM, "udp", 2, 8}, 
    461         { PJ_SOCK_DGRAM, "udp", 4, 1}, 
    462         { PJ_SOCK_DGRAM, "udp", 4, 2}, 
    463         { PJ_SOCK_DGRAM, "udp", 4, 4}, 
    464         { PJ_SOCK_DGRAM, "udp", 4, 8}, 
    465         { PJ_SOCK_DGRAM, "udp", 4, 16}, 
    466         { PJ_SOCK_STREAM, "tcp", 1, 1}, 
    467         { PJ_SOCK_STREAM, "tcp", 1, 2}, 
    468         { PJ_SOCK_STREAM, "tcp", 1, 4}, 
    469         { PJ_SOCK_STREAM, "tcp", 1, 8}, 
    470         { PJ_SOCK_STREAM, "tcp", 2, 1}, 
    471         { PJ_SOCK_STREAM, "tcp", 2, 2}, 
    472         { PJ_SOCK_STREAM, "tcp", 2, 4}, 
    473         { PJ_SOCK_STREAM, "tcp", 2, 8}, 
    474         { PJ_SOCK_STREAM, "tcp", 4, 1}, 
    475         { PJ_SOCK_STREAM, "tcp", 4, 2}, 
    476         { PJ_SOCK_STREAM, "tcp", 4, 4}, 
    477         { PJ_SOCK_STREAM, "tcp", 4, 8}, 
    478         { PJ_SOCK_STREAM, "tcp", 4, 16}, 
     463        { SOCK_DGRAM, "udp", 1, 1}, 
     464        { SOCK_DGRAM, "udp", 1, 2}, 
     465        { SOCK_DGRAM, "udp", 1, 4}, 
     466        { SOCK_DGRAM, "udp", 1, 8}, 
     467        { SOCK_DGRAM, "udp", 2, 1}, 
     468        { SOCK_DGRAM, "udp", 2, 2}, 
     469        { SOCK_DGRAM, "udp", 2, 4}, 
     470        { SOCK_DGRAM, "udp", 2, 8}, 
     471        { SOCK_DGRAM, "udp", 4, 1}, 
     472        { SOCK_DGRAM, "udp", 4, 2}, 
     473        { SOCK_DGRAM, "udp", 4, 4}, 
     474        { SOCK_DGRAM, "udp", 4, 8}, 
     475        { SOCK_DGRAM, "udp", 4, 16}, 
     476        { SOCK_STREAM, "tcp", 1, 1}, 
     477        { SOCK_STREAM, "tcp", 1, 2}, 
     478        { SOCK_STREAM, "tcp", 1, 4}, 
     479        { SOCK_STREAM, "tcp", 1, 8}, 
     480        { SOCK_STREAM, "tcp", 2, 1}, 
     481        { SOCK_STREAM, "tcp", 2, 2}, 
     482        { SOCK_STREAM, "tcp", 2, 4}, 
     483        { SOCK_STREAM, "tcp", 2, 8}, 
     484        { SOCK_STREAM, "tcp", 4, 1}, 
     485        { SOCK_STREAM, "tcp", 4, 2}, 
     486        { SOCK_STREAM, "tcp", 4, 4}, 
     487        { SOCK_STREAM, "tcp", 4, 8}, 
     488        { SOCK_STREAM, "tcp", 4, 16}, 
    479489/* 
    480         { PJ_SOCK_DGRAM, "udp", 32, 1}, 
    481         { PJ_SOCK_DGRAM, "udp", 32, 1}, 
    482         { PJ_SOCK_DGRAM, "udp", 32, 1}, 
    483         { PJ_SOCK_DGRAM, "udp", 32, 1}, 
    484         { PJ_SOCK_DGRAM, "udp", 1, 32}, 
    485         { PJ_SOCK_DGRAM, "udp", 1, 32}, 
    486         { PJ_SOCK_DGRAM, "udp", 1, 32}, 
    487         { PJ_SOCK_DGRAM, "udp", 1, 32}, 
    488         { PJ_SOCK_STREAM, "tcp", 32, 1}, 
    489         { PJ_SOCK_STREAM, "tcp", 32, 1}, 
    490         { PJ_SOCK_STREAM, "tcp", 32, 1}, 
    491         { PJ_SOCK_STREAM, "tcp", 32, 1}, 
    492         { PJ_SOCK_STREAM, "tcp", 1, 32}, 
    493         { PJ_SOCK_STREAM, "tcp", 1, 32}, 
    494         { PJ_SOCK_STREAM, "tcp", 1, 32}, 
    495         { PJ_SOCK_STREAM, "tcp", 1, 32}, 
     490        { SOCK_DGRAM, "udp", 32, 1}, 
     491        { SOCK_DGRAM, "udp", 32, 1}, 
     492        { SOCK_DGRAM, "udp", 32, 1}, 
     493        { SOCK_DGRAM, "udp", 32, 1}, 
     494        { SOCK_DGRAM, "udp", 1, 32}, 
     495        { SOCK_DGRAM, "udp", 1, 32}, 
     496        { SOCK_DGRAM, "udp", 1, 32}, 
     497        { SOCK_DGRAM, "udp", 1, 32}, 
     498        { SOCK_STREAM, "tcp", 32, 1}, 
     499        { SOCK_STREAM, "tcp", 32, 1}, 
     500        { SOCK_STREAM, "tcp", 32, 1}, 
     501        { SOCK_STREAM, "tcp", 32, 1}, 
     502        { SOCK_STREAM, "tcp", 1, 32}, 
     503        { SOCK_STREAM, "tcp", 1, 32}, 
     504        { SOCK_STREAM, "tcp", 1, 32}, 
     505        { SOCK_STREAM, "tcp", 1, 32}, 
    496506*/ 
    497507    }; 
     
    503513    PJ_LOG(3,(THIS_FILE, "   Type  Threads  Skt.Pairs      Bandwidth")); 
    504514    PJ_LOG(3,(THIS_FILE, "   =======================================")); 
     515 
     516    for (i=0; i<PJ_ARRAY_SIZE(test_param); ++i) { 
     517        if (test_param[i].type == SOCK_DGRAM) 
     518            test_param[i].type = PJ_SOCK_DGRAM; 
     519        else if (test_param[i].type == SOCK_STREAM) 
     520            test_param[i].type = PJ_SOCK_STREAM; 
     521    } 
    505522 
    506523    best_bandwidth = 0; 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_tcp.c

    r433 r788  
    3434#if INCLUDE_TCP_IOQUEUE_TEST 
    3535 
    36 #include <pjlib.h> 
     36#include <pj/assert.h> 
     37#include <pj/errno.h> 
     38#include <pj/ioqueue.h> 
     39#include <pj/log.h> 
     40#include <pj/pool.h> 
     41#include <pj/sock.h> 
     42#include <pj/string.h> 
     43 
    3744 
    3845#if PJ_HAS_TCP 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/ioq_udp.c

    r433 r788  
    3535#if INCLUDE_UDP_IOQUEUE_TEST 
    3636 
    37 #include <pjlib.h> 
     37#include <pj/assert.h> 
     38#include <pj/errno.h> 
     39#include <pj/ioqueue.h> 
     40#include <pj/log.h> 
     41#include <pj/os.h> 
     42#include <pj/pool.h> 
     43#include <pj/sock.h> 
     44#include <pj/string.h> 
     45 
    3846 
    3947#include <pj/compat/socket.h> 
     
    329337                             pj_ssize_t bytes_read) 
    330338{ 
    331     unsigned *p_packet_cnt = pj_ioqueue_get_user_data(key); 
     339    unsigned *p_packet_cnt = (unsigned *)pj_ioqueue_get_user_data(key); 
    332340 
    333341    PJ_UNUSED_ARG(op_key); 
     
    511519        return PJ_ENOMEM; 
    512520 
    513     key = pj_pool_alloc(pool, MAX*sizeof(pj_ioqueue_key_t*)); 
    514     sock = pj_pool_alloc(pool, MAX*sizeof(pj_sock_t)); 
     521    key = (pj_ioqueue_key_t **)pj_pool_alloc(pool, MAX*sizeof(pj_ioqueue_key_t*)); 
     522    sock = (pj_sock_t *)pj_pool_alloc(pool, MAX*sizeof(pj_sock_t)); 
    515523     
    516524    /* Create IOQueue */ 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp

    r692 r788  
    77 
    88#include "test.h" 
     9#include <stdlib.h> 
     10#include <pj/errno.h> 
     11#include <pj/os.h> 
     12#include <pj/log.h> 
     13#include <pj/unicode.h> 
     14#include <stdio.h> 
     15 
     16#include <e32std.h> 
     17 
     18#if 0 
     19int main() 
     20{ 
     21    int err = 0; 
     22    int exp = 0; 
     23 
     24    err = test_main(); 
     25    //err = test_main(); 
     26 
     27    if (err) 
     28        return err; 
     29    return exp; 
     30    //return 0; 
     31} 
     32 
     33#else 
    934#include <pj/os.h> 
    1035 
     
    1338#include <e32cons.h>            // Console 
    1439 
    15  
    16 //  Constants 
    17  
    18 _LIT(KTextConsoleTitle, "Console"); 
    19 _LIT(KTextFailed, " failed, leave code = %d"); 
    20 _LIT(KTextPressAnyKey, " [press any key]\n"); 
    2140 
    2241 
     
    2948 
    3049LOCAL_C void MainL() 
    31     { 
     50{ 
    3251    // 
    3352    // add your program code here, example code below 
    3453    // 
    3554    test_main(); 
    36     } 
     55    CActiveScheduler::Stop(); 
     56} 
     57 
     58class MyScheduler : public CActiveScheduler 
     59{ 
     60public: 
     61    MyScheduler() 
     62    {} 
     63 
     64    void Error(TInt aError) const; 
     65}; 
     66 
     67void MyScheduler::Error(TInt aError) const 
     68{ 
     69    int i = 0; 
     70} 
     71 
     72class ProgramStarter : public CActive 
     73{ 
     74public: 
     75    static ProgramStarter *NewL(); 
     76    void Start(); 
     77 
     78protected: 
     79    ProgramStarter(); 
     80    void ConstructL(); 
     81    virtual void RunL(); 
     82    virtual void DoCancel(); 
     83    TInt RunError(TInt aError); 
     84 
     85private: 
     86    RTimer timer_; 
     87}; 
     88 
     89ProgramStarter::ProgramStarter() 
     90: CActive(EPriorityNormal) 
     91{ 
     92} 
     93 
     94void ProgramStarter::ConstructL() 
     95{ 
     96    timer_.CreateLocal(); 
     97    CActiveScheduler::Add(this); 
     98} 
     99 
     100ProgramStarter *ProgramStarter::NewL() 
     101{ 
     102    ProgramStarter *self = new (ELeave) ProgramStarter; 
     103    CleanupStack::PushL(self); 
     104 
     105    self->ConstructL(); 
     106 
     107    CleanupStack::Pop(self); 
     108    return self; 
     109} 
     110 
     111void ProgramStarter::Start() 
     112{ 
     113    timer_.After(iStatus, 0); 
     114    SetActive(); 
     115} 
     116 
     117void ProgramStarter::RunL() 
     118{ 
     119    MainL(); 
     120} 
     121 
     122void ProgramStarter::DoCancel() 
     123{ 
     124} 
     125 
     126TInt ProgramStarter::RunError(TInt aError) 
     127{ 
     128    PJ_UNUSED_ARG(aError); 
     129    return KErrNone; 
     130} 
    37131 
    38132 
     
    40134    { 
    41135    // Create active scheduler (to run active objects) 
    42     CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); 
     136    CActiveScheduler* scheduler = new (ELeave) MyScheduler; 
    43137    CleanupStack::PushL(scheduler); 
    44138    CActiveScheduler::Install(scheduler); 
    45139 
    46     MainL(); 
     140    ProgramStarter *starter = ProgramStarter::NewL(); 
     141    starter->Start(); 
     142 
     143    CActiveScheduler::Start(); 
    47144 
    48145    // Delete active scheduler 
    49     CleanupStack::PopAndDestroy(scheduler); 
     146    //CActiveScheduler::Install(NULL); 
     147    scheduler->Stop(); 
     148    //delete scheduler; 
    50149    } 
    51150 
    52151 
    53152//  Global Functions 
     153 
     154static void log_writer(int level, const char *buf, int len) 
     155{ 
     156    wchar_t buf16[PJ_LOG_MAX_SIZE]; 
     157 
     158    pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); 
     159 
     160    TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); 
     161    console->Write(aBuf); 
     162} 
     163 
    54164 
    55165GLDEF_C TInt E32Main() 
     
    60170 
    61171    // Create output console 
    62     TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen))); 
     172    TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); 
    63173    if (createError) 
    64174        return createError; 
     175 
     176    pj_log_set_log_func(&log_writer); 
    65177 
    66178    // Run application code inside TRAP harness, wait keypress when terminated 
    67179    TRAPD(mainError, DoStartL()); 
    68180    if (mainError) 
    69         console->Printf(KTextFailed, mainError); 
    70     console->Printf(KTextPressAnyKey); 
     181        console->Printf(_L(" failed, leave code = %d"), mainError); 
     182    console->Printf(_L(" [press any key]\n")); 
    71183    console->Getch(); 
    72184     
     
    76188    return KErrNone; 
    77189    } 
     190 
     191#endif  /* if 0 */ 
     192 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/mutex.c

    r65 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/errno.h> 
     21#include <pj/os.h> 
    2122 
    2223#if INCLUDE_MUTEX_TEST 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/rand.c

    r65 r788  
    2323#if INCLUDE_RAND_TEST 
    2424 
    25 #define COUNT  1024 
     25#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 
     26#   define COUNT    128 
     27#else 
     28#   define COUNT  1024 
     29#endif 
     30 
    2631static int values[COUNT]; 
    2732 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/select.c

    r65 r788  
    7272    } 
    7373 
    74     timeout.sec = 1; 
     74    timeout.sec = 5; 
    7575    timeout.msec = 0; 
    7676 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/sock.c

    r433 r788  
    1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    1818 */ 
    19 #include <pjlib.h> 
     19#include <pj/errno.h> 
     20#include <pj/ioqueue.h> 
     21#include <pj/log.h> 
     22#include <pj/sock.h> 
     23#include <pj/string.h> 
    2024#include "test.h" 
    2125 
     
    6569#define BIG_DATA_LEN    9000 
    6670#define ADDRESS         "127.0.0.1" 
    67 #define A0              127 
    68 #define A1              0 
    69 #define A2              0 
    70 #define A3              1 
    7171 
    7272 
     
    8080    pj_in_addr addr; 
    8181    const pj_str_t *hostname; 
     82#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 
     83    /* Symbian IP address is saved in host order */ 
     84    unsigned char A[] = {1, 0, 0, 127}; 
     85#else 
     86    unsigned char A[] = {127, 0, 0, 1}; 
     87#endif 
    8288 
    8389    PJ_LOG(3,("test", "...format_test()")); 
     
    8995    /* Check the result. */ 
    9096    p = (unsigned char*)&addr; 
    91     if (p[0]!=A0 || p[1]!=A1 || p[2]!=A2 || p[3]!=A3) { 
     97    if (p[0]!=A[0] || p[1]!=A[1] || p[2]!=A[2] || p[3]!=A[3]) { 
    9298        PJ_LOG(3,("test", "  error: mismatched address. p0=%d, p1=%d, " 
    9399                          "p2=%d, p3=%d", p[0] & 0xFF, p[1] & 0xFF,  
     
    97103 
    98104    /* pj_inet_ntoa() */ 
    99     p = pj_inet_ntoa(addr); 
     105    p = (unsigned char*)pj_inet_ntoa(addr); 
    100106    if (!p) 
    101107        return -20; 
    102108 
    103     if (pj_strcmp2(&s, p) != 0) 
     109    if (pj_strcmp2(&s, (char*)p) != 0) 
    104110        return -30; 
    105111 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/sock_perf.c

    r65 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/errno.h> 
     21#include <pj/ioqueue.h> 
     22#include <pj/log.h> 
     23#include <pj/os.h> 
     24#include <pj/pool.h> 
     25#include <pj/sock.h> 
    2126#include <pj/compat/high_precision.h> 
    2227 
     
    7075 
    7176    /* Create buffers. */ 
    72     outgoing_buffer = pj_pool_alloc(pool, buf_size); 
    73     incoming_buffer = pj_pool_alloc(pool, buf_size); 
     77    outgoing_buffer = (char*)pj_pool_alloc(pool, buf_size); 
     78    incoming_buffer = (char*)pj_pool_alloc(pool, buf_size); 
    7479 
    7580    /* Start loop. */ 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/string_test.c

    r692 r788  
    284284int string_test(void) 
    285285{ 
    286     const pj_str_t hello_world = { HELLO_WORLD, strlen(HELLO_WORLD) }; 
    287     const pj_str_t just_hello = { JUST_HELLO, strlen(JUST_HELLO) }; 
     286    pj_str_t hello_world; 
     287    pj_str_t just_hello; 
    288288    pj_str_t s1, s2, s3, s4, s5; 
    289289    enum { RCOUNT = 10, RLEN = 16 }; 
     
    291291    pj_pool_t *pool; 
    292292    int i; 
     293 
     294    hello_world = pj_str(HELLO_WORLD); 
     295    just_hello = pj_str(JUST_HELLO); 
    293296 
    294297    pool = pj_pool_create(mem, NULL, 4096, 0, NULL); 
     
    328331     * pj_strcpy(), pj_strcat()  
    329332     */ 
    330     s3.ptr = pj_pool_alloc(pool, 256); 
     333    s3.ptr = (char*)pj_pool_alloc(pool, 256); 
    331334    if (!s3.ptr)  
    332335        return -200; 
     
    348351     * pj_utoa()  
    349352     */ 
    350     s5.ptr = pj_pool_alloc(pool, 16); 
     353    s5.ptr = (char*)pj_pool_alloc(pool, 16); 
    351354    if (!s5.ptr) 
    352355        return -270; 
     
    366369        int j; 
    367370         
    368         random[i].ptr = pj_pool_alloc(pool, RLEN); 
     371        random[i].ptr = (char*)pj_pool_alloc(pool, RLEN); 
    369372        if (!random[i].ptr) 
    370373            return -320; 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/test.c

    r687 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/errno.h> 
     21#include <pj/ioqueue.h> 
     22#include <pj/log.h> 
     23#include <pj/os.h> 
     24#include <pj/pool.h> 
     25#include <pj/sock.h> 
     26 
    2127#ifdef _MSC_VER 
    2228#  pragma warning(disable:4127) 
     
    195201int test_main(void) 
    196202{ 
    197     PJ_USE_EXCEPTION; 
    198  
    199     PJ_TRY { 
    200         return test_inner(); 
    201     } 
    202     PJ_CATCH_ANY { 
    203         int id = PJ_GET_EXCEPTION(); 
    204         PJ_LOG(3,("test", "FATAL: unhandled exception id %d (%s)",  
    205                   id, pj_exception_id_name(id))); 
    206     } 
    207     PJ_END; 
    208  
    209     return -1; 
     203    return test_inner(); 
    210204} 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/test.h

    r496 r788  
    2525#define GROUP_OS                    0 
    2626#define GROUP_DATA_STRUCTURE        0 
    27 #define GROUP_NETWORK               0 
     27#define GROUP_NETWORK               1 
    2828#define GROUP_FILE                  0 
    2929 
    30 #define INCLUDE_ERRNO_TEST          GROUP_LIBC 
     30#define INCLUDE_ERRNO_TEST          0   // GROUP_LIBC 
    3131#define INCLUDE_TIMESTAMP_TEST      GROUP_OS 
    3232#define INCLUDE_EXCEPTION_TEST      GROUP_LIBC 
     
    3434#define INCLUDE_LIST_TEST           GROUP_DATA_STRUCTURE 
    3535#define INCLUDE_POOL_TEST           GROUP_LIBC 
    36 #define INCLUDE_POOL_PERF_TEST      (PJ_HAS_MALLOC && GROUP_LIBC) 
    37 #define INCLUDE_STRING_TEST         GROUP_DATA_STRUCTURE 
     36#define INCLUDE_POOL_PERF_TEST      0   // (PJ_HAS_MALLOC && GROUP_LIBC) 
     37#define INCLUDE_STRING_TEST         0   // GROUP_DATA_STRUCTURE 
    3838#define INCLUDE_FIFOBUF_TEST        0   // GROUP_DATA_STRUCTURE 
    3939#define INCLUDE_RBTREE_TEST         GROUP_DATA_STRUCTURE 
    4040#define INCLUDE_TIMER_TEST          GROUP_DATA_STRUCTURE 
    4141#define INCLUDE_ATOMIC_TEST         GROUP_OS 
    42 #define INCLUDE_MUTEX_TEST          GROUP_OS 
     42#define INCLUDE_MUTEX_TEST          (PJ_HAS_THREADS && GROUP_OS) 
    4343#define INCLUDE_SLEEP_TEST          GROUP_OS 
    44 #define INCLUDE_THREAD_TEST         GROUP_OS 
    45 #define INCLUDE_SOCK_TEST           GROUP_NETWORK 
    46 #define INCLUDE_SOCK_PERF_TEST      GROUP_NETWORK 
    47 #define INCLUDE_SELECT_TEST         GROUP_NETWORK 
     44#define INCLUDE_THREAD_TEST         (PJ_HAS_THREADS && GROUP_OS) 
     45#define INCLUDE_SOCK_TEST           0   // GROUP_NETWORK 
     46#define INCLUDE_SOCK_PERF_TEST      0   // GROUP_NETWORK 
     47#define INCLUDE_SELECT_TEST         0   // GROUP_NETWORK 
    4848#define INCLUDE_UDP_IOQUEUE_TEST    GROUP_NETWORK 
    4949#define INCLUDE_TCP_IOQUEUE_TEST    GROUP_NETWORK 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/timestamp.c

    r433 r788  
    196196    } 
    197197 
    198     sleep(0); 
     198    pj_thread_sleep(0); 
    199199 
    200200    /* Mark end time. */ 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c

    r65 r788  
    1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    1818 */ 
    19 #include <pjlib.h> 
     19#include <pj/errno.h> 
     20#include <pj/ioqueue.h> 
     21#include <pj/pool.h> 
     22#include <pj/sock.h> 
    2023#include "test.h" 
    2124 
     
    118121static int worker_thread(void *arg) 
    119122{ 
    120     pj_ioqueue_t *ioqueue = arg; 
     123    pj_ioqueue_t *ioqueue = (pj_ioqueue_t *)arg; 
    121124    struct op_key read_op, write_op; 
    122125    char recv_buf[512], send_buf[512]; 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/udp_echo_srv_sync.c

    r65 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/errno.h> 
     21#include <pj/ioqueue.h> 
     22#include <pj/os.h> 
     23#include <pj/pool.h> 
     24#include <pj/sock.h> 
     25#include <pj/compat/high_precision.h> 
     26 
    2127 
    2228static pj_atomic_t *total_bytes; 
  • pjproject/branches/symbian/pjlib/src/pjlib-test/util.c

    r433 r788  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjlib.h> 
     20#include <pj/errno.h> 
     21#include <pj/log.h> 
     22#include <pj/os.h> 
     23#include <pj/sock.h> 
     24#include <pj/string.h> 
     25 
    2126 
    2227#define THIS_FILE "util.c" 
  • pjproject/branches/symbian/symbian/ABLD.BAT

    r692 r788  
    44REM ** DO NOT EDIT ** 
    55 
    6 perl -S ABLD.PL "\Project\symbian\symbian\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 
     6perl -S ABLD.PL "\Project\pjsymbian\symbian\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 
    77if errorlevel==1 goto CheckPerl 
    88goto End 
  • pjproject/branches/symbian/symbian/b.bat

    r692 r788  
    11rem set MWSym2Libraries=1 
    22rem set MWSym2Libraries=\Symbian\9.1\S60_3rd\Epoc32\release\winscw\udeb 
    3 set EPOCROOT=\Symbian\9.1\S60_3rd\ 
    4 abld build -v winscw udeb 
     3rem set EPOCROOT=\Symbian\9.1\S60_3rd\ 
     4rem call abld build -v winscw udeb 
     5 
     6set EPOCROOT=\Symbian\UIQ3SDK\ 
     7call abld build -v vs6 udeb 
  • pjproject/branches/symbian/symbian/bld.inf

    r692 r788  
    11prj_mmpfiles 
    22pjlib.mmp 
    3 pjlib-test.mmp 
     3pjlib_test.mmp 
  • pjproject/branches/symbian/symbian/pjlib.mmp

    r692 r788  
    1 TARGET          pjlib-symbian.lib 
     1TARGET          pjlib.lib 
    22TARGETTYPE      lib 
    33UID             0x100039CE 0x10004299 
     
    1717SOURCE          ctype.c 
    1818SOURCE          errno.c 
    19 SOURCE          except.c 
    2019SOURCE          fifobuf.c 
    2120SOURCE          guid.c 
     
    3736// Platform dependent source 
    3837// 
    39 SOURCE          addr_resolv_sock.c 
     38SOURCE          addr_resolv_symbian.cpp 
     39SOURCE          exception_symbian.cpp 
    4040SOURCE          file_access_unistd.c 
    4141SOURCE          file_io_ansi.c 
    4242SOURCE          guid_simple.c 
    43 SOURCE          log_writer_stdout.c 
     43SOURCE          log_writer_symbian_console.cpp 
    4444SOURCE          os_core_symbian.cpp 
    45 SOURCE          os_error_unix.c 
     45SOURCE          os_error_symbian.cpp 
     46SOURCE          os_timestamp_common.c 
    4647SOURCE          os_time_unix.c 
    47 SOURCE          os_timestamp_common.c 
    4848SOURCE          os_timestamp_posix.c 
    49 SOURCE          pool_policy_malloc.c 
     49SOURCE          pool_policy_new.cpp 
    5050SOURCE          compat\string_compat.c 
    51 SOURCE          sock_bsd.c 
     51SOURCE          sock_symbian.cpp 
    5252SOURCE          sock_select_symbian.cpp 
    5353SOURCE          ioqueue_symbian.cpp 
     54SOURCE          unicode_symbian.cpp 
    5455 
    5556 
    5657SYSTEMINCLUDE   ..\pjlib\include 
    57 //SYSTEMINCLUDE \symbian\9.1\S60_3rd_MR\epoc32\include 
    58 //SYSTEMINCLUDE \symbian\9.1\S60_3rd_MR\epoc32\include\libc 
    59 SYSTEMINCLUDE   \symbian\9.1\S60_3rd\epoc32\include 
    60 SYSTEMINCLUDE   \symbian\9.1\S60_3rd\epoc32\include\libc 
     58SYSTEMINCLUDE   \epoc32\include 
     59SYSTEMINCLUDE   \epoc32\include\libc 
  • pjproject/branches/symbian/symbian/pjlib_test.mmp

    r692 r788  
    1 TARGET          pjlib-test-symbian.exe 
     1TARGET          pjlib_test.exe 
    22TARGETTYPE      exe 
    33UID             0x100039CE 0x10004299 
     
    4444 
    4545SOURCE  main_symbian.cpp 
     46//SOURCE        main.c 
    4647 
    4748 
    4849SYSTEMINCLUDE   ..\pjlib\include 
    49 SYSTEMINCLUDE   \symbian\9.1\S60_3rd\epoc32\include 
    50 SYSTEMINCLUDE   \symbian\9.1\S60_3rd\epoc32\include\libc 
     50SYSTEMINCLUDE   \epoc32\include 
     51SYSTEMINCLUDE   \epoc32\include\libc 
    5152//SYSTEMINCLUDE \symbian\9.1\S60_3rd_MR\epoc32\include 
    5253//SYSTEMINCLUDE \symbian\9.1\S60_3rd_MR\epoc32\include\libc 
    5354 
    54 LIBRARY         pjlib-symbian.lib euser.lib estlib.lib eexe.lib 
    55                 //eexe.lib  
     55LIBRARY         pjlib.lib esock.lib insock.lib charconv.lib euser.lib estlib.lib eexe.lib 
     56STATICLIBRARY   ecrt0.lib 
    5657CAPABILITY      None 
    5758 
  • pjproject/branches/symbian/symbian/s.bat

    r692 r788  
    11rem set MWSym2Libraries=1 
    2 set EPOCROOT=\Symbian\9.1\S60_3rd\ 
     2rem set EPOCROOT=\Symbian\9.1\S60_3rd\ 
     3set EPOCROOT=\Symbian\UIQ3SDK\ 
    34bldmake bldfiles 
    45call b.bat 
Note: See TracChangeset for help on using the changeset viewer.