diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index fc9725a24..67a47739e 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -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 ); diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index a0cb213fb..03389a006 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -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 * ); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 091b19175..98130e10b 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -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 );