mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk libT) minor API cleanup: constify array arguments in tr_torrentSetFilePriorities(), tr_torrentInitFileDLs(), and tr_torrentSetFileDLs()
This commit is contained in:
parent
bb8cef3f14
commit
f7d4377fa1
3 changed files with 27 additions and 24 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "trevent.h" /* tr_runInEventThread() */
|
||||
#include "utils.h"
|
||||
#include "verify.h"
|
||||
#include "version.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -1704,6 +1705,8 @@ torrentCallScript( tr_torrent * tor, const char * script )
|
|||
clearenv( );
|
||||
#endif
|
||||
|
||||
setenv( "TR_APP_VERSION", SHORT_VERSION_STRING, 1 );
|
||||
|
||||
tr_snprintf( buf, sizeof( buf ), "%d", tr_torrentId( tor ) );
|
||||
setenv( "TR_TORRENT_ID", buf, 1 );
|
||||
setenv( "TR_TORRENT_NAME", tr_torrentName( tor ), 1 );
|
||||
|
@ -1816,10 +1819,10 @@ tr_torrentInitFilePriority( tr_torrent * tor,
|
|||
}
|
||||
|
||||
void
|
||||
tr_torrentSetFilePriorities( tr_torrent * tor,
|
||||
tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_priority_t priority )
|
||||
tr_torrentSetFilePriorities( tr_torrent * tor,
|
||||
const tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_priority_t priority )
|
||||
{
|
||||
tr_file_index_t i;
|
||||
assert( tr_isTorrent( tor ) );
|
||||
|
@ -1911,10 +1914,10 @@ setFileDND( tr_torrent * tor, tr_file_index_t fileIndex, int doDownload )
|
|||
}
|
||||
|
||||
void
|
||||
tr_torrentInitFileDLs( tr_torrent * tor,
|
||||
tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool doDownload )
|
||||
tr_torrentInitFileDLs( tr_torrent * tor,
|
||||
const tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool doDownload )
|
||||
{
|
||||
tr_file_index_t i;
|
||||
|
||||
|
@ -1932,10 +1935,10 @@ tr_torrentInitFileDLs( tr_torrent * tor,
|
|||
}
|
||||
|
||||
void
|
||||
tr_torrentSetFileDLs( tr_torrent * tor,
|
||||
tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool doDownload )
|
||||
tr_torrentSetFileDLs( tr_torrent * tor,
|
||||
const tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool doDownload )
|
||||
{
|
||||
assert( tr_isTorrent( tor ) );
|
||||
tr_torrentLock( tor );
|
||||
|
|
|
@ -43,10 +43,10 @@ void tr_ctorInitTorrentWanted( const tr_ctor * ctor, tr_torrent * tor );
|
|||
**/
|
||||
|
||||
/* just like tr_torrentSetFileDLs but doesn't trigger a fastresume save */
|
||||
void tr_torrentInitFileDLs( tr_torrent * tor,
|
||||
tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool do_download );
|
||||
void tr_torrentInitFileDLs( tr_torrent * tor,
|
||||
const tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool do_download );
|
||||
|
||||
void tr_torrentRecheckCompleteness( tr_torrent * );
|
||||
|
||||
|
|
|
@ -1184,10 +1184,10 @@ enum
|
|||
*
|
||||
* @param priority must be one of TR_PRI_NORMAL, _HIGH, or _LOW
|
||||
*/
|
||||
void tr_torrentSetFilePriorities( tr_torrent * torrent,
|
||||
tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_priority_t priority );
|
||||
void tr_torrentSetFilePriorities( tr_torrent * torrent,
|
||||
const tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_priority_t priority );
|
||||
|
||||
/**
|
||||
* @brief Get this torrent's file priorities.
|
||||
|
@ -1199,10 +1199,10 @@ void tr_torrentSetFilePriorities( tr_torrent * torrent,
|
|||
tr_priority_t* tr_torrentGetFilePriorities( const tr_torrent * torrent );
|
||||
|
||||
/** @brief Set a batch of files to be downloaded or not. */
|
||||
void tr_torrentSetFileDLs( tr_torrent * torrent,
|
||||
tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool do_download );
|
||||
void tr_torrentSetFileDLs( tr_torrent * torrent,
|
||||
const tr_file_index_t * files,
|
||||
tr_file_index_t fileCount,
|
||||
tr_bool do_download );
|
||||
|
||||
|
||||
const tr_info * tr_torrentInfo( const tr_torrent * torrent );
|
||||
|
|
Loading…
Reference in a new issue