Ignore:
Timestamp:
Jul 16, 2010, 3:12:57 AM (12 years ago)
Author:
livings124
Message:

First go at #2560 "inactive seeding time limit". libtransmission and Mac support are currently implemented.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.h

    r10999 r11013  
    171171#define TR_PREFS_KEY_DOWNLOAD_DIR                  "download-dir"
    172172#define TR_PREFS_KEY_ENCRYPTION                    "encryption"
     173#define TR_PREFS_KEY_INACTIVE_LIMIT                "inactive-limit"
     174#define TR_PREFS_KEY_INACTIVE_LIMIT_ENABLED        "inactive-limit-enabled"
    173175#define TR_PREFS_KEY_INCOMPLETE_DIR                "incomplete-dir"
    174176#define TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED        "incomplete-dir-enabled"
     
    724726double     tr_sessionGetRatioLimit    ( const tr_session * );
    725727
     728void       tr_sessionSetInactivityLimited  ( tr_session *, tr_bool isLimited );
     729tr_bool    tr_sessionIsInactivityLimited   ( const tr_session * );
     730
     731void       tr_sessionSetInactiveLimit      ( tr_session *, uint64_t inactivityMinutes );
     732uint64_t   tr_sessionGetInactiveLimit      ( const tr_session * );
     733
    726734void       tr_sessionSetPeerLimit( tr_session *, uint16_t maxGlobalPeers );
    727735uint16_t   tr_sessionGetPeerLimit( const tr_session * );
     
    11601168tr_bool       tr_torrentGetSeedRatio( const tr_torrent *, double * ratio );
    11611169
     1170
     1171/****
     1172*****  Inactive Time Limits
     1173****/
     1174
     1175typedef enum
     1176{
     1177    TR_INACTIVELIMIT_GLOBAL    = 0, /* follow the global settings */
     1178    TR_INACTIVELIMIT_SINGLE    = 1, /* override the global settings, seeding until a certain inactive time */
     1179    TR_INACTIVELIMIT_UNLIMITED = 2  /* override the global settings, seeding regardless of activity */
     1180}
     1181tr_inactvelimit;
     1182
     1183void          tr_torrentSetInactiveMode( tr_torrent         * tor,
     1184                                         tr_inactvelimit      mode );
     1185
     1186tr_ratiolimit tr_torrentGetInactiveMode( const tr_torrent   * tor );
     1187
     1188void          tr_torrentSetInactiveLimit( tr_torrent        * tor,
     1189                                          uint64_t            inactiveMinutes );
     1190
     1191uint64_t      tr_torrentGetInactiveLimit( const tr_torrent  * tor );
     1192
     1193
     1194tr_bool       tr_torrentGetSeedInactive( const tr_torrent *, uint64_t * inactiveMinutes );
     1195
    11621196/****
    11631197*****  Peer Limits
     
    12891323                                                  void         * user_data );
    12901324
     1325typedef void ( tr_torrent_inactive_limit_hit_func )( tr_torrent   * torrent,
     1326                                                    void         * user_data );
     1327
     1328
    12911329/**
    12921330 * Register to be notified whenever a torrent's "completeness"
     
    13371375
    13381376void tr_torrentClearRatioLimitHitCallback( tr_torrent * torrent );
     1377
     1378/**
     1379 * Register to be notified whenever a torrent's inactivity limit
     1380 * has been hit. This will be called when the seeding torrent's
     1381 * idle time has met or exceeded the designated inactivity limit.
     1382 *
     1383 * Has the same restrictions as tr_torrentSetCompletenessCallback
     1384 */
     1385void tr_torrentSetInactivityLimitHitCallback(
     1386     tr_torrent                          * torrent,
     1387     tr_torrent_inactive_limit_hit_func  func,
     1388     void                                * user_data );
     1389
     1390void tr_torrentClearInactiveLimitHitCallback( tr_torrent * torrent );
    13391391
    13401392
     
    18471899        -1 if activity is not seeding or downloading. */
    18481900    int    idleSecs;
    1849    
     1901
    18501902    /** A torrent is considered finished if it has met its seed ratio.
    18511903        As a result, only paused torrents can be finished. */
Note: See TracChangeset for help on using the changeset viewer.