Changeset 7021
- Timestamp:
- Nov 2, 2008, 10:21:59 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/transmission.h
r6949 r7021 250 250 * @see tr_sessionClose() 251 251 */ 252 tr_ handle* tr_sessionInitFull( const char * configDir,253 const char * tag,254 const char * downloadDir,255 int isPexEnabled,256 int isPortForwardingEnabled,257 int publicPort,258 tr_encryption_mode encryptionMode,259 int useLazyBitfield,260 int useUploadLimit,261 int uploadLimit,262 int useDownloadLimit,263 int downloadLimit,264 int peerLimit,265 int messageLevel,266 int isMessageQueueingEnabled,267 int isBlocklistEnabled,268 int peerSocketTOS,269 int rpcIsEnabled,270 uint16_t rpcPort,271 int rpcWhitelistIsEnabled,272 const char * rpcWhitelist,273 int rpcPasswordIsEnabled,274 const char * rpcUsername,275 const char * rpcPassword,276 int proxyIsEnabled,277 const char * proxy,278 int proxyPort,279 tr_proxy_type proxyType,280 int proxyAuthIsEnabled,281 const char * proxyUsername,282 const char * proxyPassword );252 tr_session * tr_sessionInitFull( const char * configDir, 253 const char * tag, 254 const char * downloadDir, 255 int isPexEnabled, 256 int isPortForwardingEnabled, 257 int publicPort, 258 tr_encryption_mode encryptionMode, 259 int useLazyBitfield, 260 int useUploadLimit, 261 int uploadLimit, 262 int useDownloadLimit, 263 int downloadLimit, 264 int peerLimit, 265 int messageLevel, 266 int isMessageQueueingEnabled, 267 int isBlocklistEnabled, 268 int peerSocketTOS, 269 int rpcIsEnabled, 270 uint16_t rpcPort, 271 int rpcWhitelistIsEnabled, 272 const char * rpcWhitelist, 273 int rpcPasswordIsEnabled, 274 const char * rpcUsername, 275 const char * rpcPassword, 276 int proxyIsEnabled, 277 const char * proxy, 278 int proxyPort, 279 tr_proxy_type proxyType, 280 int proxyAuthIsEnabled, 281 const char * proxyUsername, 282 const char * proxyPassword ); 283 283 284 284 285 285 /** @brief Shorter form of tr_sessionInitFull() 286 286 @deprecated Use tr_sessionInitFull() instead. */ 287 tr_ handle* tr_sessionInit( const char * configDir,288 const char * downloadDir,289 const char * tag );287 tr_session * tr_sessionInit( const char * configDir, 288 const char * downloadDir, 289 const char * tag ); 290 290 291 291 /** @brief End a libtransmission session 292 292 @see tr_sessionInitFull() */ 293 void tr_sessionClose( tr_ handle* );293 void tr_sessionClose( tr_session * ); 294 294 295 295 /** … … 299 299 * blocklists, etc. 300 300 */ 301 const char * tr_sessionGetConfigDir( const tr_ handle* );301 const char * tr_sessionGetConfigDir( const tr_session * ); 302 302 303 303 /** … … 307 307 * @see tr_ctorSetDownloadDir() 308 308 */ 309 void tr_sessionSetDownloadDir( 310 tr_handle *, 311 const char * 312 downloadDir ); 309 void tr_sessionSetDownloadDir( tr_session * session, 310 const char * downloadDir ); 313 311 314 312 /** … … 318 316 * and can be overridden on a per-torrent basis by tr_ctorSetDownloadDir(). 319 317 */ 320 const char * tr_sessionGetDownloadDir( const tr_ handle *);318 const char * tr_sessionGetDownloadDir( const tr_session * session ); 321 319 322 320 /** … … 329 327 * queried by tr_sessionIsRPCEnabled(). 330 328 */ 331 void tr_sessionSetRPCEnabled( tr_handle *,332 intisEnabled );329 void tr_sessionSetRPCEnabled( tr_session * session, 330 int isEnabled ); 333 331 334 332 /** @brief Get whether or not RPC calls are allowed in this session. 335 333 @see tr_sessionInitFull() 336 334 @see tr_sessionSetRPCEnabled() */ 337 int tr_sessionIsRPCEnabled( const tr_ handle * handle);335 int tr_sessionIsRPCEnabled( const tr_session * session ); 338 336 339 337 /** @brief Specify which port to listen for RPC requests on. 340 338 @see tr_sessionInitFull() 341 339 @see tr_sessionGetRPCPort */ 342 void tr_sessionSetRPCPort( tr_ handle* session,343 uint16_t port );340 void tr_sessionSetRPCPort( tr_session * session, 341 uint16_t port ); 344 342 345 343 /** @brief Get which port to listen for RPC requests on. 346 344 @see tr_sessionInitFull() 347 345 @see tr_sessionSetRPCPort */ 348 uint16_t tr_sessionGetRPCPort( const tr_ handle *);346 uint16_t tr_sessionGetRPCPort( const tr_session * session ); 349 347 350 348 /** … … 507 505 * In public torrents, PEX is enabled by default. 508 506 */ 509 void tr_sessionSetPexEnabled( tr_session *, 510 int isEnabled ); 511 512 int tr_sessionIsPexEnabled( const tr_session * ); 513 514 void tr_sessionSetLazyBitfieldEnabled( tr_handle * handle, 515 int enabled ); 516 517 int tr_sessionIsLazyBitfieldEnabled( 518 const tr_handle * handle ); 519 520 tr_encryption_mode tr_sessionGetEncryption( tr_session * ); 521 522 void tr_sessionSetEncryption( 523 tr_session *, 524 tr_encryption_mode mode ); 507 void tr_sessionSetPexEnabled( tr_session * session, 508 int isEnabled ); 509 510 int tr_sessionIsPexEnabled( const tr_session * session ); 511 512 void tr_sessionSetLazyBitfieldEnabled( tr_session * session, 513 int enabled ); 514 515 int tr_sessionIsLazyBitfieldEnabled( const tr_session * session ); 516 517 tr_encryption_mode tr_sessionGetEncryption( tr_session * session ); 518 519 void tr_sessionSetEncryption( tr_session * session, 520 tr_encryption_mode mode ); 525 521 526 522 … … 529 525 */ 530 526 531 void tr_sessionSetPortForwardingEnabled( 532 tr_handle *, 533 int enable ); 534 535 int tr_sessionIsPortForwardingEnabled( const tr_handle * ); 536 537 void tr_sessionSetPeerPort( tr_handle *, 538 int ); 539 540 int tr_sessionGetPeerPort( const tr_handle * ); 527 void tr_sessionSetPortForwardingEnabled( tr_session * session, 528 int enabled ); 529 530 int tr_sessionIsPortForwardingEnabled( const tr_session * session ); 531 532 void tr_sessionSetPeerPort( tr_session * session, 533 int port); 534 535 int tr_sessionGetPeerPort( const tr_session * session ); 541 536 542 537 typedef enum … … 550 545 tr_port_forwarding; 551 546 552 tr_port_forwarding tr_sessionGetPortForwarding( const tr_ handle *);553 554 int tr_sessionCountTorrents( const tr_ handle * h);547 tr_port_forwarding tr_sessionGetPortForwarding( const tr_session * session ); 548 549 int tr_sessionCountTorrents( const tr_session * session ); 555 550 556 551 typedef enum … … 561 556 tr_direction; 562 557 563 void tr_sessionSetSpeedLimitEnabled( tr_handle * session, 564 tr_direction direction, 565 int isEnabled ); 566 567 void tr_sessionGetSpeed( const tr_handle * session, 568 float * overall_down_KiBs, 569 float * overall_up_KiBs ); 570 571 int tr_sessionIsSpeedLimitEnabled( 572 const tr_handle * session, 573 tr_direction 574 direction ); 575 576 void tr_sessionSetSpeedLimit( tr_handle * session, 577 tr_direction direction, 578 int KiB_sec ); 579 580 int tr_sessionGetSpeedLimit( const tr_handle * session, 581 tr_direction direction ); 582 583 void tr_sessionSetPeerLimit( tr_handle * handle, 584 uint16_t maxGlobalPeers ); 585 586 uint16_t tr_sessionGetPeerLimit( const tr_handle * handle ); 558 void tr_sessionSetSpeedLimitEnabled( tr_session * session, 559 tr_direction direction, 560 int isEnabled ); 561 562 void tr_sessionGetSpeed( const tr_session * session, 563 float * overall_down_KiBs, 564 float * overall_up_KiBs ); 565 566 int tr_sessionIsSpeedLimitEnabled( const tr_session * session, 567 tr_direction direction ); 568 569 void tr_sessionSetSpeedLimit( tr_session * session, 570 tr_direction direction, 571 int KiB_sec ); 572 573 int tr_sessionGetSpeedLimit( const tr_session * session, 574 tr_direction direction ); 575 576 void tr_sessionSetPeerLimit( tr_session * session, 577 uint16_t maxGlobalPeers ); 578 579 uint16_t tr_sessionGetPeerLimit( const tr_session * session ); 587 580 588 581 … … 592 585 * from the previous session. 593 586 */ 594 tr_torrent ** tr_sessionLoadTorrents( tr_handle * h, 595 tr_ctor * ctor, 596 int * setmeCount ); 597 587 tr_torrent ** tr_sessionLoadTorrents( tr_session * session, 588 tr_ctor * ctor, 589 int * setmeCount ); 598 590 599 591 /** @} */ 600 601 592 602 593 /** … … 622 613 { 623 614 /* TR_MSG_ERR, TR_MSG_INF, or TR_MSG_DBG */ 624 uint8_t 615 uint8_t level; 625 616 626 617 /* The line number in the source file where this message originated */ 627 int 618 int line; 628 619 629 620 /* Time the message was generated */ 630 time_t 621 time_t when; 631 622 632 623 /* The torrent associated with this message, … … 639 630 640 631 /* The source file where this message originated */ 641 const char * 632 const char * file; 642 633 643 634 /* linked list of messages */ … … 728 719 struct tr_benc; 729 720 730 tr_ctor* tr_ctorNew( const tr_ handle * handle);721 tr_ctor* tr_ctorNew( const tr_session * session ); 731 722 732 723 void tr_ctorFree( tr_ctor * ctor ); … … 772 763 uint8_t * setmeIsPaused ); 773 764 774 int tr_ctorGetDownloadDir( const tr_ctor * ctor,775 tr_ctorMode mode,776 const char **setmeDownloadDir );777 778 int tr_ctorGetMetainfo( const tr_ctor *ctor,765 int tr_ctorGetDownloadDir( const tr_ctor * ctor, 766 tr_ctorMode mode, 767 const char ** setmeDownloadDir ); 768 769 int tr_ctorGetMetainfo( const tr_ctor * ctor, 779 770 const struct tr_benc ** setme ); 780 771 781 int tr_ctorGetDeleteSource( const tr_ctor * ctor,782 uint8_t *setmeDoDelete );772 int tr_ctorGetDeleteSource( const tr_ctor * ctor, 773 uint8_t * setmeDoDelete ); 783 774 784 775 /* returns NULL if tr_ctorSetMetainfoFromFile() wasn't used */ … … 800 791 * caller via tr_metainfoFree(). 801 792 */ 802 int tr_torrentParse( const tr_handle * handle,803 const tr_ctor *ctor,804 tr_info *setme_info_or_NULL );793 int tr_torrentParse( const tr_session * session, 794 const tr_ctor * ctor, 795 tr_info * setme_info_or_NULL ); 805 796 806 797 /** Instantiate a single torrent. … … 808 799 TR_EINVALID if the torrent couldn't be parsed, or 809 800 TR_EDUPLICATE if there's already a matching torrent object. */ 810 tr_torrent * tr_torrentNew( tr_ handle * handle,811 const tr_ctor * ctor,812 int *setmeError );801 tr_torrent * tr_torrentNew( tr_session * session, 802 const tr_ctor * ctor, 803 int * setmeError ); 813 804 814 805 /** @} */ … … 824 815 /** @brief Frees memory allocated by tr_torrentNew(). 825 816 Running torrents are stopped first. */ 826 void tr_torrentFree( tr_torrent *);817 void tr_torrentFree( tr_torrent * torrent ); 827 818 828 819 /** @brief Removes our .torrent and .resume files for 829 820 this torrent, then calls tr_torrentFree(). */ 830 void tr_torrentRemove( tr_torrent *);821 void tr_torrentRemove( tr_torrent * torrent ); 831 822 832 823 /** @brief Start a torrent */ 833 void tr_torrentStart( tr_torrent *);824 void tr_torrentStart( tr_torrent * torrent ); 834 825 835 826 /** @brief Stop (pause) a torrent */ 836 void tr_torrentStop( tr_torrent *);827 void tr_torrentStop( tr_torrent * torrent ); 837 828 838 829 /** … … 841 832 * Pass in a NULL pointer to get the first torrent. 842 833 */ 843 tr_torrent* tr_torrentNext( tr_ handle* session,844 tr_torrent *);834 tr_torrent* tr_torrentNext( tr_session * session, 835 tr_torrent * current ); 845 836 846 837 /** … … 851 842 * tr_info.hashString. 852 843 */ 853 int tr_torrentId( const tr_torrent *);844 int tr_torrentId( const tr_torrent * torrent ); 854 845 855 846 /**** … … 865 856 tr_speedlimit; 866 857 867 void tr_torrentSetSpeedMode( tr_torrent *tor,868 tr_direction up_or_down,869 tr_speedlimit mode );858 void tr_torrentSetSpeedMode( tr_torrent * tor, 859 tr_direction up_or_down, 860 tr_speedlimit mode ); 870 861 871 862 tr_speedlimit tr_torrentGetSpeedMode( const tr_torrent * tor, 872 863 tr_direction direction ); 873 864 874 void tr_torrentSetSpeedLimit( tr_torrent * tor,875 tr_direction up_or_down,876 int KiB_sec );877 878 int tr_torrentGetSpeedLimit( const tr_torrent * tor,879 tr_direction direction );865 void tr_torrentSetSpeedLimit( tr_torrent * tor, 866 tr_direction up_or_down, 867 int KiB_sec ); 868 869 int tr_torrentGetSpeedLimit( const tr_torrent * tor, 870 tr_direction direction ); 880 871 881 872 /**** … … 906 897 * @param priority must be one of TR_PRI_NORMAL, _HIGH, or _LOW 907 898 */ 908 void tr_torrentSetFilePriorities( tr_torrent * tor,909 tr_file_index_t * files,910 tr_file_index_t fileCount,911 tr_priority_t priority );899 void tr_torrentSetFilePriorities( tr_torrent * torrent, 900 tr_file_index_t * files, 901 tr_file_index_t fileCount, 902 tr_priority_t priority ); 912 903 913 904 /** … … 918 909 * It's the caller's responsibility to free() this. 919 910 */ 920 tr_priority_t* tr_torrentGetFilePriorities( const tr_torrent * );911 tr_priority_t* tr_torrentGetFilePriorities( const tr_torrent * torrent ); 921 912 922 913 /** … … 924 915 * @return TR_PRI_NORMAL, TR_PRI_HIGH, or TR_PRI_LOW. 925 916 */ 926 tr_priority_t tr_torrentGetFilePriority( const tr_torrent *,927 tr_file_index_t file );917 tr_priority_t tr_torrentGetFilePriority( const tr_torrent * torrent, 918 tr_file_index_t file ); 928 919 929 920 /** … … 931 922 * @return true if the file's `download' flag is set. 932 923 */ 933 int tr_torrentGetFileDL( const tr_torrent *,934 tr_file_index_tfile );924 int tr_torrentGetFileDL( const tr_torrent * torrent, 925 tr_file_index_t file ); 935 926 936 927 /** @brief Set a batch of files to be downloaded or not. */ 937 void tr_torrentSetFileDLs( tr_torrent * tor,938 tr_file_index_t * files,939 tr_file_index_t fileCount,940 int do_download );941 942 943 const tr_info * tr_torrentInfo( const tr_torrent * );944 945 void tr_torrentSetDownloadDir( tr_torrent *,946 const char *);947 948 const char * tr_torrentGetDownloadDir( const tr_torrent *);928 void tr_torrentSetFileDLs( tr_torrent * torrent, 929 tr_file_index_t * files, 930 tr_file_index_t fileCount, 931 int do_download ); 932 933 934 const tr_info * tr_torrentInfo( const tr_torrent * torrent ); 935 936 void tr_torrentSetDownloadDir( tr_torrent * torrent, 937 const char * path ); 938 939 const char * tr_torrentGetDownloadDir( const tr_torrent * torrent ); 949 940 950 941 /** … … 1027 1018 */ 1028 1019 1029 void tr_torrentManualUpdate( tr_torrent * );1030 1031 int tr_torrentCanManualUpdate( const tr_torrent * );1020 void tr_torrentManualUpdate( tr_torrent * torrent ); 1021 1022 int tr_torrentCanManualUpdate( const tr_torrent * torrent ); 1032 1023 1033 1024 /*********************************************************************** … … 1076 1067 * NOTE: always free this array with tr_free() when you're done with it. 1077 1068 */ 1078 float* tr_torrentWebSpeeds( const tr_torrent * tor );1069 float* tr_torrentWebSpeeds( const tr_torrent * torrent ); 1079 1070 1080 1071 typedef struct tr_file_stat … … 1085 1076 tr_file_stat; 1086 1077 1087 tr_file_stat * tr_torrentFiles( const tr_torrent * tor,1088 tr_file_index_t *fileCount );1089 1090 void tr_torrentFilesFree( tr_file_stat * stat,1091 tr_file_index_tfileCount );1078 tr_file_stat * tr_torrentFiles( const tr_torrent * torrent, 1079 tr_file_index_t * fileCount ); 1080 1081 void tr_torrentFilesFree( tr_file_stat * files, 1082 tr_file_index_t fileCount ); 1092 1083 1093 1084 … … 1100 1091 * of connected peers who have the piece. 1101 1092 **********************************************************************/ 1102 void tr_torrentAvailability( const tr_torrent *,1103 int8_t * tab,1104 int size );1105 1106 void tr_torrentAmountFinished( const tr_torrent * tor,1107 float * tab,1108 int size );1109 1110 void tr_torrentVerify( tr_torrent * );1093 void tr_torrentAvailability( const tr_torrent * torrent, 1094 int8_t * tab, 1095 int size ); 1096 1097 void tr_torrentAmountFinished( const tr_torrent * torrent, 1098 float * tab, 1099 int size ); 1100 1101 void tr_torrentVerify( tr_torrent * torrent ); 1111 1102 1112 1103 /*********************************************************************** … … 1403 1394 on the torrent. This is typically called by the GUI clients every 1404 1395 second or so to get a new snapshot of the torrent's status. */ 1405 const tr_stat * tr_torrentStat( tr_torrent * );1396 const tr_stat * tr_torrentStat( tr_torrent * torrent ); 1406 1397 1407 1398 /** Like tr_torrentStat(), but only recalculates the statistics if it's 1408 1399 been longer than a second since they were last calculated. This can 1409 1400 reduce the CPU load if you're calling tr_torrentStat() frequently. */ 1410 const tr_stat * tr_torrentStatCached( tr_torrent * );1401 const tr_stat * tr_torrentStatCached( tr_torrent * torrent ); 1411 1402 1412 1403 /** @deprecated this method will be removed in 1.40 */ 1413 void tr_torrentSetAddedDate( tr_torrent *,1414 time_t);1404 void tr_torrentSetAddedDate( tr_torrent * torrent, 1405 time_t addedDate ); 1415 1406 1416 1407 /** @deprecated this method will be removed in 1.40 */ 1417 void tr_torrentSetActivityDate( tr_torrent *,1418 time_t);1408 void tr_torrentSetActivityDate( tr_torrent * torrent, 1409 time_t activityDate ); 1419 1410 1420 1411 /** @deprecated this method will be removed in 1.40 */ 1421 void tr_torrentSetDoneDate( tr_torrent *,1422 time_t);1412 void tr_torrentSetDoneDate( tr_torrent * torrent, 1413 time_t doneDate ); 1423 1414 1424 1415 /** @} */
Note: See TracChangeset
for help on using the changeset viewer.