Changeset 3025


Ignore:
Timestamp:
Sep 10, 2007, 2:05:31 PM (15 years ago)
Author:
charles
Message:

janitorial work

Location:
branches/encryption/libtransmission
Files:
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • branches/encryption/libtransmission/fdlimit.c

    r3018 r3025  
    6464typedef struct tr_fd_s
    6565{
    66     tr_lock_t     * lock;
    67     tr_cond_t     * cond;
     66    tr_lock       * lock;
     67    tr_cond       * cond;
    6868   
    6969    int             reserved;
  • branches/encryption/libtransmission/inout.c

    r3017 r3025  
    300300static tr_list * recheckList = NULL;
    301301
    302 static tr_thread_t * recheckThread = NULL;
     302static tr_thread * recheckThread = NULL;
    303303
    304304static int stopCurrent = FALSE;
  • branches/encryption/libtransmission/internal.h

    r3017 r3025  
    149149    char                       runStatusToSaveIsSet;
    150150    cp_status_t                cpStatus;
    151     struct tr_rwlock_s       * lock;
     151    struct tr_rwlock         * lock;
    152152
    153153    struct tr_tracker        * tracker;
  • branches/encryption/libtransmission/makemeta.c

    r2941 r3025  
    410410static tr_metainfo_builder_t * queue = NULL;
    411411
    412 static tr_thread_t * workerThread = NULL;
    413 
    414 static tr_lock_t* getQueueLock( tr_handle_t * h )
    415 {
    416     static tr_lock_t * lock = NULL;
     412static tr_thread * workerThread = NULL;
     413
     414static tr_lock* getQueueLock( tr_handle_t * h )
     415{
     416    static tr_lock * lock = NULL;
    417417
    418418    tr_sharedLock( h->shared );
     
    433433
    434434        /* find the next builder to process */
    435         tr_lock_t * lock = getQueueLock ( handle );
     435        tr_lock * lock = getQueueLock ( handle );
    436436        tr_lockLock( lock );
    437437        if( queue != NULL ) {
     
    458458                 int                      isPrivate )
    459459{
    460     tr_lock_t * lock;
     460    tr_lock * lock;
    461461
    462462    builder->abortFlag = 0;
  • branches/encryption/libtransmission/peer-io.c

    r2995 r3025  
    155155
    156156    c = tr_peerIoNew( handle, in_addr, torrentHash, 0,
    157                               tr_netOpenTCP( in_addr, port, 0 ) );
     157                      tr_netOpenTCP( in_addr, port, 0 ) );
    158158    c->port = port;
    159159    return c;
     
    165165    if( c != NULL )
    166166    {
    167         bufferevent_free( c->bufev );
     167        tr_bufferevent_free( c->handle, c->bufev );
    168168fprintf( stderr, "io %p destroying rate to client %p to peer %p\n", c, c->rateToClient, c->rateToPeer );
    169169        tr_rcClose( c->rateToClient );
  • branches/encryption/libtransmission/peer-mgr.c

    r3022 r3025  
    212212freePeer( tr_peer * peer )
    213213{
    214     tr_peerMsgsUnsubscribe( peer->msgs, &peer->msgsTag );
    215     tr_peerMsgsFree( peer->msgs );
     214    if( peer->msgs != NULL ) {
     215        tr_peerMsgsUnsubscribe( peer->msgs, &peer->msgsTag );
     216        tr_peerMsgsFree( peer->msgs );
     217    }
    216218    tr_bitfieldFree( peer->have );
    217219    tr_bitfieldFree( peer->blame );
  • branches/encryption/libtransmission/peer-msgs.c

    r3021 r3025  
    994994    {
    995995fprintf( stderr, "peer %p destroying its pulse tag\n", p );
     996        tr_timerFree( &p->pulseTag );
     997        tr_timerFree( &p->pexTag );
    996998        tr_list_free( &p->clientAskedFor );
    997999        tr_list_free( &p->peerAskedFor );
    9981000        tr_publisherFree( &p->publisher );
    999         tr_timerFree( &p->pulseTag );
    1000         tr_timerFree( &p->pexTag );
    10011001        evbuffer_free( p->outMessages );
    10021002        evbuffer_free( p->outBlock );
  • branches/encryption/libtransmission/platform.c

    r2977 r3025  
    5757***/
    5858
    59 struct tr_thread_s
     59struct tr_thread
    6060{
    6161    void          (* func ) ( void * );
     
    8383ThreadFunc( void * _t )
    8484{
    85     tr_thread_t * t = _t;
     85    tr_thread * t = _t;
    8686    char* name = tr_strdup( t->name );
    8787
     
    104104}
    105105
    106 tr_thread_t *
     106tr_thread *
    107107tr_threadNew( void (*func)(void *),
    108108              void * arg,
    109109              const char * name )
    110110{
    111     tr_thread_t * t = tr_new0( tr_thread_t, 1 );
     111    tr_thread * t = tr_new0( tr_thread, 1 );
    112112    t->func = func;
    113113    t->arg  = arg;
     
    127127
    128128int
    129 tr_amInThread ( const tr_thread_t * t )
     129tr_amInThread ( const tr_thread * t )
    130130{
    131131#ifdef __BEOS__
     
    139139   
    140140void
    141 tr_threadJoin( tr_thread_t * t )
     141tr_threadJoin( tr_thread * t )
    142142{
    143143    if( t != NULL )
     
    165165***/
    166166
    167 struct tr_lock_s
     167struct tr_lock
    168168{
    169169#ifdef __BEOS__
     
    176176};
    177177
    178 tr_lock_t*
     178tr_lock*
    179179tr_lockNew( void )
    180180{
    181     tr_lock_t * l = tr_new0( tr_lock_t, 1 );
     181    tr_lock * l = tr_new0( tr_lock, 1 );
    182182
    183183#ifdef __BEOS__
     
    193193
    194194void
    195 tr_lockFree( tr_lock_t * l )
     195tr_lockFree( tr_lock * l )
    196196{
    197197#ifdef __BEOS__
     
    206206
    207207int
    208 tr_lockTryLock( tr_lock_t * l ) /* success on zero! */
     208tr_lockTryLock( tr_lock * l ) /* success on zero! */
    209209{
    210210#ifdef __BEOS__
     
    218218
    219219void
    220 tr_lockLock( tr_lock_t * l )
     220tr_lockLock( tr_lock * l )
    221221{
    222222#ifdef __BEOS__
     
    230230
    231231void
    232 tr_lockUnlock( tr_lock_t * l )
     232tr_lockUnlock( tr_lock * l )
    233233{
    234234#ifdef __BEOS__
     
    245245***/
    246246
    247 struct tr_rwlock_s
    248 {
    249     tr_lock_t * lock;
    250     tr_cond_t * readCond;
    251     tr_cond_t * writeCond;
     247struct tr_rwlock
     248{
     249    tr_lock * lock;
     250    tr_cond * readCond;
     251    tr_cond * writeCond;
    252252    size_t readCount;
    253253    size_t wantToRead;
     
    257257
    258258static void
    259 tr_rwSignal( tr_rwlock_t * rw )
     259tr_rwSignal( tr_rwlock * rw )
    260260{
    261261  if ( rw->wantToWrite )
     
    265265}
    266266
    267 tr_rwlock_t*
     267tr_rwlock*
    268268tr_rwNew ( void )
    269269{
    270     tr_rwlock_t * rw = tr_new0( tr_rwlock_t, 1 );
     270    tr_rwlock * rw = tr_new0( tr_rwlock, 1 );
    271271    rw->lock = tr_lockNew( );
    272272    rw->readCond = tr_condNew( );
     
    276276
    277277void
    278 tr_rwReaderLock( tr_rwlock_t * rw )
     278tr_rwReaderLock( tr_rwlock * rw )
    279279{
    280280    tr_lockLock( rw->lock );
     
    288288
    289289int
    290 tr_rwReaderTrylock( tr_rwlock_t * rw )
     290tr_rwReaderTrylock( tr_rwlock * rw )
    291291{
    292292    int ret = FALSE;
     
    302302
    303303void
    304 tr_rwReaderUnlock( tr_rwlock_t * rw )
     304tr_rwReaderUnlock( tr_rwlock * rw )
    305305{
    306306    tr_lockLock( rw->lock );
     
    312312
    313313void
    314 tr_rwWriterLock( tr_rwlock_t * rw )
     314tr_rwWriterLock( tr_rwlock * rw )
    315315{
    316316    tr_lockLock( rw->lock );
     
    324324
    325325int
    326 tr_rwWriterTrylock( tr_rwlock_t * rw )
     326tr_rwWriterTrylock( tr_rwlock * rw )
    327327{
    328328    int ret = FALSE;
     
    334334}
    335335void
    336 tr_rwWriterUnlock( tr_rwlock_t * rw )
     336tr_rwWriterUnlock( tr_rwlock * rw )
    337337{
    338338    tr_lockLock( rw->lock );
     
    343343
    344344void
    345 tr_rwFree( tr_rwlock_t * rw )
     345tr_rwFree( tr_rwlock * rw )
    346346{
    347347    tr_condFree( rw->writeCond );
     
    355355***/
    356356
    357 struct tr_cond_s
     357struct tr_cond
    358358{
    359359#ifdef __BEOS__
     
    363363#elif defined(WIN32)
    364364    tr_list * events;
    365     tr_lock_t * lock;
     365    tr_lock * lock;
    366366#else
    367367    pthread_cond_t cond;
     
    382382#endif
    383383
    384 tr_cond_t*
     384tr_cond*
    385385tr_condNew( void )
    386386{
    387     tr_cond_t * c = tr_new0( tr_cond_t, 1 );
     387    tr_cond * c = tr_new0( tr_cond, 1 );
    388388#ifdef __BEOS__
    389389    c->sem = create_sem( 1, "" );
     
    400400
    401401void
    402 tr_condWait( tr_cond_t * c, tr_lock_t * l )
     402tr_condWait( tr_cond * c, tr_lock * l )
    403403{
    404404#ifdef __BEOS__
     
    448448
    449449#ifdef __BEOS__
    450 static int condTrySignal( tr_cond_t * c )
     450static int condTrySignal( tr_cond * c )
    451451{
    452452    if( c->start == c->end )
     
    472472#endif
    473473void
    474 tr_condSignal( tr_cond_t * c )
     474tr_condSignal( tr_cond * c )
    475475{
    476476#ifdef __BEOS__
     
    495495
    496496void
    497 tr_condBroadcast( tr_cond_t * c )
     497tr_condBroadcast( tr_cond * c )
    498498{
    499499#ifdef __BEOS__
     
    519519
    520520void
    521 tr_condFree( tr_cond_t * c )
     521tr_condFree( tr_cond * c )
    522522{
    523523#ifdef __BEOS__
  • branches/encryption/libtransmission/platform.h

    r2977 r3025  
    2525#define TR_PLATFORM_H
    2626
    27 typedef struct tr_lock_s   tr_lock_t;
    28 typedef struct tr_cond_s   tr_cond_t;
    29 typedef struct tr_thread_s tr_thread_t;
     27typedef struct tr_lock   tr_lock;
     28typedef struct tr_cond   tr_cond;
     29typedef struct tr_thread tr_thread;
    3030
    3131const char * tr_getHomeDirectory( void );
     
    3333const char * tr_getTorrentsDirectory( void );
    3434
    35 tr_thread_t*  tr_threadNew  ( void (*func)(void *), void * arg, const char * name );
    36 void          tr_threadJoin ( tr_thread_t * );
    37 int           tr_amInThread ( const tr_thread_t * );
     35tr_thread*   tr_threadNew  ( void (*func)(void *), void * arg, const char * name );
     36void         tr_threadJoin ( tr_thread * );
     37int          tr_amInThread ( const tr_thread * );
    3838
    39 tr_lock_t * tr_lockNew        ( void );
    40 void        tr_lockFree       ( tr_lock_t * );
    41 int         tr_lockTryLock    ( tr_lock_t * );
    42 void        tr_lockLock       ( tr_lock_t * );
    43 void        tr_lockUnlock     ( tr_lock_t * );
     39tr_lock *    tr_lockNew        ( void );
     40void         tr_lockFree       ( tr_lock * );
     41int          tr_lockTryLock    ( tr_lock * );
     42void         tr_lockLock       ( tr_lock * );
     43void         tr_lockUnlock     ( tr_lock * );
    4444
    45 tr_cond_t * tr_condNew       ( void );
    46 void        tr_condFree      ( tr_cond_t * );
    47 void        tr_condSignal    ( tr_cond_t * );
    48 void        tr_condBroadcast ( tr_cond_t * );
    49 void        tr_condWait      ( tr_cond_t *, tr_lock_t * );
     45tr_cond *    tr_condNew       ( void );
     46void         tr_condFree      ( tr_cond * );
     47void         tr_condSignal    ( tr_cond * );
     48void         tr_condBroadcast ( tr_cond * );
     49void         tr_condWait      ( tr_cond *, tr_lock * );
    5050
    5151/***
     
    5454***/
    5555
    56 typedef struct tr_rwlock_s tr_rwlock_t;
     56typedef struct tr_rwlock tr_rwlock;
    5757
    58 tr_rwlock_t*  tr_rwNew           ( void );
    59 void          tr_rwFree          ( tr_rwlock_t * );
    60 void          tr_rwReaderLock    ( tr_rwlock_t * );
    61 int           tr_rwReaderTrylock ( tr_rwlock_t * );
    62 void          tr_rwReaderUnlock  ( tr_rwlock_t * );
    63 void          tr_rwWriterLock    ( tr_rwlock_t * );
    64 int           tr_rwWriterTrylock ( tr_rwlock_t * );
    65 void          tr_rwWriterUnlock  ( tr_rwlock_t * );
     58tr_rwlock  tr_rwNew           ( void );
     59void          tr_rwFree          ( tr_rwlock * );
     60void          tr_rwReaderLock    ( tr_rwlock * );
     61int           tr_rwReaderTrylock ( tr_rwlock * );
     62void          tr_rwReaderUnlock  ( tr_rwlock * );
     63void          tr_rwWriterLock    ( tr_rwlock * );
     64int           tr_rwWriterTrylock ( tr_rwlock * );
     65void          tr_rwWriterUnlock  ( tr_rwlock * );
    6666
    6767
  • branches/encryption/libtransmission/ratecontrol.c

    r2971 r3025  
    4545struct tr_ratecontrol
    4646{
    47     tr_lock_t * lock;
     47    tr_lock * lock;
    4848    int limit;
    4949    int newest;
     
    105105        ret = 0;
    106106    else {
    107         tr_lockLock( (tr_lock_t*)r->lock );
     107        tr_lockLock( (tr_lock*)r->lock );
    108108        ret = rateForInterval( r, SHORT_INTERVAL_MSEC ) < r->limit;
    109         tr_lockUnlock( (tr_lock_t*)r->lock );
     109        tr_lockUnlock( (tr_lock*)r->lock );
    110110    }
    111111
     
    121121        ret = 0.0f;
    122122    else {
    123         tr_lockLock( (tr_lock_t*)r->lock );
     123        tr_lockLock( (tr_lock*)r->lock );
    124124        ret = rateForInterval( r, LONG_INTERVAL_MSEC );
    125         tr_lockUnlock( (tr_lock_t*)r->lock );
     125        tr_lockUnlock( (tr_lock*)r->lock );
    126126    }
    127127
     
    141141        return;
    142142   
    143     tr_lockLock( (tr_lock_t*)r->lock );
     143    tr_lockLock( (tr_lock*)r->lock );
    144144
    145145    now = tr_date ();
     
    152152    }
    153153
    154     tr_lockUnlock( (tr_lock_t*)r->lock );
     154    tr_lockUnlock( (tr_lock*)r->lock );
    155155}
    156156
     
    158158tr_rcReset( tr_ratecontrol * r )
    159159{
    160     tr_lockLock( (tr_lock_t*)r->lock );
     160    tr_lockLock( (tr_lock*)r->lock );
    161161    r->newest = 0;
    162162    memset( r->transfers, 0, sizeof(tr_transfer_t) * HISTORY_SIZE );
    163     tr_lockUnlock( (tr_lock_t*)r->lock );
     163    tr_lockUnlock( (tr_lock*)r->lock );
    164164}
    165165
     
    167167tr_rcSetLimit( tr_ratecontrol * r, int limit )
    168168{
    169     tr_lockLock( (tr_lock_t*)r->lock );
     169    tr_lockLock( (tr_lock*)r->lock );
    170170    r->limit = limit;
    171     tr_lockUnlock( (tr_lock_t*)r->lock );
     171    tr_lockUnlock( (tr_lock*)r->lock );
    172172}
    173173
  • branches/encryption/libtransmission/shared.c

    r2956 r3025  
    4949    tr_handle  * h;
    5050    volatile int   die;
    51     tr_thread_t  * thread;
    52     tr_lock_t    * lock;
     51    tr_thread  * thread;
     52    tr_lock    * lock;
    5353
    5454    /* Incoming connections */
  • branches/encryption/libtransmission/torrent.c

    r3017 r3025  
    8484tr_torrentReaderLock( const tr_torrent * tor )
    8585{
    86     tr_rwReaderLock ( (tr_rwlock_t*)tor->lock );
     86    tr_rwReaderLock ( (tr_rwlock*)tor->lock );
    8787}
    8888
     
    9090tr_torrentReaderUnlock( const tr_torrent * tor )
    9191{
    92     tr_rwReaderUnlock ( (tr_rwlock_t*)tor->lock );
     92    tr_rwReaderUnlock ( (tr_rwlock*)tor->lock );
    9393}
    9494
  • branches/encryption/libtransmission/trevent.c

    r3020 r3025  
    4242typedef struct tr_event_handle
    4343{
    44     tr_lock_t * lock;
     44    tr_lock * lock;
    4545    tr_handle_t * h;
    46     tr_thread_t * thread;
     46    tr_thread * thread;
    4747    tr_list * commands;
    4848    struct event_base * base;
  • branches/encryption/libtransmission/trevent.h

    r2946 r3025  
    4949                           size_t                buflen );
    5050
     51void tr_bufferevent_free( struct tr_handle   * handle,
     52                          struct bufferevent * bufev );
     53
     54
    5155void tr_setBufferEventMode( struct tr_handle   * tr_handle,
    5256                            struct bufferevent * bufferEvent,
  • branches/encryption/libtransmission/utils.c

    r3010 r3025  
    5050#define SPRINTF_BUFSIZE         100
    5151
    52 static tr_lock_t      * messageLock = NULL;
     52static tr_lock        * messageLock = NULL;
    5353static int              messageLevel = 0;
    5454static int              messageQueuing = FALSE;
Note: See TracChangeset for help on using the changeset viewer.