Changeset 12200


Ignore:
Timestamp:
Mar 21, 2011, 5:08:10 PM (11 years ago)
Author:
jordan
Message:

(trunk libt) more transmission.h copyediting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.h

    r12198 r12200  
    608608
    609609void  tr_sessionSetPeerPortRandomOnStart( tr_session * session,
    610                                           tr_bool random );
     610                                          tr_bool      random );
    611611
    612612tr_bool  tr_sessionGetPeerPortRandomOnStart( tr_session * session );
     
    639639***/
    640640
    641 void tr_sessionSetSpeedLimit_KBps( tr_session *, tr_direction, int KBps );
    642 int tr_sessionGetSpeedLimit_KBps( const tr_session *, tr_direction );
     641void     tr_sessionSetSpeedLimit_KBps ( tr_session *, tr_direction, int KBps );
     642int      tr_sessionGetSpeedLimit_KBps ( const tr_session *, tr_direction );
    643643
    644644void     tr_sessionLimitSpeed         ( tr_session *, tr_direction, tr_bool );
     
    650650***/
    651651
    652 void tr_sessionSetAltSpeed_KBps( tr_session *, tr_direction, int Bps );
    653 int  tr_sessionGetAltSpeed_KBps( const tr_session *, tr_direction );
     652void     tr_sessionSetAltSpeed_KBps   ( tr_session *, tr_direction, int Bps );
     653int      tr_sessionGetAltSpeed_KBps   ( const tr_session *, tr_direction );
    654654
    655655void     tr_sessionUseAltSpeed        ( tr_session *, tr_bool );
     
    674674    TR_SCHED_FRI      = (1<<5),
    675675    TR_SCHED_SAT      = (1<<6),
    676     TR_SCHED_WEEKDAY  = (TR_SCHED_MON|TR_SCHED_TUES|TR_SCHED_WED|TR_SCHED_THURS|TR_SCHED_FRI),
     676    TR_SCHED_WEEKDAY  = (TR_SCHED_MON|TR_SCHED_TUES|TR_SCHED_WED|
     677                         TR_SCHED_THURS|TR_SCHED_FRI),
    677678    TR_SCHED_WEEKEND  = (TR_SCHED_SUN|TR_SCHED_SAT),
    678679    TR_SCHED_ALL      = (TR_SCHED_WEEKDAY|TR_SCHED_WEEKEND)
     
    680681tr_sched_day;
    681682
    682 void     tr_sessionSetAltSpeedDay    ( tr_session *, tr_sched_day day );
     683void         tr_sessionSetAltSpeedDay ( tr_session *, tr_sched_day day );
    683684tr_sched_day tr_sessionGetAltSpeedDay ( const tr_session * );
    684685
    685 typedef void ( tr_altSpeedFunc )      ( tr_session *, tr_bool active, tr_bool userDriven, void * );
    686 void     tr_sessionClearAltSpeedFunc  ( tr_session * );
    687 void     tr_sessionSetAltSpeedFunc    ( tr_session *, tr_altSpeedFunc *, void * );
     686typedef void ( tr_altSpeedFunc )( tr_session *,
     687                                  tr_bool active,
     688                                  tr_bool userDriven,
     689                                  void * );
     690
     691void  tr_sessionClearAltSpeedFunc  ( tr_session * );
     692void  tr_sessionSetAltSpeedFunc    ( tr_session *, tr_altSpeedFunc *, void * );
    688693
    689694
     
    713718uint16_t   tr_sessionGetPeerLimit( const tr_session * );
    714719
    715 void       tr_sessionSetPeerLimitPerTorrent( tr_session *, uint16_t maxGlobalPeers );
     720void       tr_sessionSetPeerLimitPerTorrent( tr_session *, uint16_t maxPeers );
    716721uint16_t   tr_sessionGetPeerLimitPerTorrent( const tr_session * );
     722
     723void       tr_sessionSetPaused        ( tr_session *, tr_bool isPaused );
     724tr_bool    tr_sessionGetPaused        ( const tr_session * );
     725
     726void       tr_sessionSetDeleteSource  ( tr_session *, tr_bool deleteSource );
     727tr_bool    tr_sessionGetDeleteSource  ( const tr_session * );
    717728
    718729tr_priority_t   tr_torrentGetPriority( const tr_torrent * );
    719730void            tr_torrentSetPriority( tr_torrent *, tr_priority_t );
    720 
    721 void       tr_sessionSetPaused        ( tr_session *, tr_bool isPaused );
    722 tr_bool    tr_sessionGetPaused        ( const tr_session * );
    723 
    724 void       tr_sessionSetDeleteSource  ( tr_session *, tr_bool deleteSource );
    725 tr_bool    tr_sessionGetDeleteSource  ( const tr_session * );
    726731
    727732/**
     
    852857    Instantiating a tr_torrent had gotten more complicated as features were
    853858    added. At one point there were four functions to check metainfo and five
    854     to create tr_torrent.
     859    to create a tr_torrent object.
    855860
    856861    To remedy this, a Torrent Constructor (struct tr_ctor) has been introduced:
     
    885890struct tr_benc;
    886891
    887 /** @brief Create a new torrent constructor object used to instantiate a tr_torrent
    888     @param session the tr_session. NULL is allowed if you're only calling tr_torrentParse() rather than tr_torrentNew()
     892/** @brief Create a torrent constructor object used to instantiate a tr_torrent
     893    @param session the tr_session. This is required if you're going to call
     894                   tr_torrentNew(), but you can use NULL for tr_torrentParse().
    889895    @see tr_torrentNew(), tr_torrentParse() */
    890896tr_ctor* tr_ctorNew( const tr_session * session_or_NULL );
     
    893899void  tr_ctorFree( tr_ctor * ctor );
    894900
    895 /** @brief Set whether or not to delete the source .torrent file when a torrent is added. (Default: False) */
     901/** @brief Set whether or not to delete the source .torrent file
     902           when the torrent is added. (Default: False) */
    896903void  tr_ctorSetDeleteSource( tr_ctor * ctor, tr_bool doDelete );
    897904
    898905/** @brief Set the constructor's metainfo from a magnet link */
    899 int tr_ctorSetMetainfoFromMagnetLink( tr_ctor * ctor, const char * magnet_link );
     906int tr_ctorSetMetainfoFromMagnetLink( tr_ctor * ctor, const char * magnet );
    900907
    901908/** @brief Set the constructor's metainfo from a raw benc already in memory */
     
    906913
    907914/**
    908  * @brief Set the constructor's metainfo from an already-existing file in tr_getTorrentDir().
    909  *
    910  * This is used by the mac client on startup to pick and choose which existing torrents to load
     915 * @brief Set the metainfo from an existing file in tr_getTorrentDir().
     916 *
     917 * This is used by the Mac client on startup to pick and choose which
     918 * torrents to load
    911919 */
    912920int tr_ctorSetMetainfoFromHash( tr_ctor * ctor, const char * hashString );
    913921
    914 /** @brief Set the maximum number of peers this torrent can connect to. (Default: 50) */
    915 void tr_ctorSetPeerLimit( tr_ctor * ctor, tr_ctorMode mode, uint16_t peerLimit );
     922/** @brief Set how many peers this torrent can connect to. (Default: 50) */
     923void tr_ctorSetPeerLimit( tr_ctor * ctor, tr_ctorMode mode, uint16_t limit );
    916924
    917925/** @brief Set the download folder for the torrent being added with this ctor.
    918926    @see tr_ctorSetDownloadDir()
    919927    @see tr_sessionInit() */
    920 void        tr_ctorSetDownloadDir( tr_ctor *    ctor,
    921                                    tr_ctorMode  mode,
    922                                    const char * directory );
     928void  tr_ctorSetDownloadDir( tr_ctor      * ctor,
     929                             tr_ctorMode    mode,
     930                             const char  * directory );
    923931
    924932/**
     
    981989tr_session* tr_ctorGetSession( const tr_ctor * ctor );
    982990
    983 /** @brief Get the .torrent file that this ctor's metainfo came from, or NULL if tr_ctorSetMetainfoFromFile() wasn't used */
     991/** @brief Get the .torrent file that this ctor's metainfo came from,
     992           or NULL if tr_ctorSetMetainfoFromFile() wasn't used */
    984993const char* tr_ctorGetSourceFile( const tr_ctor * ctor );
    985994
     
    10881097tr_torrent* tr_torrentFindFromId( tr_session * session, int id );
    10891098
    1090 tr_torrent* tr_torrentFindFromHash( tr_session * session, const uint8_t * hash );
     1099tr_torrent* tr_torrentFindFromHash( tr_session     * session,
     1100                                    const uint8_t  * hash );
    10911101
    10921102/** @brief Convenience function similar to tr_torrentFindFromHash() */
    1093 tr_torrent* tr_torrentFindFromMagnetLink( tr_session * session, const char * link );
     1103tr_torrent* tr_torrentFindFromMagnetLink( tr_session * session,
     1104                                          const char * link );
    10941105
    10951106/**
     
    11011112 * @brief find the location of a torrent's file by looking with and without
    11021113 *        the ".part" suffix, looking in downloadDir and incompleteDir, etc.
    1103  * @return a newly-allocated string (that must be tr_freed() by the caller when done)
    1104  *         that gives the location of this file on disk, or NULL if no file exists yet.
     1114 * @return a newly-allocated string (that must be tr_freed() by the caller
     1115 *         when done) that gives the location of this file on disk,
     1116 *         or NULL if no file exists yet.
    11051117 * @param tor the torrent whose file we're looking for
    11061118 * @param fileNum the fileIndex, in [0...tr_info.fileCount)
     
    11301142typedef enum
    11311143{
    1132     TR_RATIOLIMIT_GLOBAL    = 0, /* follow the global settings */
    1133     TR_RATIOLIMIT_SINGLE    = 1, /* override the global settings, seeding until a certain ratio */
    1134     TR_RATIOLIMIT_UNLIMITED = 2  /* override the global settings, seeding regardless of ratio */
     1144    /* follow the global settings */
     1145    TR_RATIOLIMIT_GLOBAL    = 0,
     1146
     1147    /* override the global settings, seeding until a certain ratio */
     1148    TR_RATIOLIMIT_SINGLE    = 1,
     1149
     1150    /* override the global settings, seeding regardless of ratio */
     1151    TR_RATIOLIMIT_UNLIMITED = 2
    11351152}
    11361153tr_ratiolimit;
     
    11561173typedef enum
    11571174{
    1158     TR_IDLELIMIT_GLOBAL    = 0, /* follow the global settings */
    1159     TR_IDLELIMIT_SINGLE    = 1, /* override the global settings, seeding until a certain idle time */
    1160     TR_IDLELIMIT_UNLIMITED = 2  /* override the global settings, seeding regardless of activity */
     1175    /* follow the global settings */
     1176    TR_IDLELIMIT_GLOBAL    = 0,
     1177
     1178    /* override the global settings, seeding until a certain idle time */
     1179    TR_IDLELIMIT_SINGLE    = 1,
     1180
     1181    /* override the global settings, seeding regardless of activity */
     1182    TR_IDLELIMIT_UNLIMITED = 2
    11611183}
    11621184tr_idlelimit;
     
    11731195
    11741196
    1175 tr_bool       tr_torrentGetSeedIdle( const tr_torrent *, uint16_t * idleMinutes );
     1197tr_bool       tr_torrentGetSeedIdle( const tr_torrent *, uint16_t * minutes );
    11761198
    11771199/****
     
    11791201****/
    11801202
    1181 void          tr_torrentSetPeerLimit( tr_torrent * tor,
    1182                                       uint16_t     peerLimit );
     1203void          tr_torrentSetPeerLimit( tr_torrent * tor, uint16_t peerLimit );
    11831204
    11841205uint16_t      tr_torrentGetPeerLimit( const tr_torrent * tor );
     
    12861307typedef enum
    12871308{
    1288     TR_LEECH,           /* doesn't have all the desired pieces */
    1289     TR_SEED,            /* has the entire torrent */
    1290     TR_PARTIAL_SEED     /* has the desired pieces, but not the entire torrent */
     1309    TR_LEECH,        /* doesn't have all the desired pieces */
     1310    TR_SEED,         /* has the entire torrent */
     1311    TR_PARTIAL_SEED  /* has the desired pieces, but not the entire torrent */
    12911312}
    12921313tr_completeness;
     
    14221443/***
    14231444****  THESE NEXT FOUR FIELDS ARE EXPERIMENTAL.
    1424 ****  They're currently being used in the GTK+ client to help tune the new download congestion code
    1425 ****  and probably won't make the cut for 2.0.
     1445****  Don't rely on them; they'll probably go away
    14261446***/
    14271447    /* how many blocks we've sent to this peer in the last 120 seconds */
Note: See TracChangeset for help on using the changeset viewer.