Changeset 7368
- Timestamp:
- Dec 13, 2008, 11:39:12 PM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/rpc-server.c
r7367 r7368 540 540 void 541 541 tr_rpcSetEnabled( tr_rpc_server * server, 542 intisEnabled )543 { 544 server->isEnabled = isEnabled != 0;542 tr_bool isEnabled ) 543 { 544 server->isEnabled = isEnabled; 545 545 546 546 tr_runInEventThread( server->session, onEnabledChanged, server ); 547 547 } 548 548 549 int 549 tr_bool 550 550 tr_rpcIsEnabled( const tr_rpc_server * server ) 551 551 { … … 600 600 void 601 601 tr_rpcSetWhitelistEnabled( tr_rpc_server * server, 602 intisEnabled )602 tr_bool isEnabled ) 603 603 { 604 604 server->isWhitelistEnabled = isEnabled != 0; 605 605 } 606 606 607 int 607 tr_bool 608 608 tr_rpcGetWhitelistEnabled( const tr_rpc_server * server ) 609 609 { … … 647 647 void 648 648 tr_rpcSetPasswordEnabled( tr_rpc_server * server, 649 intisEnabled )650 { 651 server->isPasswordEnabled = isEnabled != 0;652 dbgmsg( "setting 'password enabled' to %d", isEnabled );653 } 654 655 int 649 tr_bool isEnabled ) 650 { 651 server->isPasswordEnabled = isEnabled; 652 dbgmsg( "setting 'password enabled' to %d", (int)isEnabled ); 653 } 654 655 tr_bool 656 656 tr_rpcIsPasswordEnabled( const tr_rpc_server * server ) 657 657 { … … 683 683 684 684 tr_rpc_server * 685 tr_rpcInit( tr_handle *session,686 intisEnabled,685 tr_rpcInit( tr_handle * session, 686 tr_bool isEnabled, 687 687 tr_port port, 688 intisWhitelistEnabled,688 tr_bool isWhitelistEnabled, 689 689 const char * whitelist, 690 intisPasswordEnabled,690 tr_bool isPasswordEnabled, 691 691 const char * username, 692 692 const char * password ) -
trunk/libtransmission/rpc-server.h
r7224 r7368 21 21 22 22 tr_rpc_server * tr_rpcInit( struct tr_handle * session, 23 intisEnabled,23 tr_bool isEnabled, 24 24 tr_port port, 25 intisWhitelistEnabled,26 const char *whitelist,27 intisPasswordEnabled,28 const char *username,29 const char *password );25 tr_bool isWhitelistEnabled, 26 const char * whitelist, 27 tr_bool isPasswordEnabled, 28 const char * username, 29 const char * password ); 30 30 31 31 void tr_rpcClose( tr_rpc_server ** freeme ); 32 32 33 33 void tr_rpcSetEnabled( tr_rpc_server * server, 34 intisEnabled );34 tr_bool isEnabled ); 35 35 36 inttr_rpcIsEnabled( const tr_rpc_server * server );36 tr_bool tr_rpcIsEnabled( const tr_rpc_server * server ); 37 37 38 38 void tr_rpcSetPort( tr_rpc_server * server, … … 41 41 tr_port tr_rpcGetPort( const tr_rpc_server * server ); 42 42 43 int tr_rpcSetTest( const tr_rpc_server * server,44 const char *whitelist,45 char **allocme_errmsg );43 int tr_rpcSetTest( const tr_rpc_server * server, 44 const char * whitelist, 45 char ** allocme_errmsg ); 46 46 47 47 void tr_rpcSetWhitelistEnabled( tr_rpc_server * server, 48 intisEnabled );48 tr_bool isEnabled ); 49 49 50 inttr_rpcGetWhitelistEnabled( const tr_rpc_server * server );50 tr_bool tr_rpcGetWhitelistEnabled( const tr_rpc_server * server ); 51 51 52 52 void tr_rpcSetWhitelist( tr_rpc_server * server, … … 66 66 67 67 void tr_rpcSetPasswordEnabled( tr_rpc_server * server, 68 intisEnabled );68 tr_bool isEnabled ); 69 69 70 inttr_rpcIsPasswordEnabled( const tr_rpc_server * session );70 tr_bool tr_rpcIsPasswordEnabled( const tr_rpc_server * session ); 71 71 72 72 -
trunk/libtransmission/session.c
r7367 r7368 1188 1188 void 1189 1189 tr_sessionSetRPCEnabled( tr_session * session, 1190 intisEnabled )1190 tr_bool isEnabled ) 1191 1191 { 1192 1192 tr_rpcSetEnabled( session->rpcServer, isEnabled ); 1193 1193 } 1194 1194 1195 int 1195 tr_bool 1196 1196 tr_sessionIsRPCEnabled( const tr_session * session ) 1197 1197 { … … 1236 1236 void 1237 1237 tr_sessionSetRPCWhitelistEnabled( tr_session * session, 1238 intisEnabled )1238 tr_bool isEnabled ) 1239 1239 { 1240 1240 tr_rpcSetWhitelistEnabled( session->rpcServer, isEnabled ); … … 1276 1276 void 1277 1277 tr_sessionSetRPCPasswordEnabled( tr_session * session, 1278 intisEnabled )1278 tr_bool isEnabled ) 1279 1279 { 1280 1280 tr_rpcSetPasswordEnabled( session->rpcServer, isEnabled ); -
trunk/libtransmission/torrent.c
r7367 r7368 86 86 } 87 87 88 int 88 tr_bool 89 89 tr_torrentExists( const tr_handle * handle, 90 90 const uint8_t * torrentHash ) … … 182 182 } 183 183 184 int 184 tr_bool 185 185 tr_torrentIsPieceTransferAllowed( const tr_torrent * tor, 186 186 tr_direction direction ) 187 187 { 188 intisEnabled = FALSE;188 tr_bool isEnabled = FALSE; 189 189 190 190 switch( tr_torrentGetSpeedMode( tor, direction ) ) … … 686 686 } 687 687 688 int 688 tr_bool 689 689 tr_torrentIsPrivate( const tr_torrent * tor ) 690 690 { 691 691 return tor 692 693 } 694 695 int 692 && tor->info.isPrivate; 693 } 694 695 tr_bool 696 696 tr_torrentAllowsPex( const tr_torrent * tor ) 697 697 { 698 698 return tor 699 700 699 && tor->session->isPexEnabled 700 && !tr_torrentIsPrivate( tor ); 701 701 } 702 702 … … 1026 1026 tr_torrentSetHasPiece( tr_torrent * tor, 1027 1027 tr_piece_index_t pieceIndex, 1028 inthas )1028 tr_bool has ) 1029 1029 { 1030 1030 tr_torrentLock( tor ); … … 1356 1356 } 1357 1357 1358 int 1358 tr_bool 1359 1359 tr_torrentIsSeed( const tr_torrent * tor ) 1360 1360 { … … 1512 1512 tr_file_index_t * files, 1513 1513 tr_file_index_t fileCount, 1514 intdoDownload )1514 tr_bool doDownload ) 1515 1515 { 1516 1516 tr_file_index_t i; … … 1529 1529 tr_file_index_t * files, 1530 1530 tr_file_index_t fileCount, 1531 intdoDownload )1531 tr_bool doDownload ) 1532 1532 { 1533 1533 tr_torrentLock( tor ); … … 1572 1572 } 1573 1573 1574 int 1574 tr_bool 1575 1575 tr_torrentReqIsValid( const tr_torrent * tor, 1576 1576 tr_piece_index_t index, … … 1618 1618 ***/ 1619 1619 1620 int 1620 tr_bool 1621 1621 tr_torrentIsPieceChecked( const tr_torrent * tor, 1622 1622 tr_piece_index_t piece ) … … 1626 1626 1627 1627 void 1628 tr_torrentSetPieceChecked( tr_torrent *tor,1629 tr_piece_index_t piece,1630 intisChecked )1628 tr_torrentSetPieceChecked( tr_torrent * tor, 1629 tr_piece_index_t piece, 1630 tr_bool isChecked ) 1631 1631 { 1632 1632 if( isChecked ) … … 1639 1639 tr_torrentSetFileChecked( tr_torrent * tor, 1640 1640 tr_file_index_t fileIndex, 1641 intisChecked )1641 tr_bool isChecked ) 1642 1642 { 1643 1643 const tr_file * file = &tor->info.files[fileIndex]; … … 1651 1651 } 1652 1652 1653 int 1653 tr_bool 1654 1654 tr_torrentIsFileChecked( const tr_torrent * tor, 1655 1655 tr_file_index_t fileIndex ) … … 1659 1659 const tr_piece_index_t end = file->lastPiece + 1; 1660 1660 tr_piece_index_t i; 1661 intisChecked = TRUE;1661 tr_bool isChecked = TRUE; 1662 1662 1663 1663 for( i = begin; isChecked && i < end; ++i ) -
trunk/libtransmission/torrent.h
r7266 r7368 50 50 tr_file_index_t * files, 51 51 tr_file_index_t fileCount, 52 intdo_download );53 54 inttr_torrentIsPrivate( const tr_torrent * );52 tr_bool do_download ); 53 54 tr_bool tr_torrentIsPrivate( const tr_torrent * ); 55 55 56 56 void tr_torrentRecheckCompleteness( tr_torrent * ); … … 60 60 void tr_torrentSetHasPiece( tr_torrent * tor, 61 61 tr_piece_index_t pieceIndex, 62 inthas );62 tr_bool has ); 63 63 64 64 void tr_torrentLock( const tr_torrent * session ); … … 66 66 void tr_torrentUnlock( const tr_torrent * session ); 67 67 68 inttr_torrentIsSeed( const tr_torrent * session );68 tr_bool tr_torrentIsSeed( const tr_torrent * session ); 69 69 70 70 void tr_torrentChangeMyPort( tr_torrent * session ); 71 71 72 inttr_torrentExists( const tr_session * session,72 tr_bool tr_torrentExists( const tr_session * session, 73 73 const uint8_t * hash ); 74 74 … … 85 85 const uint8_t * hash ); 86 86 87 inttr_torrentAllowsPex( const tr_torrent * );88 89 inttr_torrentIsPieceTransferAllowed( const tr_torrent * torrent,87 tr_bool tr_torrentAllowsPex( const tr_torrent * ); 88 89 tr_bool tr_torrentIsPieceTransferAllowed( const tr_torrent * torrent, 90 90 tr_direction direction ); 91 91 … … 121 121 uint32_t offset ); 122 122 123 inttr_torrentReqIsValid( const tr_torrent * tor,123 tr_bool tr_torrentReqIsValid( const tr_torrent * tor, 124 124 tr_piece_index_t index, 125 125 uint32_t offset, … … 138 138 int tr_torrentCountUncheckedPieces( const tr_torrent * ); 139 139 140 inttr_torrentIsPieceChecked( const tr_torrent * tor,140 tr_bool tr_torrentIsPieceChecked( const tr_torrent * tor, 141 141 tr_piece_index_t piece ); 142 142 143 inttr_torrentIsFileChecked( const tr_torrent * tor,143 tr_bool tr_torrentIsFileChecked( const tr_torrent * tor, 144 144 tr_file_index_t file ); 145 145 146 146 void tr_torrentSetPieceChecked( tr_torrent * tor, 147 147 tr_piece_index_t piece, 148 intisChecked );148 tr_bool isChecked ); 149 149 150 150 void tr_torrentSetFileChecked( tr_torrent * tor, 151 151 tr_file_index_t file, 152 intisChecked );152 tr_bool isChecked ); 153 153 154 154 void tr_torrentUncheck( tr_torrent * tor ); -
trunk/libtransmission/transmission.h
r7367 r7368 290 290 */ 291 291 void tr_sessionSetRPCEnabled( tr_session * session, 292 intisEnabled );292 tr_bool isEnabled ); 293 293 294 294 /** @brief Get whether or not RPC calls are allowed in this session. 295 295 @see tr_sessionInit() 296 296 @see tr_sessionSetRPCEnabled() */ 297 inttr_sessionIsRPCEnabled( const tr_session * session );297 tr_bool tr_sessionIsRPCEnabled( const tr_session * session ); 298 298 299 299 /** @brief Specify which port to listen for RPC requests on. … … 326 326 327 327 void tr_sessionSetRPCWhitelistEnabled( tr_session * session, 328 intisEnabled );328 tr_bool isEnabled ); 329 329 330 330 tr_bool tr_sessionGetRPCWhitelistEnabled( const tr_session * session ); … … 345 345 346 346 void tr_sessionSetRPCPasswordEnabled( tr_session * session, 347 intisEnabled );347 tr_bool isEnabled ); 348 348 349 349 tr_bool tr_sessionIsRPCPasswordEnabled( const tr_session * session ); … … 901 901 tr_file_index_t * files, 902 902 tr_file_index_t fileCount, 903 intdo_download );903 tr_bool do_download ); 904 904 905 905
Note: See TracChangeset
for help on using the changeset viewer.