source: trunk/libtransmission/announcer.h @ 9671

Last change on this file since 9671 was 9671, checked in by charles, 11 years ago

(trunk) update the copyright notices

File size: 2.6 KB
Line 
1/*
2 * This file Copyright (C) 2009 Mnemosyne LLC
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:$
11 */
12
13#ifndef __TRANSMISSION__
14#error only libtransmission should #include this header.
15#endif
16
17#ifndef _TR_ANNOUNCER_H_
18#define _TR_ANNOUNCER_H_
19
20#include "transmission.h"
21#include "publish.h"
22
23struct tr_announcer;
24struct tr_torrent_tiers;
25
26/**
27 * ***  Tracker Publish / Subscribe
28 * **/
29
30typedef enum
31{
32    TR_TRACKER_WARNING,
33    TR_TRACKER_ERROR,
34    TR_TRACKER_ERROR_CLEAR,
35    TR_TRACKER_PEERS
36}
37TrackerEventType;
38
39typedef struct
40{
41    /* what type of event this is */
42    TrackerEventType    messageType;
43
44    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
45    const char *  text;
46
47    /* for TR_TRACKER_PEERS */
48    const uint8_t *  compact;
49    int              compactLen;
50    int              allAreSeeds;
51}
52tr_tracker_event;
53
54/**
55***  Session ctor/dtor
56**/
57
58void tr_announcerInit( tr_session * );
59
60void tr_announcerClose( tr_session * );
61
62/**
63***  For torrent customers
64**/
65
66struct tr_torrent_tiers * tr_announcerAddTorrent( struct tr_announcer  *,
67                                                  tr_torrent           * );
68
69tr_bool tr_announcerHasBacklog( const struct tr_announcer * );
70
71void tr_announcerResetTorrent( struct tr_announcer*, tr_torrent* );
72
73tr_publisher_tag tr_announcerSubscribe( struct tr_torrent_tiers  * tiers, 
74                                        tr_delivery_func           func,
75                                        void                     * userData );
76
77void tr_announcerUnsubscribe( struct tr_torrent_tiers  * tiers,
78                              tr_publisher_tag           tag );
79
80void tr_announcerRemoveTorrent( struct tr_announcer * ,
81                                tr_torrent          * );
82
83void tr_announcerChangeMyPort( tr_torrent * );
84
85tr_bool tr_announcerCanManualAnnounce( const tr_torrent * );
86
87void tr_announcerManualAnnounce( tr_torrent * );
88
89void tr_announcerTorrentStarted( tr_torrent * );
90void tr_announcerTorrentStopped( tr_torrent * );
91void tr_announcerTorrentCompleted( tr_torrent * );
92
93time_t tr_announcerNextManualAnnounce( const tr_torrent * );
94
95tr_tracker_stat * tr_announcerStats( const tr_torrent * torrent,
96                                     int              * setmeTrackerCount );
97
98void tr_announcerStatsFree( tr_tracker_stat * trackers,
99                            int               trackerCount );
100
101
102#endif /* _TR_ANNOUNCER_H_ */
Note: See TracBrowser for help on using the repository browser.