diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-03-10 20:36:49 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-03-21 19:05:50 +0900 |
| commit | 73da215882d7f96b6010fa99361c7cc10ec18bfb (patch) | |
| tree | cea1a5016a94a9dac26cab8227e2513224288be3 /src/libktorrent/torrent | |
| parent | bb099158e6c9fd0f1c2771cb9350d3b0a0b51a27 (diff) | |
| download | ktorrent-73da2158.tar.gz ktorrent-73da2158.zip | |
Conversion to cmake building system
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit bf204e931c605c73d761ec84943bb0cc94d7e7e4)
Diffstat (limited to 'src/libktorrent/torrent')
22 files changed, 74 insertions, 29 deletions
diff --git a/src/libktorrent/torrent/CMakeLists.txt b/src/libktorrent/torrent/CMakeLists.txt new file mode 100644 index 0000000..5760582 --- /dev/null +++ b/src/libktorrent/torrent/CMakeLists.txt @@ -0,0 +1,29 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/.. +) + + +##### torrent library (static) + +tde_add_library( torrent STATIC_PIC AUTOMOC + SOURCES + advancedchokealgorithm.cpp announcelist.cpp + authenticate.cpp authenticatebase.cpp authenticationmonitor.cpp bdecoder.cpp + bencoder.cpp bnode.cpp cache.cpp cachefile.cpp cap.cpp choker.cpp chunk.cpp + chunkcounter.cpp chunkdownload.cpp chunkmanager.cpp chunkselector.cpp dndfile.cpp + downloadcap.cpp downloader.cpp globals.cpp httptracker.cpp ipblocklist.cpp + movedatafilesjob.cpp multifilecache.cpp newchokealgorithm.cpp packet.cpp packetreader.cpp + packetwriter.cpp peer.cpp peerdownloader.cpp peerid.cpp peermanager.cpp + peersourcemanager.cpp peeruploader.cpp piece.cpp preallocationthread.cpp queuemanager.cpp + request.cpp server.cpp serverauthenticate.cpp singlefilecache.cpp + speedestimater.cpp statsfile.cpp timeestimator.cpp torrent.cpp torrentcontrol.cpp + torrentcreator.cpp torrentfile.cpp tracker.cpp udptracker.cpp udptrackersocket.cpp + uploadcap.cpp uploader.cpp upspeedestimater.cpp utpex.cpp value.cpp + LINK + net-static datachecker-static mse-static migrate-static util-static + kademlia-static interfaces-static + DEPENDENCIES torrent-static +) diff --git a/src/libktorrent/torrent/authenticationmonitor.h b/src/libktorrent/torrent/authenticationmonitor.h index 43a4ebb..64d824d 100644 --- a/src/libktorrent/torrent/authenticationmonitor.h +++ b/src/libktorrent/torrent/authenticationmonitor.h @@ -22,6 +22,8 @@ #include <list> #include <vector> + +#include <libktorrent_export.h> struct pollfd; @@ -34,7 +36,7 @@ namespace bt Monitors ongoing authentication attempts. This class is a singleton. */ - class AuthenticationMonitor + class LIBKTORRENT_EXPORT AuthenticationMonitor { std::list<AuthenticateBase*> auths; std::vector<struct pollfd> fd_vec; diff --git a/src/libktorrent/torrent/bdecoder.h b/src/libktorrent/torrent/bdecoder.h index 438a656..57bcdf0 100644 --- a/src/libktorrent/torrent/bdecoder.h +++ b/src/libktorrent/torrent/bdecoder.h @@ -22,6 +22,7 @@ #include <tqstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace bt { @@ -37,7 +38,7 @@ namespace bt * * Class to decode b-encoded data. */ - class BDecoder + class LIBKTORRENT_EXPORT BDecoder { const TQByteArray & data; Uint32 pos; diff --git a/src/libktorrent/torrent/bencoder.h b/src/libktorrent/torrent/bencoder.h index eb84c39..1338681 100644 --- a/src/libktorrent/torrent/bencoder.h +++ b/src/libktorrent/torrent/bencoder.h @@ -22,6 +22,7 @@ #include <util/file.h> +#include <libktorrent_export.h> namespace bt @@ -79,7 +80,7 @@ namespace bt * the BitTorrent protocol docs. The data gets written to a BEncoderOutput * thing. */ - class BEncoder + class LIBKTORRENT_EXPORT BEncoder { BEncoderOutput* out; bool del; diff --git a/src/libktorrent/torrent/bnode.h b/src/libktorrent/torrent/bnode.h index 84b306e..c8482cd 100644 --- a/src/libktorrent/torrent/bnode.h +++ b/src/libktorrent/torrent/bnode.h @@ -24,6 +24,7 @@ #include <tqvaluelist.h> #include <util/constants.h> #include "value.h" +#include <libktorrent_export.h> namespace bt @@ -37,7 +38,7 @@ namespace bt * There are 3 possible pieces of data in b-encoded piece of data. * This is the base class for all those 3 things. */ - class BNode + class LIBKTORRENT_EXPORT BNode { public: enum Type @@ -79,7 +80,7 @@ namespace bt * * @todo Use TQVariant */ - class BValueNode : public BNode + class LIBKTORRENT_EXPORT BValueNode : public BNode { Value v; public: @@ -95,7 +96,7 @@ namespace bt * @brief Represents a dictionary in bencoded data * */ - class BDictNode : public BNode + class LIBKTORRENT_EXPORT BDictNode : public BNode { struct DictEntry { @@ -157,7 +158,7 @@ namespace bt * @brief Represents a list in bencoded data * */ - class BListNode : public BNode + class LIBKTORRENT_EXPORT BListNode : public BNode { TQPtrList<BNode> children; public: diff --git a/src/libktorrent/torrent/choker.h b/src/libktorrent/torrent/choker.h index b44fc48..9dd4bba 100644 --- a/src/libktorrent/torrent/choker.h +++ b/src/libktorrent/torrent/choker.h @@ -23,6 +23,7 @@ #include <tqptrlist.h> #include <util/constants.h> #include "peer.h" +#include <libktorrent_export.h> namespace kt { @@ -91,7 +92,7 @@ namespace bt * This class handles the choking and unchoking of Peer's. * This class needs to be updated every 10 seconds. */ - class Choker + class LIBKTORRENT_EXPORT Choker { ChokeAlgorithm* choke; PeerManager & pman; diff --git a/src/libktorrent/torrent/chunkmanager.h b/src/libktorrent/torrent/chunkmanager.h index bbf81df..6cb320f 100644 --- a/src/libktorrent/torrent/chunkmanager.h +++ b/src/libktorrent/torrent/chunkmanager.h @@ -27,6 +27,7 @@ #include <util/bitset.h> #include "chunk.h" #include "globals.h" +#include <libktorrent_export.h> class TQStringList; @@ -58,7 +59,7 @@ namespace bt * The chunks are stored in the cache file in the correct order. Eliminating * the need for a file reconstruction algorithm for single files. */ - class ChunkManager : public TQObject + class LIBKTORRENT_EXPORT ChunkManager : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/downloader.h b/src/libktorrent/torrent/downloader.h index 5cafc6f..9ad8910 100644 --- a/src/libktorrent/torrent/downloader.h +++ b/src/libktorrent/torrent/downloader.h @@ -64,7 +64,7 @@ namespace bt * This class manages the downloading of the file. It should * regurarly be updated. */ - class Downloader : public TQObject + class LIBKTORRENT_EXPORT Downloader : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/globals.h b/src/libktorrent/torrent/globals.h index 16de41e..11eb051 100644 --- a/src/libktorrent/torrent/globals.h +++ b/src/libktorrent/torrent/globals.h @@ -20,6 +20,7 @@ #ifndef BTGLOBALS_H #define BTGLOBALS_H +#include <libktorrent_export.h> #include <util/constants.h> class TQString; @@ -39,9 +40,7 @@ namespace bt class Log; class Server; - - - class Globals + class LIBKTORRENT_EXPORT Globals { public: virtual ~Globals(); diff --git a/src/libktorrent/torrent/ipblocklist.h b/src/libktorrent/torrent/ipblocklist.h index 6439972..a6a0008 100644 --- a/src/libktorrent/torrent/ipblocklist.h +++ b/src/libktorrent/torrent/ipblocklist.h @@ -21,6 +21,7 @@ #ifndef IPBLOCKLIST_H #define IPBLOCKLIST_H +#include <libktorrent_export.h> #include <interfaces/ipblockinginterface.h> #include <tqmap.h> @@ -31,7 +32,7 @@ class TQString; namespace bt { - class IPKey + class LIBKTORRENT_EXPORT IPKey { public: IPKey(); @@ -60,7 +61,7 @@ namespace bt * * Peers that have sent >= 3 bad chunks are blocked. */ - class IPBlocklist + class LIBKTORRENT_EXPORT IPBlocklist { IPBlocklist(); IPBlocklist(const IPBlocklist & ); diff --git a/src/libktorrent/torrent/peer.h b/src/libktorrent/torrent/peer.h index 549ab5d..8e8b11a 100644 --- a/src/libktorrent/torrent/peer.h +++ b/src/libktorrent/torrent/peer.h @@ -27,6 +27,7 @@ #include <util/bitset.h> #include "globals.h" #include "peerid.h" +#include <libktorrent_export.h> namespace net { @@ -64,7 +65,7 @@ namespace bt * It provides functions for sending packets. Packets it receives * get relayed to the outside world using a bunch of signals. */ - class Peer : public TQObject, public kt::PeerInterface + class LIBKTORRENT_EXPORT Peer : public TQObject, public kt::PeerInterface //,public Object { TQ_OBJECT diff --git a/src/libktorrent/torrent/peerid.cpp b/src/libktorrent/torrent/peerid.cpp index f15d5f2..66e9533 100644 --- a/src/libktorrent/torrent/peerid.cpp +++ b/src/libktorrent/torrent/peerid.cpp @@ -74,7 +74,7 @@ namespace bt return *this; } - bool operator == (const PeerID & a,const PeerID & b) + LIBKTORRENT_EXPORT bool operator == (const PeerID & a,const PeerID & b) { for (int i = 0;i < 20;i++) if (a.id[i] != b.id[i]) @@ -83,12 +83,12 @@ namespace bt return true; } - bool operator != (const PeerID & a,const PeerID & b) + LIBKTORRENT_EXPORT bool operator != (const PeerID & a,const PeerID & b) { return ! operator == (a,b); } - bool operator < (const PeerID & a,const PeerID & b) + LIBKTORRENT_EXPORT bool operator < (const PeerID & a,const PeerID & b) { for (int i = 0;i < 20;i++) if (a.id[i] < b.id[i]) diff --git a/src/libktorrent/torrent/peerid.h b/src/libktorrent/torrent/peerid.h index 8ebea9a..e1bb479 100644 --- a/src/libktorrent/torrent/peerid.h +++ b/src/libktorrent/torrent/peerid.h @@ -21,6 +21,7 @@ #define BTPEERID_H #include <tqstring.h> +#include <libktorrent_export.h> namespace bt { @@ -28,7 +29,7 @@ namespace bt /** @author Joris Guisson */ - class PeerID + class LIBKTORRENT_EXPORT PeerID { char id[20]; TQString client_name; diff --git a/src/libktorrent/torrent/peermanager.h b/src/libktorrent/torrent/peermanager.h index 1a87dbb..5bc785d 100644 --- a/src/libktorrent/torrent/peermanager.h +++ b/src/libktorrent/torrent/peermanager.h @@ -53,7 +53,7 @@ namespace bt * This class manages all Peer objects. * It can also open connections to other peers. */ - class PeerManager : public TQObject + class LIBKTORRENT_EXPORT PeerManager : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/queuemanager.h b/src/libktorrent/torrent/queuemanager.h index 96bc586..3618c7a 100644 --- a/src/libktorrent/torrent/queuemanager.h +++ b/src/libktorrent/torrent/queuemanager.h @@ -26,6 +26,7 @@ #include <tqptrlist.h> #include <interfaces/torrentinterface.h> +#include <libktorrent_export.h> namespace kt { @@ -53,7 +54,7 @@ namespace bt * @author Ivan Vasic * @brief This class contains list of all TorrentControls and is responsible for starting/stopping them */ - class QueueManager : public TQObject + class LIBKTORRENT_EXPORT QueueManager : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/server.h b/src/libktorrent/torrent/server.h index 6d994a2..600685c 100644 --- a/src/libktorrent/torrent/server.h +++ b/src/libktorrent/torrent/server.h @@ -23,6 +23,7 @@ #include <tqptrlist.h> #include <tqobject.h> #include "globals.h" +#include <libktorrent_export.h> namespace bt { @@ -42,7 +43,7 @@ namespace bt * All PeerManager's should register with this class when they * are created and should unregister when they are destroyed. */ - class Server : public TQObject + class LIBKTORRENT_EXPORT Server : public TQObject { TQ_OBJECT diff --git a/src/libktorrent/torrent/serverauthenticate.h b/src/libktorrent/torrent/serverauthenticate.h index 63ebff8..bb82e39 100644 --- a/src/libktorrent/torrent/serverauthenticate.h +++ b/src/libktorrent/torrent/serverauthenticate.h @@ -21,6 +21,7 @@ #define BTSERVERAUTHENTICATE_H #include "authenticatebase.h" +#include <libktorrent_export.h> namespace bt { @@ -35,7 +36,7 @@ namespace bt * Once the authentication is finished, the socket gets handed over * to the right PeerManager. */ - class ServerAuthenticate : public AuthenticateBase + class LIBKTORRENT_EXPORT ServerAuthenticate : public AuthenticateBase { TQ_OBJECT diff --git a/src/libktorrent/torrent/torrent.h b/src/libktorrent/torrent/torrent.h index 05c28cc..5ed623c 100644 --- a/src/libktorrent/torrent/torrent.h +++ b/src/libktorrent/torrent/torrent.h @@ -29,6 +29,7 @@ #include "globals.h" #include "peerid.h" #include "torrentfile.h" +#include <libktorrent_export.h> @@ -62,7 +63,7 @@ namespace bt * Loads a torrent file and calculates some miscelanious other data, * like the info_hash and the peer_id. */ - class Torrent + class LIBKTORRENT_EXPORT Torrent { public: Torrent(); diff --git a/src/libktorrent/torrent/torrentcontrol.h b/src/libktorrent/torrent/torrentcontrol.h index 14fd6f6..def2361 100644 --- a/src/libktorrent/torrent/torrentcontrol.h +++ b/src/libktorrent/torrent/torrentcontrol.h @@ -30,6 +30,7 @@ #include <interfaces/torrentinterface.h> #include <interfaces/monitorinterface.h> #include <interfaces/trackerslist.h> +#include <libktorrent_export.h> class TQStringList; class TQString; @@ -65,7 +66,7 @@ namespace bt * This class controls the uploading, downloading, choking, * updating the tracker and chunk management. */ - class TorrentControl : public kt::TorrentInterface + class LIBKTORRENT_EXPORT TorrentControl : public kt::TorrentInterface { TQ_OBJECT diff --git a/src/libktorrent/torrent/torrentcreator.h b/src/libktorrent/torrent/torrentcreator.h index e1e2545..4f1599c 100644 --- a/src/libktorrent/torrent/torrentcreator.h +++ b/src/libktorrent/torrent/torrentcreator.h @@ -23,6 +23,7 @@ #include <tqstringlist.h> #include "torrent.h" #include <util/sha1hash.h> +#include <libktorrent_export.h> namespace bt { @@ -37,7 +38,7 @@ namespace bt * It also allows to create a TorrentControl object, so * that we immediately can start to share the torrent. */ - class TorrentCreator + class LIBKTORRENT_EXPORT TorrentCreator { // input values TQString target; diff --git a/src/libktorrent/torrent/tracker.h b/src/libktorrent/torrent/tracker.h index 72c9468..5f35b04 100644 --- a/src/libktorrent/torrent/tracker.h +++ b/src/libktorrent/torrent/tracker.h @@ -41,7 +41,7 @@ namespace bt /** * Base class for all tracker classes. */ - class Tracker : public kt::PeerSource + class LIBKTORRENT_EXPORT Tracker : public kt::PeerSource { TQ_OBJECT diff --git a/src/libktorrent/torrent/udptrackersocket.h b/src/libktorrent/torrent/udptrackersocket.h index 5b48f18..fadbc38 100644 --- a/src/libktorrent/torrent/udptrackersocket.h +++ b/src/libktorrent/torrent/udptrackersocket.h @@ -24,6 +24,7 @@ #include <tqmap.h> #include <tqcstring.h> #include <util/constants.h> +#include <libktorrent_export.h> namespace KNetwork @@ -51,7 +52,7 @@ namespace bt * * Class which handles communication with one or more UDP trackers. */ - class UDPTrackerSocket : public TQObject + class LIBKTORRENT_EXPORT UDPTrackerSocket : public TQObject { TQ_OBJECT |
