source: trunk/libtransmission/transmission.h @ 6298

Last change on this file since 6298 was 6298, checked in by charles, 14 years ago

have daemon and cli use tr-getopt too.

  • Property svn:keywords set to Date Rev Author Id
File size: 44.7 KB
Line 
1/******************************************************************************
2 * $Id: transmission.h 6298 2008-07-08 16:50:34Z charles $
3 *
4 * Copyright (c) 2005-2008 Transmission authors and contributors
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *****************************************************************************/
24
25/*
26 * This file defines the public API for the libtransmission library.
27 *
28 * Other headers suitable for public consumption are bencode.h
29 * and utils.h.  Most of the remaining headers in libtransmission
30 * should be considered private to libtransmission.
31 */
32#ifndef TR_TRANSMISSION_H
33#define TR_TRANSMISSION_H 1
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39#include "version.h"
40
41#include <inttypes.h> /* uintN_t */
42#ifndef PRId64
43# define PRId64 "lld"
44#endif
45#ifndef PRIu64
46# define PRIu64 "llu"
47#endif
48#include <time.h> /* time_t */
49
50#define SHA_DIGEST_LENGTH 20
51
52#ifdef __BEOS__
53# include <StorageDefs.h>
54# define MAX_PATH_LENGTH  B_FILE_NAME_LENGTH
55#else
56# define MAX_PATH_LENGTH  1024
57#endif
58
59typedef uint32_t tr_file_index_t;
60typedef uint32_t tr_piece_index_t;
61typedef uint64_t tr_block_index_t;
62
63/**
64 * @brief returns Transmission's default configuration file directory.
65 *
66 * The default configuration directory is determined this way:
67 * - If the TRANSMISSION_HOME environmental variable is set,
68 *   its value is returned.
69 * - otherwise, if we're running on Darwin,
70 *   "$HOME/Library/Application Support/Transmission" is returned.
71 * - otherwise, if we're running on WIN32,
72 *   "$CSIDL_APPDATA/Transmission" is returned.
73 * - otherwise, if XDG_CONFIG_HOME is set,
74 *   "$XDG_CONFIG_HOME/transmission" is returned.
75 * - lastly, $HOME/.config/transmission" is used.
76 */
77const char* tr_getDefaultConfigDir( void );
78
79typedef struct tr_ctor tr_ctor;
80typedef struct tr_handle tr_handle;
81typedef struct tr_info tr_info;
82typedef struct tr_torrent tr_torrent;
83typedef tr_handle tr_session;
84
85
86/**
87 * @addtogroup tr_session Session
88 *
89 * A libtransmission session is created by calling either tr_sessionInitFull()
90 * or tr_sessionInit().  libtransmission creates a thread for itself so that
91 * it can operate independently of the caller's event loop.  The session will
92 * continue until tr_sessionClose() is called.
93 *
94 * @{
95 */
96
97typedef enum
98{
99  TR_PROXY_HTTP,
100  TR_PROXY_SOCKS4,
101  TR_PROXY_SOCKS5
102}
103tr_proxy_type;
104
105/** @see tr_sessionInitFull */
106#define TR_DEFAULT_CONFIG_DIR               tr_getDefaultConfigDir()
107/** @see tr_sessionInitFull */
108#define TR_DEFAULT_PEX_ENABLED              1
109/** @see tr_sessionInitFull */
110#define TR_DEFAULT_PORT_FORWARDING_ENABLED  0
111/** @see tr_sessionInitFull */
112#define TR_DEFAULT_PORT                     51413
113/** @see tr_sessionInitFull */
114#define TR_DEFAULT_GLOBAL_PEER_LIMIT        200
115/** @see tr_sessionInitFull */
116#define TR_DEFAULT_PEER_SOCKET_TOS          8
117/** @see tr_sessionInitFull */
118#define TR_DEFAULT_PEER_SOCKET_TOS_STR      "8"
119/** @see tr_sessionInitFull */
120#define TR_DEFAULT_BLOCKLIST_ENABLED        0
121/** @see tr_sessionInitFull */
122#define TR_DEFAULT_RPC_ENABLED              0
123/** @see tr_sessionInitFull */
124#define TR_DEFAULT_RPC_PORT                 9091
125/** @see tr_sessionInitFull */
126#define TR_DEFAULT_RPC_PORT_STR             "9091"
127/** @see tr_sessionInitFull */
128#define TR_DEFAULT_RPC_ACL                  "+127.0.0.1"
129/** @see tr_sessionInitFull */
130#define TR_DEFAULT_PROXY_ENABLED            0
131/** @see tr_sessionInitFull */
132#define TR_DEFAULT_PROXY                    NULL
133/** @see tr_sessionInitFull */
134#define TR_DEFAULT_PROXY_TYPE               TR_PROXY_HTTP
135/** @see tr_sessionInitFull */
136#define TR_DEFAULT_PROXY_AUTH_ENABLED       0
137/** @see tr_sessionInitFull */
138#define TR_DEFAULT_PROXY_USERNAME           NULL
139/** @see tr_sessionInitFull */
140#define TR_DEFAULT_PROXY_PASSWORD           NULL
141
142
143/**
144 * @brief Start a libtransmission session.
145 * @return an opaque handle to the new session
146 *
147 * @param configDir
148 *  The config directory where libtransmission config subdirectories
149 *  will be found, such as "torrents", "resume", and "blocklists".
150 *  #TR_DEFAULT_CONFIG_DIR can be used as a default.
151 *
152 * @param downloadDir
153 *  The default directory to save added torrents.
154 *  This can be changed per-session with
155 *  tr_sessionSetDownloadDir() and per-torrent with
156 *  tr_ctorSetDownloadDir().
157 *
158 * @param tag
159 *  Obsolete.  Only used now for locating legacy fastresume files.
160 *  This will be removed at some point in the future.
161 *  Valid tags: beos cli daemon gtk macos wx
162 *
163 * @param isPexEnabled
164 *  whether or not PEX is allowed for non-private torrents.
165 *  This can be changed per-session with
166 *  tr_sessionSetPexEnabled().
167 *  #TR_DEFAULT_PEX_ENABLED is the default.
168 *
169 * @param isPortForwardingEnabled
170 *  If true, libtransmission will attempt
171 *  to find a local UPnP-enabled or NATPMP-enabled
172 *  router and forward a port from there to the local
173 *  machine.  This is so remote peers can initiate
174 *  connections with us.
175 *  #TR_DEFAULT_PORT_FORWARDING_ENABLED is the default.
176 *
177 * @param publicPort
178 *  Port number to open for incoming peer connections.
179 *  #TR_DEFAULT_PORT is the default.
180 *
181 * @param encryptionMode
182 *  Must be one of #TR_PLAINTEXT_PREFERRED,
183 *  #TR_ENCRYPTION_PREFERRED, or #TR_ENCRYPTION_REQUIRED.
184 *
185 * @param isUploadLimitEnabled
186 *  If true, libtransmission will limit the entire
187 *  session's upload speed from "uploadLimit".
188 *
189 * @param uploadLimit
190 *  The speed limit to use for the entire session when
191 *  "isUploadLimitEnabled" is true.
192 *
193 * @param isDownloadLimitEnabled
194 *  If true, libtransmission will limit the entire
195 *  session's download speed from "downloadLimit".
196 *
197 * @param downloadLimit
198 *  The speed limit to use for the entire session when
199 *  "isDownloadLimitEnabled" is true.
200 *
201 * @param peerLimit
202 *  The maximum number of peer connections allowed in a session.
203 *  #TR_DEFAULT_GLOBAL_PEER_LIMIT can be used as a default.
204 *
205 * @param messageLevel
206 *  Verbosity level of libtransmission's logging mechanism.
207 *  Must be one of #TR_MSG_ERR, #TR_MSG_INF, #TR_MSG_DBG.
208 *
209 * @param isMessageQueueingEnabled
210 *  If true, then messages will build up in a queue until
211 *  processed by the client application.
212 *
213 * @param isBlocklistEnabled
214 *  If true, then Transmission will not allow peer connections
215 *  to the IP addressess specified in the blocklist.
216 *
217 * @param peerSocketTOS
218 *
219 * @param rpcIsEnabled
220 *  If true, then libtransmission will open an http server port
221 *  to listen for incoming RPC requests.
222 *
223 * @param rpcPort
224 *  The port on which to listen for incoming RPC requests
225 *
226 * @param rpcACL
227 *  The access control list for allowing/denying RPC requests
228 *  from specific IP ranges.
229 *  @see tr_sessionSetRPCACL()
230 *
231 * @see TR_DEFAULT_PEER_SOCKET_TOS
232 * @see TR_DEFAULT_BLOCKLIST_ENABLED
233 * @see TR_DEFAULT_RPC_ENABLED
234 * @see TR_DEFAULT_RPC_PORT
235 * @see TR_DEFAULT_RPC_ACL
236 * @see tr_sessionClose()
237 */
238tr_handle * tr_sessionInitFull( const char    * configDir,
239                                const char    * tag,
240                                const char    * downloadDir,
241                                int             isPexEnabled,
242                                int             isPortForwardingEnabled,
243                                int             publicPort,
244                                int             encryptionMode,
245                                int             isUploadLimitEnabled,
246                                int             uploadLimit,
247                                int             isDownloadLimitEnabled,
248                                int             downloadLimit,
249                                int             peerLimit,
250                                int             messageLevel,
251                                int             isMessageQueueingEnabled,
252                                int             isBlocklistEnabled,
253                                int             peerSocketTOS,
254                                int             rpcIsEnabled,
255                                int             rpcPort,
256                                const char    * rpcAccessControlList,
257                                int             rpcPasswordIsEnabled,
258                                const char    * rpcUsername,
259                                const char    * rpcPassword, 
260                                int             proxyIsEnabled,
261                                const char    * proxy,
262                                tr_proxy_type   proxyType,
263                                int             proxyAuthIsEnabled,
264                                const char    * proxyUsername,
265                                const char    * proxyPassword );
266
267
268/** @brief Shorter form of tr_sessionInitFull()
269    @deprecated Use tr_sessionInitFull() instead. */ 
270tr_handle * tr_sessionInit( const char * configDir,
271                            const char * downloadDir,
272                            const char * tag );
273
274/** @brief End a libtransmission session
275    @see tr_sessionInitFull() */
276void tr_sessionClose( tr_handle * );
277
278/**
279 * @brief Return the session's configuration directory
280 *
281 * This is where transmission stores its .torrent files, .resume files,
282 * blocklists, etc.
283 */
284const char * tr_sessionGetConfigDir( const tr_handle * );
285
286/**
287 * @brief Set the per-session default download folder for new torrents.
288 * @see tr_sessionInitFull()
289 * @see tr_sessionGetDownloadDir()
290 * @see tr_ctorSetDownloadDir()
291 */
292void tr_sessionSetDownloadDir( tr_handle *, const char * downloadDir );
293
294/**
295 * @brief Get the default download folder for new torrents.
296 *
297 * This is set by tr_sessionInitFull() or tr_sessionSetDownloadDir(),
298 * and can be overridden on a per-torrent basis by tr_ctorSetDownloadDir().
299 */
300const char * tr_sessionGetDownloadDir( const tr_handle * );
301
302/**
303 * @brief Set whether or not RPC calls are allowed in this session.
304 *
305 * @details If true, libtransmission will open a server socket to listen
306 * for incoming http RPC requests as described in docs/rpc-spec.txt.
307 *
308 * This is intially set by tr_sessionInitFull() and can be
309 * queried by tr_sessionIsRPCEnabled().
310 */
311void tr_sessionSetRPCEnabled( tr_handle *, int isEnabled );
312
313/** @brief Get whether or not RPC calls are allowed in this session.
314    @see tr_sessionInitFull()
315    @see tr_sessionSetRPCEnabled() */
316int tr_sessionIsRPCEnabled( const tr_handle * handle );
317
318/** @brief Specify which port to listen for RPC requests on.
319    @see tr_sessionInitFull()
320    @see tr_sessionGetRPCPort */
321void tr_sessionSetRPCPort( tr_handle *, int port );
322
323/** @brief Get which port to listen for RPC requests on.
324    @see tr_sessionInitFull()
325    @see tr_sessionSetRPCPort */
326int tr_sessionGetRPCPort( const tr_handle * );
327
328/**
329 * @brief test an ACL's syntax without modifying the RPC settings.
330 *
331 * ACL is a comma separated list of IP subnets, each subnet is prepended
332 * by a '+' or '-' sign to denote 'allow' or 'deny'.  If the subnet mask
333 * is omitted, like "-1.2.3.4", it means a single IP address. The mask
334 * may vary from 0 to 32 inclusive.  A simple primer on x.x.x.x/n notation
335 * can be found at <http://25yearsofprogramming.com/blog/20070803.htm>.
336 *
337 * Since wildcards are more familiar to most users than netmasks,
338 * libtransmission supports a wildcard notation that it
339 * converts into cidr required by the embedded http server.
340 * So, notation like "+192.168.*.*" is accepted by libtransmission and is
341 * converted to "+192.168.0.0/16" before it reaches the server.
342
343 * @param acl the ACL to test
344 * @param allocme_errmsg If the ACL can't be parsed, this is set to a
345 *                       newly-allocated error string describing the problem.
346 *                       The client should tr_free() this string when done.
347 * @return 0 on success, -1 on failure due to an unparseable ACL.
348 */
349int tr_sessionTestRPCACL( const tr_handle  * session,
350                          const char       * acl,
351                          char            ** allocme_errmsg );
352
353/**
354 * @brief Specify access control list (ACL).
355 ACL is a comma separated list
356 * of IP subnets, each subnet is prepended by a '-' or '+' sign.
357 * Plus means allow, minus means deny. If the subnet mask is omitted,
358 * like "-1.2.3.4", it means a single IP address. The mask may vary
359 * from 0 to 32 inclusive.
360 *
361 * http://25yearsofprogramming.com/blog/20070803.htm has a simple
362 * primer on x.x.x.x/n notation for those interested.
363 *
364 * The parameters and return value follow the same behavior as
365 * tr_sessionTestRPCACL().
366 *
367 * @see tr_sessionTestRPCACL
368 * @see tr_sessionInitFull
369 * @see tr_sessionGetRPCACL
370 */
371int tr_sessionSetRPCACL( tr_session  * session,
372                         const char  * acl,
373                         char       ** allocme_errmsg );
374
375/** @brief get the Access Control List for allowing/denying RPC requests.
376    @return a comma-separated string of ACL rules.  tr_free() when done.
377    @see tr_sessionInitFull
378    @see tr_sessionSetRPCACL */
379char* tr_sessionGetRPCACL( const tr_session * );
380
381void  tr_sessionSetRPCPassword( tr_session   * session,
382                                const char   * password );
383
384void  tr_sessionSetRPCUsername( tr_session   * session,
385                                const char   * username );
386
387/** @brief get the password used to restrict RPC requests.
388    @return the password string. tr_free() when done.
389    @see tr_sessionInitFull()
390    @see tr_sessionSetRPCPassword() */
391char* tr_sessionGetRPCPassword( const tr_session * session );
392
393char* tr_sessionGetRPCUsername( const tr_session * session  );
394
395void  tr_sessionSetRPCPasswordEnabled( tr_session * session,
396                                       int         isEnabled );
397
398int   tr_sessionIsRPCPasswordEnabled( const tr_session * session );
399
400
401typedef enum
402{
403    TR_RPC_TORRENT_ADDED,
404    TR_RPC_TORRENT_STARTED,
405    TR_RPC_TORRENT_STOPPED,
406    TR_RPC_TORRENT_REMOVING,
407    TR_RPC_TORRENT_CHANGED,
408    TR_RPC_SESSION_CHANGED
409}
410tr_rpc_callback_type;
411
412typedef void ( *tr_rpc_func )( tr_session           * handle,
413                               tr_rpc_callback_type   type,
414                               struct tr_torrent    * tor_or_null,
415                               void                 * user_data );
416
417void tr_sessionSetRPCCallback( tr_session   * handle,
418                               tr_rpc_func    func,
419                               void         * user_data );
420
421/**
422***
423**/
424
425int           tr_sessionIsProxyEnabled       ( const tr_session * );
426int           tr_sessionIsProxyAuthEnabled   ( const tr_session * );
427const char*   tr_sessionGetProxy             ( const tr_session * );
428tr_proxy_type tr_sessionGetProxyType         ( const tr_session * );
429const char*   tr_sessionGetProxyPassword     ( const tr_session * );
430void          tr_sessionSetProxyEnabled      ( tr_session *, int isEnabled );
431void          tr_sessionSetProxyAuthEnabled  ( tr_session *, int isEnabled );
432void          tr_sessionSetProxy             ( tr_session *, const char * proxy );
433void          tr_sessionSetProxyType         ( tr_session *, tr_proxy_type );
434void          tr_sessionSetProxyUsername     ( tr_session *, const char * username );
435void          tr_sessionSetProxyPassword     ( tr_session *, const char * password );
436
437/**
438***
439**/
440
441typedef struct tr_session_stats
442{
443    float ratio;              /* TR_RATIO_INF, TR_RATIO_NA, or total up/down */
444    uint64_t uploadedBytes;   /* total up */
445    uint64_t downloadedBytes; /* total down */
446    uint64_t filesAdded;      /* number of files added */
447    uint64_t sessionCount;    /* program started N times */
448    uint64_t secondsActive;   /* how long Transmisson's been running */
449}
450tr_session_stats;
451
452/* stats from the current session. */
453void tr_sessionGetStats( const tr_session  * session,
454                         tr_session_stats  * setme );
455
456/* stats from the current and past sessions. */
457void tr_sessionGetCumulativeStats( const tr_session  * session,
458                                   tr_session_stats  * setme );
459
460void tr_sessionClearStats( tr_session * session );
461
462/**
463 * Set whether or not torrents are allowed to do peer exchanges.
464 * PEX is always disabled in private torrents regardless of this.
465 * In public torrents, PEX is enabled by default.
466 */
467void tr_sessionSetPexEnabled( tr_session *, int isEnabled );
468
469int tr_sessionIsPexEnabled( const tr_session * );
470
471typedef enum
472{
473    TR_PLAINTEXT_PREFERRED,
474    TR_ENCRYPTION_PREFERRED,
475    TR_ENCRYPTION_REQUIRED
476}
477tr_encryption_mode;
478
479tr_encryption_mode tr_sessionGetEncryption( tr_session * );
480
481void tr_sessionSetEncryption( tr_session *, tr_encryption_mode mode );
482
483
484/***********************************************************************
485** Incoming Peer Connections Port
486*/
487
488void tr_sessionSetPortForwardingEnabled( tr_handle *, int enable );
489
490int tr_sessionIsPortForwardingEnabled( const tr_handle * );
491
492void tr_sessionSetPeerPort( tr_handle *, int );
493
494int tr_sessionGetPeerPort( const tr_handle * );
495
496typedef enum
497{
498    TR_PORT_ERROR,
499    TR_PORT_UNMAPPED,
500    TR_PORT_UNMAPPING,
501    TR_PORT_MAPPING,
502    TR_PORT_MAPPED
503}
504tr_port_forwarding;
505
506tr_port_forwarding tr_sessionGetPortForwarding( const tr_handle * );
507
508int tr_sessionCountTorrents( const tr_handle * h );
509
510void tr_sessionSetSpeedLimitEnabled( tr_handle   * session,
511                                     int           up_or_down,
512                                     int           isEnabled );
513
514enum { TR_UP, TR_DOWN };
515
516void tr_sessionGetSpeed( const tr_handle * session,
517                         float           * overall_down_KiBs,
518                         float           * overall_up_KiBs );
519
520int tr_sessionIsSpeedLimitEnabled( const tr_handle   * session,
521                                   int                 up_or_down );
522
523void tr_sessionSetSpeedLimit( tr_handle   * session,
524                              int           up_or_down,
525                              int           KiB_sec );
526
527int tr_sessionGetSpeedLimit( const tr_handle   * session,
528                             int                 up_or_down );
529
530void tr_sessionSetPeerLimit( tr_handle * handle,
531                             uint16_t    maxGlobalPeers );
532
533uint16_t tr_sessionGetPeerLimit( const tr_handle * handle );
534
535
536/**
537 *  Load all the torrents in tr_getTorrentDir().
538 *  This can be used at startup to kickstart all the torrents
539 *  from the previous session.
540 */
541tr_torrent ** tr_sessionLoadTorrents ( tr_handle  * h,
542                                       tr_ctor    * ctor,
543                                       int        * setmeCount );
544
545
546
547
548/** @} */
549
550
551/**
552***
553**/
554
555
556
557/***********************************************************************
558** Message Logging
559*/
560
561enum
562{
563    TR_MSG_ERR = 1,
564    TR_MSG_INF = 2,
565    TR_MSG_DBG = 3
566};
567void tr_setMessageLevel( int );
568int tr_getMessageLevel( void );
569
570typedef struct tr_msg_list
571{
572    /* TR_MSG_ERR, TR_MSG_INF, or TR_MSG_DBG */
573    uint8_t level;
574
575    /* The line number in the source file where this message originated */
576    int line;
577
578    /* Time the message was generated */
579    time_t when;
580
581    /* The torrent associated with this message,
582     * or a module name such as "Port Forwarding" for non-torrent messages,
583     * or NULL. */
584    char * name;
585
586    /* The message */
587    char * message;
588
589    /* The source file where this message originated */
590    const char * file;
591
592    /* linked list of messages */
593    struct tr_msg_list * next;
594}
595tr_msg_list;
596
597void tr_setMessageQueuing( int enable );
598
599tr_msg_list * tr_getQueuedMessages( void );
600void tr_freeMessageList( tr_msg_list * freeme );
601
602/** @addtogroup Blocklists
603    @{ */
604 
605/**
606 * Specify a range of IPs for Transmission to block.
607 *
608 * filename must be an uncompressed ascii file,
609 * using the same format as the bluetack level1 file.
610 *
611 * libtransmission does not keep a handle to `filename'
612 * after this call returns, so the caller is free to
613 * keep or delete `filename' as it wishes.
614 * libtransmission makes its own copy of the file
615 * massaged into a format easier to search.
616 *
617 * The caller only needs to invoke this when the blocklist
618 * has changed.
619 *
620 * Passing NULL for a filename will clear the blocklist.
621 */
622int tr_blocklistSetContent   ( tr_session       * session,
623                               const char       * filename );
624
625int tr_blocklistGetRuleCount ( const tr_session * session );
626
627int tr_blocklistExists       ( const tr_session * session );
628
629int tr_blocklistIsEnabled    ( const tr_session * session );
630
631void tr_blocklistSetEnabled  ( tr_session       * session,
632                               int                isEnabled );
633
634
635/** @} */
636
637
638
639/** @addtogroup tr_ctor Torrent Instantiation
640    @{
641
642    Instantiating a tr_torrent had gotten more complicated as features were
643    added.  At one point there were four functions to check metainfo and five
644    to create tr_torrent.
645 
646    To remedy this, a Torrent Constructor (struct tr_ctor) has been introduced:
647    - Simplifies the API to two functions: tr_torrentParse() and tr_torrentNew()
648    - You can set the fields you want; the system sets defaults for the rest.
649    - You can specify whether or not your fields should supercede resume's.
650    - We can add new features to tr_ctor without breaking tr_torrentNew()'s API.
651 
652    All the tr_ctor{Get,Set}*() functions with a return value return
653    an error number, or zero if no error occurred.
654 
655    You must call one of the SetMetainfo() functions before creating
656    a torrent with a tr_ctor.  The other functions are optional.
657 
658    You can reuse a single tr_ctor to create a batch of torrents --
659    just call one of the SetMetainfo() functions between each
660    tr_torrentNew() call.
661 
662    Every call to tr_ctorSetMetainfo*() frees the previous metainfo.
663 */
664
665typedef enum
666{
667    TR_FALLBACK, /* indicates the ctor value should be used only
668                    in case of missing resume settings */
669
670    TR_FORCE, /* indicates the ctor value should be used
671                 regardless of what's in the resume settings */
672}
673tr_ctorMode;
674
675struct tr_benc;
676
677tr_ctor* tr_ctorNew                    ( const tr_handle  * handle);
678
679void     tr_ctorFree                   ( tr_ctor        * ctor );
680
681void     tr_ctorSetSave                ( tr_ctor        * ctor,
682                                         int     saveMetadataInOurTorrentsDir );
683
684void     tr_ctorSetDeleteSource       ( tr_ctor        * ctor,
685                                         uint8_t          doDelete );
686
687int      tr_ctorSetMetainfo            ( tr_ctor        * ctor,
688                                         const uint8_t  * metainfo,
689                                         size_t           len );
690
691int      tr_ctorSetMetainfoFromFile    ( tr_ctor        * ctor,
692                                         const char     * filename );
693
694int      tr_ctorSetMetainfoFromHash    ( tr_ctor        * ctor,
695                                         const char     * hashString );
696
697/** Set the maximum number of peers this torrent can connect to.
698    (Default: 50) */
699void     tr_ctorSetPeerLimit           ( tr_ctor        * ctor,
700                                         tr_ctorMode      mode,
701                                         uint16_t         peerLimit  );
702
703/** Set the download folder for the torrent being added with this ctor.
704    @see tr_ctorSetDownloadDir()
705    @see tr_sessionInitFull() */
706void     tr_ctorSetDownloadDir         ( tr_ctor        * ctor,
707                                         tr_ctorMode      mode,
708                                         const char     * directory );
709
710/** Set whether or not the torrent begins downloading/seeding when created.
711    (Default: not paused) */
712void     tr_ctorSetPaused              ( tr_ctor        * ctor,
713                                         tr_ctorMode      mode,
714                                         uint8_t          isPaused );
715
716int      tr_ctorGetPeerLimit           ( const tr_ctor  * ctor,
717                                         tr_ctorMode      mode,
718                                         uint16_t       * setmeCount );
719
720int      tr_ctorGetPaused              ( const tr_ctor  * ctor,
721                                         tr_ctorMode      mode,
722                                         uint8_t        * setmeIsPaused );
723
724int      tr_ctorGetDownloadDir         ( const tr_ctor  * ctor,
725                                         tr_ctorMode      mode,
726                                         const char    ** setmeDownloadDir );
727
728int      tr_ctorGetMetainfo            ( const tr_ctor  * ctor,
729                                         const struct tr_benc ** setme );
730
731int      tr_ctorGetSave                ( const tr_ctor  * ctor );
732 
733int      tr_ctorGetDeleteSource        ( const tr_ctor  * ctor,
734                                         uint8_t        * setmeDoDelete );
735
736/* returns NULL if tr_ctorSetMetainfoFromFile() wasn't used */
737const char* tr_ctorGetSourceFile       ( const tr_ctor  * ctor );
738
739#define TR_EINVALID     1
740#define TR_EDUPLICATE   2
741
742/**
743 * Parses the specified metainfo.
744 * Returns TR_OK if it parsed and can be added to Transmission.
745 * Returns TR_EINVALID if it couldn't be parsed.
746 * Returns TR_EDUPLICATE if it parsed but can't be added.
747 *     "download-dir" must be set to test for TR_EDUPLICATE.
748 *
749 * If setme_info is non-NULL and parsing is successful
750 * (that is, if TR_EINVALID is not returned), then the parsed
751 * metainfo is stored in setme_info and should be freed by the
752 * caller via tr_metainfoFree().
753 */
754int tr_torrentParse( const tr_handle  * handle,
755                     const tr_ctor    * ctor,
756                     tr_info          * setme_info_or_NULL );
757
758/** Instantiate a single torrent.
759    @return 0 on success,
760            TR_EINVALID if the torrent couldn't be parsed, or
761            TR_EDUPLICATE if there's already a matching torrent object. */
762tr_torrent * tr_torrentNew( tr_handle      * handle,
763                            const tr_ctor  * ctor,
764                            int            * setmeError );
765
766/** @} */
767
768/***********************************************************************
769***
770***  TORRENTS
771**/
772
773/** @addtogroup tr_torrent Torrents
774    @{ */
775
776/** @brief Frees memory allocated by tr_torrentNew().
777           Running torrents are stopped first.  */
778void tr_torrentFree( tr_torrent * );
779
780/** @brief Removes our .torrent and .resume files for
781           this torrent, then calls tr_torrentFree(). */
782void tr_torrentRemove( tr_torrent * );
783
784/** @brief Start a torrent */
785void tr_torrentStart( tr_torrent * );
786
787/** @brief Stop (pause) a torrent */
788void tr_torrentStop( tr_torrent * );
789
790/**
791 * @brief Iterate through the torrents.
792 *
793 * Pass in a NULL pointer to get the first torrent.
794 */
795tr_torrent* tr_torrentNext( tr_handle * session, tr_torrent * );
796
797/**
798 * @brief Returns this torrent's unique ID.
799 *
800 * IDs are good as simple lookup keys, but are not persistent
801 * between sessions.  If you need that, use tr_info.hash or
802 * tr_info.hashString.
803 */
804int tr_torrentId( const tr_torrent * );
805
806/****
807*****  Speed Limits
808****/
809
810typedef enum
811{
812    TR_SPEEDLIMIT_GLOBAL,    /* only follow the overall speed limit */
813    TR_SPEEDLIMIT_SINGLE,    /* only follow the per-torrent limit */
814    TR_SPEEDLIMIT_UNLIMITED  /* no limits at all */
815}
816tr_speedlimit;
817
818void tr_torrentSetSpeedMode( tr_torrent   * tor,
819                             int            up_or_down,
820                             tr_speedlimit  mode );
821
822tr_speedlimit tr_torrentGetSpeedMode( const tr_torrent  * tor,
823                                      int                 up_or_down);
824
825void tr_torrentSetSpeedLimit( tr_torrent   * tor,
826                              int            up_or_down,
827                              int            KiB_sec );
828
829int tr_torrentGetSpeedLimit( const tr_torrent  * tor,
830                             int                 up_or_down );
831
832/****
833*****  Peer Limits
834****/
835
836void tr_torrentSetPeerLimit( tr_torrent  * tor,
837                             uint16_t      peerLimit );
838
839uint16_t tr_torrentGetPeerLimit( const tr_torrent  * tor );
840
841/****
842*****  File Priorities
843****/
844
845enum
846{
847    TR_PRI_LOW    = -1,
848    TR_PRI_NORMAL =  0, /* since NORMAL is 0, memset initializes nicely */
849    TR_PRI_HIGH   =  1
850};
851
852typedef int8_t tr_priority_t;
853
854/**
855 * @brief Set a batch of files to a particular priority.
856 *
857 * @param priority must be one of TR_PRI_NORMAL, _HIGH, or _LOW
858 */
859void tr_torrentSetFilePriorities( tr_torrent        * tor,
860                                  tr_file_index_t   * files,
861                                  tr_file_index_t     fileCount,
862                                  tr_priority_t       priority );
863
864/**
865 * @brief Get this torrent's file priorities.
866 *
867 * @return A malloc()ed array of tor->info.fileCount items,
868 *         each holding a TR_PRI_NORMAL, TR_PRI_HIGH, or TR_PRI_LOW.
869 *         It's the caller's responsibility to free() this.
870 */
871tr_priority_t* tr_torrentGetFilePriorities( const tr_torrent * );
872
873/**
874 * @brief Single-file form of tr_torrentGetFilePriorities.
875 * @return TR_PRI_NORMAL, TR_PRI_HIGH, or TR_PRI_LOW.
876 */
877tr_priority_t tr_torrentGetFilePriority( const tr_torrent *,
878                                         tr_file_index_t file );
879
880/**
881 * @brief See if a file's `download' flag is set.
882 * @return true if the file's `download' flag is set.
883 */
884int tr_torrentGetFileDL( const tr_torrent *, tr_file_index_t file );
885
886/** @brief Set a batch of files to be downloaded or not. */
887void tr_torrentSetFileDLs ( tr_torrent      * tor,
888                            tr_file_index_t * files,
889                            tr_file_index_t   fileCount,
890                            int               do_download );
891
892
893const tr_info * tr_torrentInfo( const tr_torrent * );
894
895void tr_torrentSetDownloadDir( tr_torrent *, const char * );
896
897const char * tr_torrentGetDownloadDir( const tr_torrent * );
898
899/**
900***
901**/
902   
903typedef struct tr_tracker_info
904{
905    int    tier;
906    char * announce;
907    char * scrape;
908}
909tr_tracker_info;
910
911/**
912 * @brief Modify a torrent's tracker list.
913 *
914 * This updates both the `torrent' object's tracker list
915 * and the metainfo file in tr_sessionGetConfigDir()'s torrent subdirectory.
916 *
917 * @param torrent The torrent whose tracker list is to be modified
918 * @param trackers An array of trackers, sorted by tier from first to last.
919 *                 NOTE: only the `tier' and `announce' fields are used.
920 *                 libtransmission derives `scrape' from `announce'.
921 * @param trackerCount size of the `trackers' array
922 */
923void tr_torrentSetAnnounceList( tr_torrent             * torrent,
924                                const tr_tracker_info  * trackers,
925                                int                      trackerCount );                   
926
927
928/**
929***
930**/
931
932typedef enum
933{
934    TR_CP_INCOMPLETE,   /* doesn't have all the desired pieces */
935    TR_CP_DONE,         /* has all the pieces but the DND ones */
936    TR_CP_COMPLETE      /* has every piece */
937}
938cp_status_t;
939
940typedef void (tr_torrent_status_func)(tr_torrent   * torrent,
941                                      cp_status_t    status,
942                                      void         * user_data );
943
944/**
945 * Register to be notified whenever a torrent's state changes.
946 *
947 * func is invoked FROM LIBTRANSMISSION'S THREAD!
948 * This means func must be fast (to avoid blocking peers),
949 * shouldn't call libtransmission functions (to avoid deadlock),
950 * and shouldn't modify client-level memory without using a mutex!
951 */
952void tr_torrentSetStatusCallback( tr_torrent             * torrent,
953                                  tr_torrent_status_func   func,
954                                  void                   * user_data );
955
956void tr_torrentClearStatusCallback( tr_torrent * torrent );
957
958
959/**
960 * MANUAL ANNOUNCE
961 *
962 * Trackers usually set an announce interval of 15 or 30 minutes.
963 * Users can send one-time announce requests that override this
964 * interval by calling tr_torrentManualUpdate().
965 *
966 * The wait interval for tr_torrentManualUpdate() is much smaller.
967 * You can test whether or not a manual update is possible
968 * (for example, to desensitize the button) by calling
969 * tr_torrentCanManualUpdate().
970 */
971
972void tr_torrentManualUpdate( tr_torrent * );
973
974int tr_torrentCanManualUpdate( const tr_torrent * );
975
976/***********************************************************************
977 * tr_torrentPeers
978 ***********************************************************************/
979
980typedef struct tr_peer_stat
981{
982    unsigned int isEncrypted : 1;
983    unsigned int isDownloadingFrom : 1;
984    unsigned int isUploadingTo : 1;
985
986    unsigned int peerIsChoked : 1;
987    unsigned int peerIsInterested : 1;
988    unsigned int clientIsChoked : 1;
989    unsigned int clientIsInterested : 1;
990    unsigned int isIncoming : 1;
991
992    uint8_t  from;
993    uint16_t port;
994
995    char addr[16];
996    char client[80];
997    char flagStr[32];
998   
999    float progress;
1000    float downloadFromRate;
1001    float uploadToRate;
1002}
1003tr_peer_stat;
1004
1005tr_peer_stat * tr_torrentPeers( const tr_torrent * torrent,
1006                                int              * peerCount );
1007
1008void tr_torrentPeersFree( tr_peer_stat *  peerStats,
1009                          int             peerCount );
1010
1011/**
1012 * @brief get the download speeds for each of this torrent's webseed sources.
1013 *
1014 * @return an array of tor->info.webseedCount floats giving download speeds.
1015 *         Each speed in the array corresponds to the webseed at the same
1016 *         array index in tor->info.webseeds.
1017 *         To differentiate "idle" and "stalled" status, idle webseeds will
1018 *         return -1 instead of 0 KiB/s.
1019 *         NOTE: always free this array with tr_free() when you're done with it.
1020 */
1021float* tr_torrentWebSpeeds( const tr_torrent * tor );
1022
1023typedef struct tr_file_stat
1024{
1025    uint64_t bytesCompleted;
1026    float progress;
1027}
1028tr_file_stat;
1029
1030tr_file_stat * tr_torrentFiles( const tr_torrent * tor,
1031                                 tr_file_index_t * fileCount );
1032
1033void tr_torrentFilesFree( tr_file_stat    * stat,
1034                          tr_file_index_t   fileCount );
1035
1036
1037/***********************************************************************
1038 * tr_torrentAvailability
1039 ***********************************************************************
1040 * Use this to draw an advanced progress bar which is 'size' pixels
1041 * wide. Fills 'tab' which you must have allocated: each byte is set
1042 * to either -1 if we have the piece, otherwise it is set to the number
1043 * of connected peers who have the piece.
1044 **********************************************************************/
1045void tr_torrentAvailability( const tr_torrent *, int8_t * tab, int size );
1046
1047void tr_torrentAmountFinished( const tr_torrent * tor, float * tab, int size );
1048
1049void tr_torrentVerify( tr_torrent * );
1050
1051/***********************************************************************
1052 * tr_info
1053 **********************************************************************/
1054
1055typedef struct tr_file
1056{
1057    uint64_t          length;      /* Length of the file, in bytes */
1058    char            * name;        /* Path to the file */
1059    int8_t            priority;    /* TR_PRI_HIGH, _NORMAL, or _LOW */
1060    int8_t            dnd;         /* nonzero if the file shouldn't be downloaded */
1061    tr_piece_index_t  firstPiece;  /* We need pieces [firstPiece... */
1062    tr_piece_index_t  lastPiece;   /* ...lastPiece] to dl this file */
1063    uint64_t          offset;      /* file begins at the torrent's nth byte */
1064}
1065tr_file;
1066
1067typedef struct tr_piece
1068{
1069    uint8_t  hash[SHA_DIGEST_LENGTH];  /* pieces hash */
1070    int8_t   priority;                 /* TR_PRI_HIGH, _NORMAL, or _LOW */
1071    int8_t   dnd;                      /* nonzero if the piece shouldn't be downloaded */
1072}
1073tr_piece;
1074
1075struct tr_info
1076{
1077    /* Flags */
1078    unsigned int isPrivate : 1;
1079    unsigned int isMultifile : 1;
1080
1081    /* General info */
1082    uint8_t              hash[SHA_DIGEST_LENGTH];
1083    char                 hashString[2*SHA_DIGEST_LENGTH+1];
1084    char               * name;
1085
1086    /* Path to torrent */
1087    char               * torrent;
1088
1089    /* these trackers are sorted by tier */
1090    tr_tracker_info    * trackers;
1091    int                  trackerCount;
1092
1093    char              ** webseeds;
1094    int                  webseedCount;
1095
1096    /* Torrent info */
1097    char               * comment;
1098    char               * creator;
1099    time_t               dateCreated;
1100
1101    /* Pieces info */
1102    uint32_t             pieceSize;
1103    tr_piece_index_t     pieceCount;
1104    uint64_t             totalSize;
1105    tr_piece           * pieces;
1106
1107    /* Files info */
1108    tr_file_index_t      fileCount;
1109    tr_file            * files;
1110};
1111
1112typedef enum
1113{
1114    TR_STATUS_CHECK_WAIT   = (1<<0), /* Waiting in queue to check files */
1115    TR_STATUS_CHECK        = (1<<1), /* Checking files */
1116    TR_STATUS_DOWNLOAD     = (1<<2), /* Downloading */
1117    TR_STATUS_SEED         = (1<<3), /* Seeding */
1118    TR_STATUS_STOPPED      = (1<<4)  /* Torrent is stopped */
1119}
1120tr_torrent_status;
1121
1122#define TR_STATUS_IS_ACTIVE(s) ((s) != TR_STATUS_STOPPED)
1123
1124/**
1125 * Transmission error codes
1126 * errors are always negative, and 0 refers to no error.
1127 */
1128typedef enum tr_errno
1129{
1130    TR_OK = 0,
1131
1132    /* general errors */
1133    TR_ERROR = -100,
1134    TR_ERROR_ASSERT,
1135
1136    /* io errors */
1137    TR_ERROR_IO_PARENT = -200,
1138    TR_ERROR_IO_PERMISSIONS,
1139    TR_ERROR_IO_SPACE,
1140    TR_ERROR_IO_FILE_TOO_BIG,
1141    TR_ERROR_IO_OPEN_FILES,
1142    TR_ERROR_IO_DUP_DOWNLOAD,
1143    TR_ERROR_IO_CHECKSUM,
1144    TR_ERROR_IO_OTHER,
1145
1146    /* tracker errors */
1147    TR_ERROR_TC_ERROR = -300,
1148    TR_ERROR_TC_WARNING,
1149
1150    /* peer errors */
1151    TR_ERROR_PEER_MESSAGE = -400
1152}
1153tr_errno;
1154
1155tr_torrent_status tr_torrentGetStatus( tr_torrent * );
1156
1157enum
1158{
1159    TR_PEER_FROM_INCOMING  = 0,  /* connections made to the listening port */
1160    TR_PEER_FROM_TRACKER   = 1,  /* peers received from a tracker */
1161    TR_PEER_FROM_CACHE     = 2,  /* peers read from the peer cache */
1162    TR_PEER_FROM_PEX       = 3,  /* peers discovered via PEX */
1163    TR_PEER_FROM__MAX
1164};
1165
1166/**
1167 * The current status of a torrent.
1168 * @see tr_torrentStat()
1169 */
1170typedef struct tr_stat
1171{
1172    /** The torrent's unique Id.
1173        @see tr_torrentId() */
1174    int id;
1175
1176    /** The torrent's current status */
1177    tr_torrent_status status;
1178
1179    /** Our current announce URL, or NULL if none.
1180        This URL may change during the session if the torrent's
1181        metainfo has multiple trackers and the current one
1182        becomes unreachable. */
1183    char * announceURL;
1184
1185    /** Our current scrape URL, or NULL if none.
1186        This URL may change during the session if the torrent's
1187        metainfo has multiple trackers and the current one
1188        becomes unreachable. */
1189    char * scrapeURL;
1190
1191    /** The error status for this torrent.  0 means everything's fine. */
1192    tr_errno error;
1193
1194    /** Typically an error string returned from the tracker. */
1195    char errorString[128];
1196
1197    /** When tr_stat.status is TR_STATUS_CHECK or TR_STATUS_CHECK_WAIT,
1198        this is the percentage of how much of the files has been
1199        verified.  When it gets to 1, the verify process is done.
1200        Range is [0..1]
1201        @see tr_stat.status */
1202    float recheckProgress;
1203
1204    /** How much has been downloaded of the entire torrent.
1205        Range is [0..1] */
1206    float percentComplete;
1207
1208    /** How much has been downloaded of the files the user wants.  This differs
1209        from percentComplete if the user wants only some of the torrent's files.
1210        Range is [0..1]
1211        @see tr_stat.leftUntilDone */
1212    float percentDone;
1213
1214    /** Download speed in KiB/s */
1215    float rateDownload;
1216
1217    /** Upload speed in KiB/s */
1218    float rateUpload;
1219
1220 #define TR_ETA_NOT_AVAIL -1
1221 #define TR_ETA_UNKNOWN -2
1222    /** Estimated number of seconds left until the torrent is done,
1223        or TR_ETA_NOT_AVAIL or TR_ETA_UNKNOWN */
1224    int eta;
1225
1226    /** Number of peers that the tracker says this torrent has */
1227    int peersKnown;
1228
1229    /** Number of peers that we're connected to */
1230    int peersConnected;
1231
1232    /** How many peers we found out about from the tracker, or from pex,
1233        or from incoming connections, or from our resume file. */
1234    int peersFrom[TR_PEER_FROM__MAX];
1235
1236    /** Number of peers that are sending data to us. */
1237    int peersSendingToUs;
1238
1239    /** Number of peers that we're sending data to */
1240    int peersGettingFromUs;
1241
1242    /** Number of webseeds that are sending data to us. */
1243    int webseedsSendingToUs;
1244
1245    /** Number of seeders that the tracker says this torrent has */
1246    int seeders;
1247
1248    /** Number of leechers that the tracker says this torrent has */
1249    int leechers;
1250
1251    /** Number of finished downloads that the tracker says torrent has */
1252    int timesCompleted;
1253
1254    /** Byte count of all the piece data we'll have downloaded when we're done,
1255        whether or not we have it yet. [0...tr_info.totalSize] */
1256    uint64_t sizeWhenDone;
1257
1258    /** Byte count of how much data is left to be downloaded until
1259        we're done -- that is, until we've got all the pieces we wanted.
1260        [0...tr_info.sizeWhenDone] */
1261    uint64_t leftUntilDone;
1262
1263    /** Byte count of all the piece data we want and don't have yet,
1264        but that a connected peer does have. [0...leftUntilDone] */
1265    uint64_t desiredAvailable;
1266
1267    /** Byte count of all the corrupt data you've ever downloaded for
1268        this torrent.  If you're on a poisoned torrent, this number can
1269        grow very large. */
1270    uint64_t corruptEver;
1271
1272    /** Byte count of all data you've ever uploaded for this torrent. */
1273    uint64_t uploadedEver;
1274
1275    /** Byte count of all the non-corrupt data you've ever downloaded
1276        for this torrent.  If you deleted the files and downloaded a second
1277        time, this will be 2*totalSize.. */
1278    uint64_t downloadedEver;
1279
1280    /** Byte count of all the checksum-verified data we have for this torrent. */
1281    uint64_t haveValid;
1282
1283    /** Byte count of all the partial piece data we have for this torrent.
1284        As pieces become complete, this value may decrease as portions of it
1285        are moved to `corrupt' or `haveValid'. */
1286    uint64_t haveUnchecked;
1287
1288    /** This is the unmodified string returned by the tracker in response
1289        to the torrent's most recent scrape request.  If no request was
1290        sent or there was no response, this string is empty. */
1291    char scrapeResponse[64];
1292
1293    /** The unmodified string returned by the tracker in response
1294        to the torrent's most recent scrape request.  If no request was
1295        sent or there was no response, this string is empty. */
1296    char announceResponse[64];
1297
1298    /** Time the most recent scrape request was sent,
1299        or zero if one hasn't been sent yet. */
1300    time_t lastScrapeTime;
1301
1302    /** Time when the next scrape request will be sent.
1303        This value is always a valid time. */
1304    time_t nextScrapeTime;
1305
1306    /** Time the most recent announce request was sent,
1307        or zero if one hasn't been sent yet. */
1308    time_t lastAnnounceTime;
1309
1310    /** Time when the next reannounce request will be sent,
1311        or zero if the torrent is stopped. */
1312    time_t nextAnnounceTime;
1313
1314    /** If the torrent is running, this is the time at which
1315        the client can manually ask the torrent's tracker
1316        for more peers.  otherwise, the value is zero. */
1317    time_t manualAnnounceTime;
1318
1319    /** A very rough estimate in KiB/s of how quickly data is being
1320        passed around between all the peers we're connected to.
1321        Don't put too much weight in this number. */
1322    float swarmSpeed;
1323
1324#define TR_RATIO_NA  -1
1325#define TR_RATIO_INF -2
1326    /** TR_RATIO_INF, TR_RATIO_NA, or a regular ratio */
1327    float ratio;
1328
1329    /** When the torrent was first added. */
1330    time_t addedDate;
1331
1332    /** When the torrent finished downloading. */
1333    time_t doneDate;
1334   
1335    /** When the torrent was last started. */ 
1336    time_t startDate;
1337
1338    /** The last time we uploaded or downloaded piece data on this torrent. */
1339    time_t activityDate;
1340}
1341tr_stat;
1342
1343/** Return a pointer to an tr_stat structure with updated information
1344    on the torrent.  This is typically called by the GUI clients every
1345    second or so to get a new snapshot of the torrent's status. */
1346const tr_stat * tr_torrentStat( tr_torrent * );
1347
1348/** Like tr_torrentStat(), but only recalculates the statistics if it's
1349    been longer than a second since they were last calculated.  This can
1350    reduce the CPU load if you're calling tr_torrentStat() frequently. */
1351const tr_stat * tr_torrentStatCached( tr_torrent * );
1352
1353/** @deprecated this method will be removed in 1.40 */
1354void tr_torrentSetAddedDate( tr_torrent *, time_t );
1355
1356/** @deprecated this method will be removed in 1.40 */
1357void tr_torrentSetActivityDate( tr_torrent *, time_t );
1358
1359/** @deprecated this method will be removed in 1.40 */
1360void tr_torrentSetDoneDate( tr_torrent *, time_t );
1361
1362/** @} */
1363
1364#ifdef __TRANSMISSION__
1365#  include "session.h"
1366#endif
1367
1368#ifdef __cplusplus
1369}
1370#endif
1371
1372#endif
Note: See TracBrowser for help on using the repository browser.