Changeset 7591
- Timestamp:
- Jan 3, 2009, 12:25:27 AM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r7586 r7591 165 165 **/ 166 166 167 static void167 static inline void 168 168 managerLock( const struct tr_peerMgr * manager ) 169 169 { … … 171 171 } 172 172 173 static void173 static inline void 174 174 managerUnlock( const struct tr_peerMgr * manager ) 175 175 { … … 177 177 } 178 178 179 static void179 static inline void 180 180 torrentLock( Torrent * torrent ) 181 181 { … … 183 183 } 184 184 185 static void185 static inline void 186 186 torrentUnlock( Torrent * torrent ) 187 187 { … … 189 189 } 190 190 191 static in t191 static inline int 192 192 torrentIsLocked( const Torrent * t ) 193 193 { -
trunk/libtransmission/torrent.c
r7584 r7591 661 661 } 662 662 663 tr_bool664 tr_torrentIsPrivate( const tr_torrent * tor )665 {666 return tor667 && tor->info.isPrivate;668 }669 670 tr_bool671 tr_torrentAllowsPex( const tr_torrent * tor )672 {673 return tor674 && tor->session->isPexEnabled675 && !tr_torrentIsPrivate( tor );676 }677 678 663 static inline void 679 664 tr_torrentManualUpdateImpl( void * vtor ) … … 1313 1298 } 1314 1299 1315 tr_bool1316 tr_torrentIsSeed( const tr_torrent * tor )1317 {1318 return tor->completeness != TR_LEECH;1319 }1320 1321 1300 /** 1322 1301 *** File priorities … … 1574 1553 **** 1575 1554 ***/ 1576 1577 tr_bool1578 tr_torrentIsPieceChecked( const tr_torrent * tor,1579 tr_piece_index_t piece )1580 {1581 return tr_bitfieldHas( &tor->checkedPieces, piece );1582 }1583 1555 1584 1556 void -
trunk/libtransmission/torrent.h
r7584 r7591 57 57 tr_bool do_download ); 58 58 59 tr_bool tr_torrentIsPrivate( const tr_torrent * );60 61 59 void tr_torrentRecheckCompleteness( tr_torrent * ); 62 60 … … 67 65 tr_bool has ); 68 66 69 tr_bool tr_torrentIsSeed( const tr_torrent * session );70 71 67 void tr_torrentChangeMyPort( tr_torrent * session ); 72 68 … … 82 78 tr_torrent* tr_torrentFindFromObfuscatedHash( tr_session * session, 83 79 const uint8_t * hash ); 84 85 tr_bool tr_torrentAllowsPex( const tr_torrent * );86 80 87 81 tr_bool tr_torrentIsPieceTransferAllowed( const tr_torrent * torrent, … … 110 104 111 105 int tr_torrentCountUncheckedPieces( const tr_torrent * ); 112 113 tr_bool tr_torrentIsPieceChecked( const tr_torrent * tor,114 tr_piece_index_t piece );115 106 116 107 tr_bool tr_torrentIsFileChecked( const tr_torrent * tor, … … 255 246 } 256 247 257 static inline void 258 tr_torrentLock( const tr_torrent * tor ) 248 static inline void tr_torrentLock( const tr_torrent * tor ) 259 249 { 260 250 tr_globalLock( tor->session ); 261 251 } 262 252 263 static inline void 264 tr_torrentUnlock( const tr_torrent * tor ) 253 static inline void tr_torrentUnlock( const tr_torrent * tor ) 265 254 { 266 255 tr_globalUnlock( tor->session ); … … 273 262 } 274 263 264 static inline tr_bool 265 tr_torrentIsSeed( const tr_torrent * tor ) 266 { 267 return tor->completeness != TR_LEECH; 268 } 269 270 static inline tr_bool tr_torrentIsPrivate( const tr_torrent * tor ) 271 { 272 return ( tor != NULL ) && tor->info.isPrivate; 273 } 274 275 static inline tr_bool tr_torrentAllowsPex( const tr_torrent * tor ) 276 { 277 return ( tor != NULL ) && tor->session->isPexEnabled && !tr_torrentIsPrivate( tor ); 278 } 279 280 static inline tr_bool tr_torrentIsPieceChecked( const tr_torrent * tor, tr_piece_index_t i ) 281 { 282 return tr_bitfieldHas( &tor->checkedPieces, i ); 283 } 275 284 276 285 #endif
Note: See TracChangeset
for help on using the changeset viewer.