Changeset 2346
- Timestamp:
- Jul 15, 2007, 3:26:22 AM (16 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r2343 r2346 1266 1266 tr_torrentWriterUnlock( tor ); 1267 1267 } 1268 1269 cp_status_t 1270 tr_torrentGetFileStatus( const tr_torrent_t * tor, int fileIndex ) 1271 { 1272 int i; 1273 int isComplete; 1274 const tr_file_t * file; 1275 1276 assert( tor != NULL ); 1277 assert( 0<=fileIndex ); 1278 assert( fileIndex<tor->info.fileCount ); 1279 1280 file = &tor->info.files[fileIndex]; 1281 1282 isComplete = TRUE; 1283 for( i=file->firstPiece; isComplete && i<=file->lastPiece; ++i ) 1284 if( !tr_cpPieceIsComplete( tor->completion, i ) ) 1285 isComplete = FALSE; 1286 1287 if( isComplete ) 1288 return TR_CP_COMPLETE; 1289 1290 if( file->dnd ) 1291 return TR_CP_DONE; 1292 1293 return TR_CP_INCOMPLETE; 1294 } -
trunk/libtransmission/transmission.h
r2333 r2346 247 247 248 248 249 typedef enum 250 { 251 TR_CP_INCOMPLETE, /* doesn't have all the desired pieces */ 252 TR_CP_DONE, /* has all the pieces but the DND ones */ 253 TR_CP_COMPLETE /* has every piece */ 254 } 255 cp_status_t; 256 257 cp_status_t tr_torrentGetFileStatus( const tr_torrent_t * tor, 258 int fileIndex ); 259 260 249 261 /*********************************************************************** 250 262 * tr_torrentRates … … 537 549 typedef enum 538 550 { 539 TR_CP_INCOMPLETE, /* doesn't have all the desired pieces */540 TR_CP_DONE, /* has all the pieces but the DND ones */541 TR_CP_COMPLETE /* has every piece */542 }543 cp_status_t;544 545 typedef enum546 {547 551 TR_STATUS_CHECK_WAIT = (1<<0), /* Waiting in queue to check files */ 548 552 TR_STATUS_CHECK = (1<<1), /* Checking files */
Note: See TracChangeset
for help on using the changeset viewer.