Changeset 754 for trunk/libtransmission


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

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

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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 ***********************************************************************
Note: See TracChangeset for help on using the changeset viewer.