Changeset 754


Ignore:
Timestamp:
Aug 12, 2006, 12:38:26 AM (17 years ago)
Author:
livings124
Message:

Some new accessors for libtransmission...I don't see what harm these can do

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r725 r754  
    256256                4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = "<group>"; };
    257257                4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = "<group>"; };
    258                 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
     258                4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
    259259                4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = "<group>"; };
    260260                4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = "<group>"; };
  • trunk/libtransmission/peer.c

    r261 r754  
    297297
    298298/***********************************************************************
     299 * tr_peerId
     300 ***********************************************************************
     301 *
     302 **********************************************************************/
     303uint8_t * tr_peerId( tr_peer_t * peer )
     304{
     305    return & peer->id[0];
     306}
     307
     308/***********************************************************************
    299309 * tr_peerHash
    300310 ***********************************************************************
  • trunk/libtransmission/peer.h

    r261 r754  
    2626#define TR_PEER_H 1
    2727
    28 typedef struct tr_peer_s tr_peer_t;
    29 
    3028void        tr_peerAddOld        ( tr_torrent_t *, char *, int );
    3129void        tr_peerAddCompact    ( tr_torrent_t *, struct in_addr, in_port_t );
     
    3634int         tr_peerRead          ( tr_torrent_t *, tr_peer_t * );
    3735uint64_t    tr_peerDate          ( tr_peer_t * );
     36uint8_t *   tr_peerId            ( tr_peer_t * );
    3837uint8_t *   tr_peerHash          ( tr_peer_t * );
    3938void        tr_peerPulse         ( tr_torrent_t * );
  • trunk/libtransmission/transmission.c

    r751 r754  
    404404    }
    405405    return 0;
     406}
     407
     408tr_peer_t * tr_getPeer( tr_torrent_t * tor, int peerNum)
     409{
     410    if (peerNum < 0 || peerNum >= tor->peerCount)
     411        return NULL;
     412    return tor->peers[peerNum];
    406413}
    407414
  • trunk/libtransmission/transmission.h

    r626 r754  
    199199
    200200/***********************************************************************
     201 * tr_getPeer
     202 ***********************************************************************
     203 * Returns the peer at peerNum. Returns NULL if peerNum is not greater
     204 * than 0 and less than peerCount.
     205 **********************************************************************/
     206typedef struct tr_peer_s tr_peer_t;
     207tr_peer_t * tr_getPeer( tr_torrent_t *, int peerNum );
     208
     209/***********************************************************************
    201210 * tr_torrentStat
    202211 ***********************************************************************
  • trunk/macosx/Controller.m

    r753 r754  
    12741274        shouldBeOn = hour < offHour || hour >= onHour;
    12751275   
    1276     if ((!fSpeedLimitEnabled && shouldBeOn) || (fSpeedLimitEnabled && !shouldBeOn))
     1276    if (fSpeedLimitEnabled != shouldBeOn)
    12771277    {
    12781278        [self toggleSpeedLimit: nil];
Note: See TracChangeset for help on using the changeset viewer.