source: trunk/libtransmission/tracker.h @ 5911

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

more cleanup work:
(1) kill the pointless "tr_tracker_stat" struct.
(2) kill the unused "tr_torrentRemoveSaved()" function.
(3) kill the redundant "nextManualAnnounceTime" variable.
(4) make the TR_ERROR_IS_* macros private.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.6 KB
Line 
1/*
2 * This file Copyright (C) 2007-2008 Charles Kerr <charles@rebelbase.com>
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
5 * Transmission project are granted a special exemption to clause 2(b)
6 * so that the bulk of its code can remain under the MIT license.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: tracker.h 5911 2008-05-22 23:11:21Z charles $
11 */
12
13#ifndef _TR_TRACKER_H_
14#define _TR_TRACKER_H_
15
16#include <inttypes.h> /* for uint8_t */
17#include "transmission.h"
18#include "publish.h"
19
20/**
21***  Locating a tracker
22**/
23
24typedef struct tr_tracker tr_tracker;
25
26tr_tracker * tr_trackerNew( const tr_torrent * );
27
28void  tr_trackerFree ( tr_tracker * );
29
30void  tr_trackerShuttingDown( tr_handle * );
31
32/**
33***  Tracker Publish / Subscribe
34**/
35
36typedef enum
37{
38    TR_TRACKER_WARNING,
39    TR_TRACKER_ERROR,
40    TR_TRACKER_ERROR_CLEAR,
41    TR_TRACKER_PEERS
42}
43TrackerEventType;
44
45typedef struct
46{
47    /* what type of event this is */
48    TrackerEventType messageType;
49
50    /* the torrent's 20-character sha1 hash */
51    const uint8_t * hash;
52
53    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
54    const char * text;
55
56    /* for TR_TRACKER_PEERS */
57    const uint8_t * compact;
58    int compactLen;
59    int allAreSeeds;
60}
61tr_tracker_event;
62
63tr_publisher_tag  tr_trackerSubscribe       ( struct tr_tracker * tag,
64                                              tr_delivery_func      func,
65                                              void                * user );
66
67void              tr_trackerUnsubscribe     ( struct tr_tracker * tracker,
68                                              tr_publisher_tag      tag );
69
70/***
71****
72***/
73
74void tr_trackerStat                         ( const tr_tracker       * tracker,
75                                              struct tr_stat         * setme);
76
77void tr_trackerStart                        ( struct tr_tracker * );
78
79void tr_trackerCompleted                    ( struct tr_tracker * );
80
81void tr_trackerStop                         ( struct tr_tracker * );
82
83void tr_trackerReannounce                   ( struct tr_tracker * );
84
85void tr_trackerChangeMyPort                 ( struct tr_tracker * );
86
87const tr_tracker_info * tr_trackerGetAddress( const struct tr_tracker * );
88
89int  tr_trackerCanManualAnnounce            ( const struct tr_tracker * );
90
91time_t tr_trackerGetManualAnnounceTime      ( const struct tr_tracker * );
92
93void tr_trackerGetCounts                    ( const struct tr_tracker *,
94                                              int * setme_completedCount,
95                                              int * setme_leecherCount,
96                                              int * setme_seederCount );
97
98#endif
Note: See TracBrowser for help on using the repository browser.