forked from premiere/premiere-libtorrent
minor rearranging and comments
This commit is contained in:
parent
3264ec5d40
commit
3fcd67b574
|
@ -45,7 +45,7 @@ namespace libtorrent
|
|||
{
|
||||
class torrent_info;
|
||||
|
||||
struct add_torrent_params
|
||||
struct TORRENT_EXPORT add_torrent_params
|
||||
{
|
||||
add_torrent_params(storage_constructor_type sc = default_storage_constructor)
|
||||
: version(LIBTORRENT_VERSION_NUM)
|
||||
|
|
|
@ -40,13 +40,8 @@ std::string demangle(char const* name);
|
|||
TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth = 0);
|
||||
#endif
|
||||
|
||||
#if (!defined TORRENT_DEBUG && !TORRENT_RELEASE_ASSERTS) \
|
||||
|| TORRENT_NO_ASSERTS
|
||||
|
||||
#define TORRENT_ASSERT(a) do {} while(false)
|
||||
#define TORRENT_ASSERT_VAL(a, b) do {} while(false)
|
||||
|
||||
#else
|
||||
#if (defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS) \
|
||||
&& !TORRENT_NO_ASSERTS
|
||||
|
||||
#if TORRENT_PRODUCTION_ASSERTS
|
||||
extern char const* libtorrent_assert_log;
|
||||
|
@ -74,7 +69,12 @@ TORRENT_EXPORT void assert_fail(const char* expr, int line, char const* file
|
|||
#define TORRENT_ASSERT_VAL(x, y) assert(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#else // TORRENT_DEBUG || TORENT_RELEASE_ASSERTS && !TORRENT_NO_ASSERTS
|
||||
|
||||
#define TORRENT_ASSERT(a) do {} while(false)
|
||||
#define TORRENT_ASSERT_VAL(a, b) do {} while(false)
|
||||
|
||||
#endif // TORRENT_DEBUG || TORENT_RELEASE_ASSERTS && !TORRENT_NO_ASSERTS
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -163,9 +163,7 @@ namespace libtorrent
|
|||
|
||||
private:
|
||||
|
||||
#ifndef TORRENT_DEBUG
|
||||
data_type m_type;
|
||||
#else
|
||||
#ifdef TORRENT_DEBUG
|
||||
// the bitfield is used so that the m_type_queried
|
||||
// field still fits, so that the ABI is the same for
|
||||
// debug builds and release builds. It appears to be
|
||||
|
@ -182,6 +180,8 @@ namespace libtorrent
|
|||
// exceptions are used.
|
||||
mutable bool m_type_queried:1;
|
||||
protected:
|
||||
#else
|
||||
data_type m_type;
|
||||
#endif // TORRENT_DEBUG
|
||||
|
||||
#if (defined(_MSC_VER) && _MSC_VER < 1310) || TORRENT_COMPLETE_TYPES_REQUIRED
|
||||
|
|
|
@ -108,6 +108,7 @@ namespace libtorrent
|
|||
int mode;
|
||||
};
|
||||
|
||||
// TODO: why are all these functions exported?
|
||||
enum stat_flags_t { dont_follow_links = 1 };
|
||||
TORRENT_EXPORT void stat_file(std::string f, file_status* s
|
||||
, error_code& ec, int flags = 0);
|
||||
|
|
|
@ -71,6 +71,7 @@ namespace libtorrent
|
|||
// it's smaller and optimized for smaller memory
|
||||
// footprint, as opposed to file_entry, which is
|
||||
// optimized for convenience
|
||||
// TODO: does this really need to be exported?
|
||||
struct TORRENT_EXPORT internal_file_entry
|
||||
{
|
||||
friend class file_storage;
|
||||
|
|
|
@ -53,6 +53,8 @@ namespace libtorrent
|
|||
typedef boost::function<void(int, address, int, error_code const&)> portmap_callback_t;
|
||||
typedef boost::function<void(char const*)> log_callback_t;
|
||||
|
||||
// TODO: 3 should this really be a public symbol?
|
||||
// also, make this a shared_ptr instead
|
||||
class TORRENT_EXPORT natpmp : public intrusive_ptr_base<natpmp>
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -58,6 +58,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
namespace libtorrent
|
||||
{
|
||||
|
||||
// TODO: 3 rename this to sha1_hash
|
||||
class TORRENT_EXPORT big_number
|
||||
{
|
||||
// the number of bytes of the number
|
||||
|
|
|
@ -98,6 +98,7 @@ namespace libtorrent
|
|||
// workaround for microsofts
|
||||
// hardware exceptions that makes
|
||||
// it hard to debug stuff
|
||||
// TODO: 3 make this an implementation detail
|
||||
#ifdef _MSC_VER
|
||||
struct TORRENT_EXPORT eh_initializer
|
||||
{
|
||||
|
@ -128,6 +129,8 @@ namespace libtorrent
|
|||
#define TORRENT_LOGPATH_ARG_DEFAULT
|
||||
#endif
|
||||
|
||||
// Once it's created, the session object will spawn the main thread that will do all the work.
|
||||
// The main thread will be idle as long it doesn't have any torrents to participate in.
|
||||
class TORRENT_EXPORT session: public boost::noncopyable, aux::eh_initializer
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
namespace libtorrent
|
||||
{
|
||||
// TODO: 3 do these two really need to be exposed to users?
|
||||
TORRENT_EXPORT char const* time_now_string();
|
||||
TORRENT_EXPORT std::string log_time();
|
||||
|
||||
|
@ -64,6 +65,7 @@ namespace libtorrent
|
|||
|
||||
namespace aux
|
||||
{
|
||||
// TODO: 3 move these to time.cpp
|
||||
TORRENT_EXPORT boost::int64_t performance_counter_to_microseconds(boost::int64_t pc);
|
||||
TORRENT_EXPORT boost::int64_t microseconds_to_performance_counter(boost::int64_t ms);
|
||||
}
|
||||
|
|
|
@ -235,6 +235,7 @@ namespace libtorrent
|
|||
typedef libtorrent_exception invalid_torrent_file;
|
||||
#endif
|
||||
|
||||
// TODO: 3 should this really be a public symbol?
|
||||
int TORRENT_EXPORT load_file(std::string const& filename
|
||||
, std::vector<char>& v, error_code& ec, int limit = 8000000);
|
||||
|
||||
|
@ -420,8 +421,7 @@ namespace libtorrent
|
|||
bool is_merkle_torrent() const { return !m_merkle_tree.empty(); }
|
||||
|
||||
// if we're logging member offsets, we need access to them
|
||||
#if defined TORRENT_DEBUG \
|
||||
&& !defined TORRENT_LOGGING \
|
||||
#if !defined TORRENT_LOGGING \
|
||||
&& !defined TORRENT_VERBOSE_LOGGING \
|
||||
&& !defined TORRENT_ERROR_LOGGING
|
||||
private:
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace libtorrent
|
|||
typedef boost::function<void(int, address, int, error_code const&)> portmap_callback_t;
|
||||
typedef boost::function<void(char const*)> log_callback_t;
|
||||
|
||||
// TODO: 3 should this really be a public symbol?
|
||||
// also, make this a shared_ptr instead
|
||||
class TORRENT_EXPORT upnp : public intrusive_ptr_base<upnp>
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue