revise tr_torrentSetFilePriorities() for BMW

This commit is contained in:
Charles Kerr 2007-07-13 00:27:47 +00:00
parent 6f09fbe18d
commit a3eb718162
2 changed files with 14 additions and 7 deletions

View File

@ -1160,12 +1160,16 @@ tr_torrentSetFilePriority( tr_torrent_t * tor,
}
void
tr_torrentSetFilePriorities( tr_torrent_t * tor,
const tr_priority_t * filePriorities )
tr_torrentSetFilePriorities( tr_torrent_t * tor,
int * files,
int fileCount,
tr_priority_t priority )
{
int i;
for( i=0; i<tor->info.pieceCount; ++i )
tr_torrentSetFilePriorityImpl( tor, i, filePriorities[i], FALSE );
for( i=0; i<fileCount; ++i ) {
const int fileIndex = files[i];
tr_torrentSetFilePriorityImpl( tor, fileIndex, priority, FALSE );
}
fastResumeSave( tor );
}

View File

@ -213,9 +213,12 @@ enum
typedef int8_t tr_priority_t;
/* priorities should be an array of tor->info.fileCount bytes,
* each holding a value of TR_PRI_NORMAL, _HIGH, or _LOW */
void tr_torrentSetFilePriorities ( tr_torrent_t *, const tr_priority_t * priorities );
/* set a batch of files to a particular priority. */
void tr_torrentSetFilePriorities( tr_torrent_t * tor,
int * files,
int fileCount,
tr_priority_t priority );
/* single-file form of tr_torrentPrioritizeFiles.
* priority must be one of TR_PRI_NORMAL, _HIGH, or _LOW */