hide some internal functions. error if namespaces are preceded by whitespace (as the docs generation script requires them to start at the beginning of the line)
This commit is contained in:
parent
f40ecac4dd
commit
bfe0e1f27d
|
@ -456,6 +456,9 @@ def parse_class(lno, lines, filename):
|
||||||
funs[-1]['signatures'].update(current_fun['signatures'])
|
funs[-1]['signatures'].update(current_fun['signatures'])
|
||||||
funs[-1]['names'].update(current_fun['names'])
|
funs[-1]['names'].update(current_fun['names'])
|
||||||
else:
|
else:
|
||||||
|
if 'TODO: ' in context:
|
||||||
|
print('TODO comment in public documentation: %s:%d' % (filename, lno))
|
||||||
|
sys.exit(1)
|
||||||
current_fun['desc'] = context
|
current_fun['desc'] = context
|
||||||
if context == '' and not suppress_warning(filename, first_item(current_fun['names'])):
|
if context == '' and not suppress_warning(filename, first_item(current_fun['names'])):
|
||||||
print('WARNING: member function "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
print('WARNING: member function "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
||||||
|
@ -496,6 +499,9 @@ def parse_class(lno, lines, filename):
|
||||||
else:
|
else:
|
||||||
enum, lno = parse_enum(lno - 1, lines, filename)
|
enum, lno = parse_enum(lno - 1, lines, filename)
|
||||||
if enum is not None:
|
if enum is not None:
|
||||||
|
if 'TODO: ' in context:
|
||||||
|
print('TODO comment in public documentation: %s:%d' % (filename, lno))
|
||||||
|
sys.exit(1)
|
||||||
enum['desc'] = context
|
enum['desc'] = context
|
||||||
if context == '' and not suppress_warning(filename, enum['name']):
|
if context == '' and not suppress_warning(filename, enum['name']):
|
||||||
print('WARNING: enum "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
print('WARNING: enum "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
||||||
|
@ -767,11 +773,19 @@ for filename in files:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (line == 'namespace detail {' or
|
if (line == 'namespace detail {' or
|
||||||
line == 'namespace aux {') \
|
line == 'namespace aux {' or
|
||||||
|
line == 'namespace libtorrent { namespace aux {') \
|
||||||
and not internal:
|
and not internal:
|
||||||
lno = consume_block(lno, lines)
|
lno = consume_block(lno - 1, lines)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if ('namespace aux' in line or
|
||||||
|
'namespace detail' in line) and \
|
||||||
|
'//' not in line.split('namespace')[0] and \
|
||||||
|
'}' not in line.split('namespace')[1]:
|
||||||
|
print('ERROR: whitespace preceding namespace declaration: %s:%d' % (filename, lno))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if 'TORRENT_DEPRECATED' in line:
|
if 'TORRENT_DEPRECATED' in line:
|
||||||
if ('class ' in line or 'struct ' in line) and ';' not in line:
|
if ('class ' in line or 'struct ' in line) and ';' not in line:
|
||||||
lno = consume_block(lno - 1, lines)
|
lno = consume_block(lno - 1, lines)
|
||||||
|
@ -786,6 +800,9 @@ for filename in files:
|
||||||
if not line.endswith(';'):
|
if not line.endswith(';'):
|
||||||
current_class, lno = parse_class(lno - 1, lines, filename)
|
current_class, lno = parse_class(lno - 1, lines, filename)
|
||||||
if current_class is not None and is_visible(context):
|
if current_class is not None and is_visible(context):
|
||||||
|
if 'TODO: ' in context:
|
||||||
|
print('TODO comment in public documentation: %s:%d' % (filename, lno))
|
||||||
|
sys.exit(1)
|
||||||
current_class['desc'] = context
|
current_class['desc'] = context
|
||||||
if context == '':
|
if context == '':
|
||||||
print('WARNING: class "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
print('WARNING: class "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
||||||
|
@ -802,6 +819,9 @@ for filename in files:
|
||||||
functions[-1]['signatures'].update(current_fun['signatures'])
|
functions[-1]['signatures'].update(current_fun['signatures'])
|
||||||
functions[-1]['names'].update(current_fun['names'])
|
functions[-1]['names'].update(current_fun['names'])
|
||||||
else:
|
else:
|
||||||
|
if 'TODO: ' in context:
|
||||||
|
print('TODO comment in public documentation: %s:%d' % (filename, lno))
|
||||||
|
sys.exit(1)
|
||||||
current_fun['desc'] = context
|
current_fun['desc'] = context
|
||||||
if context == '':
|
if context == '':
|
||||||
print('WARNING: function "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
print('WARNING: function "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
||||||
|
@ -823,6 +843,9 @@ for filename in files:
|
||||||
else:
|
else:
|
||||||
current_enum, lno = parse_enum(lno - 1, lines, filename)
|
current_enum, lno = parse_enum(lno - 1, lines, filename)
|
||||||
if current_enum is not None and is_visible(context):
|
if current_enum is not None and is_visible(context):
|
||||||
|
if 'TODO: ' in context:
|
||||||
|
print('TODO comment in public documentation: %s:%d' % (filename, lno))
|
||||||
|
sys.exit(1)
|
||||||
current_enum['desc'] = context
|
current_enum['desc'] = context
|
||||||
if context == '':
|
if context == '':
|
||||||
print('WARNING: enum "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
print('WARNING: enum "%s" is not documented: \x1b[34m%s:%d\x1b[0m'
|
||||||
|
|
|
@ -65,10 +65,13 @@ namespace libtorrent {
|
||||||
using boost::asio::ip::make_address_v4;
|
using boost::asio::ip::make_address_v4;
|
||||||
using boost::asio::ip::make_address_v6;
|
using boost::asio::ip::make_address_v6;
|
||||||
#else
|
#else
|
||||||
|
// internal
|
||||||
inline address make_address(string_view str, boost::system::error_code& ec)
|
inline address make_address(string_view str, boost::system::error_code& ec)
|
||||||
{ return address::from_string(str.data(), ec); }
|
{ return address::from_string(str.data(), ec); }
|
||||||
|
// internal
|
||||||
inline address_v4 make_address_v4(string_view str, boost::system::error_code& ec)
|
inline address_v4 make_address_v4(string_view str, boost::system::error_code& ec)
|
||||||
{ return address_v4::from_string(str.data(), ec); }
|
{ return address_v4::from_string(str.data(), ec); }
|
||||||
|
// internal
|
||||||
inline address_v6 make_address_v6(string_view str, boost::system::error_code& ec)
|
inline address_v6 make_address_v6(string_view str, boost::system::error_code& ec)
|
||||||
{ return address_v6::from_string(str.data(), ec); }
|
{ return address_v6::from_string(str.data(), ec); }
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -74,6 +74,7 @@ namespace aux {
|
||||||
|
|
||||||
#if TORRENT_USE_ASSERTS || !defined TORRENT_DISABLE_LOGGING
|
#if TORRENT_USE_ASSERTS || !defined TORRENT_DISABLE_LOGGING
|
||||||
|
|
||||||
|
// internal
|
||||||
struct piece_log_t
|
struct piece_log_t
|
||||||
{
|
{
|
||||||
explicit piece_log_t(job_action_t j, int b = -1): job(j), block(b) {}
|
explicit piece_log_t(job_action_t j, int b = -1): job(j), block(b) {}
|
||||||
|
@ -82,6 +83,7 @@ namespace aux {
|
||||||
|
|
||||||
// these are "jobs" thar cause piece_refcount
|
// these are "jobs" thar cause piece_refcount
|
||||||
// to be incremented
|
// to be incremented
|
||||||
|
// internal
|
||||||
enum artificial_jobs
|
enum artificial_jobs
|
||||||
{
|
{
|
||||||
flushing = static_cast<int>(job_action_t::num_job_ids), // 20
|
flushing = static_cast<int>(job_action_t::num_job_ids), // 20
|
||||||
|
|
|
@ -49,7 +49,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
namespace libtorrent {
|
namespace libtorrent {
|
||||||
|
|
||||||
namespace aux { struct session_settings; }
|
namespace aux { struct session_settings; }
|
||||||
|
|
||||||
struct disk_observer;
|
struct disk_observer;
|
||||||
|
|
||||||
struct TORRENT_EXTRA_EXPORT disk_buffer_pool
|
struct TORRENT_EXTRA_EXPORT disk_buffer_pool
|
||||||
|
|
|
@ -58,10 +58,7 @@ namespace libtorrent {
|
||||||
struct counters;
|
struct counters;
|
||||||
class alert_manager;
|
class alert_manager;
|
||||||
|
|
||||||
namespace aux {
|
namespace aux { struct block_cache_reference; }
|
||||||
|
|
||||||
struct block_cache_reference;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct cached_piece_info
|
struct cached_piece_info
|
||||||
{
|
{
|
||||||
|
|
|
@ -528,6 +528,9 @@ namespace libtorrent {
|
||||||
// offset to add to any pointers to make them point into the new buffer
|
// offset to add to any pointers to make them point into the new buffer
|
||||||
void apply_pointer_offset(std::ptrdiff_t off);
|
void apply_pointer_offset(std::ptrdiff_t off);
|
||||||
|
|
||||||
|
// validate any symlinks, to ensure they all point to
|
||||||
|
// other files or directories inside this storage. Any invalid symlinks
|
||||||
|
// are updated to point to themselves.
|
||||||
void sanitize_symlinks();
|
void sanitize_symlinks();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -104,6 +104,7 @@ namespace libtorrent {
|
||||||
// default constructed.
|
// default constructed.
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
// hidden
|
||||||
~hasher();
|
~hasher();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -104,6 +104,7 @@ namespace libtorrent {
|
||||||
// default constructed.
|
// default constructed.
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
// hidden
|
||||||
~hasher512();
|
~hasher512();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -43,19 +43,18 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/aux_/throw.hpp"
|
#include "libtorrent/aux_/throw.hpp"
|
||||||
|
|
||||||
namespace libtorrent {
|
namespace libtorrent {
|
||||||
|
namespace aux {
|
||||||
|
|
||||||
namespace aux {
|
struct free_deleter
|
||||||
|
{ void operator()(char* ptr) { return std::free(ptr); } };
|
||||||
|
|
||||||
struct free_deleter
|
inline std::size_t calculate_pad_bytes(char const* inptr, std::size_t alignment)
|
||||||
{ void operator()(char* ptr) { return std::free(ptr); } };
|
{
|
||||||
|
std::uintptr_t const ptr = reinterpret_cast<std::uintptr_t>(inptr);
|
||||||
inline std::size_t calculate_pad_bytes(char const* inptr, std::size_t alignment)
|
std::uintptr_t const offset = ptr & (alignment - 1);
|
||||||
{
|
return (alignment - offset) & (alignment - 1);
|
||||||
std::uintptr_t const ptr = reinterpret_cast<std::uintptr_t>(inptr);
|
|
||||||
std::uintptr_t const offset = ptr & (alignment - 1);
|
|
||||||
return (alignment - offset) & (alignment - 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct heterogeneous_queue
|
struct heterogeneous_queue
|
||||||
|
|
|
@ -43,8 +43,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "assert.hpp"
|
#include "assert.hpp"
|
||||||
|
|
||||||
namespace libtorrent {
|
namespace libtorrent {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template <class T> struct type {};
|
template <class T> struct type {};
|
||||||
|
|
||||||
// reads an integer from a byte stream
|
// reads an integer from a byte stream
|
||||||
|
@ -183,7 +183,7 @@ namespace detail {
|
||||||
for (auto const c : val) *out++ = c;
|
for (auto const c : val) *out++ = c;
|
||||||
return int(val.length());
|
return int(val.length());
|
||||||
}
|
}
|
||||||
}
|
} // namespace detail
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TORRENT_IO_HPP_INCLUDED
|
#endif // TORRENT_IO_HPP_INCLUDED
|
||||||
|
|
|
@ -108,6 +108,7 @@ namespace libtorrent {
|
||||||
|
|
||||||
using packet_ptr = std::unique_ptr<packet, packet_deleter>;
|
using packet_ptr = std::unique_ptr<packet, packet_deleter>;
|
||||||
|
|
||||||
|
// internal
|
||||||
inline packet_ptr create_packet(int const size)
|
inline packet_ptr create_packet(int const size)
|
||||||
{
|
{
|
||||||
packet* p = static_cast<packet*>(std::malloc(sizeof(packet) + aux::numeric_cast<std::uint16_t>(size)));
|
packet* p = static_cast<packet*>(std::malloc(sizeof(packet) + aux::numeric_cast<std::uint16_t>(size)));
|
||||||
|
|
|
@ -102,7 +102,6 @@ namespace libtorrent {
|
||||||
static constexpr save_state_flags_t TORRENT_DEPRECATED_MEMBER save_tracker_proxy = 10_bit;
|
static constexpr save_state_flags_t TORRENT_DEPRECATED_MEMBER save_tracker_proxy = 10_bit;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: 2 the ip filter should probably be saved here too
|
|
||||||
// loads and saves all session settings, including dht_settings,
|
// loads and saves all session settings, including dht_settings,
|
||||||
// encryption settings and proxy settings. ``save_state`` writes all keys
|
// encryption settings and proxy settings. ``save_state`` writes all keys
|
||||||
// to the ``entry`` that's passed in, which needs to either not be
|
// to the ``entry`` that's passed in, which needs to either not be
|
||||||
|
|
|
@ -1167,7 +1167,6 @@ namespace libtorrent {
|
||||||
// favour of a choked peer.
|
// favour of a choked peer.
|
||||||
seeding_piece_quota,
|
seeding_piece_quota,
|
||||||
|
|
||||||
// TODO: deprecate this
|
|
||||||
// ``max_rejects`` is the number of piece requests we will reject in a
|
// ``max_rejects`` is the number of piece requests we will reject in a
|
||||||
// row while a peer is choked before the peer is considered abusive
|
// row while a peer is choked before the peer is considered abusive
|
||||||
// and is disconnected.
|
// and is disconnected.
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace detail {
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,8 @@ namespace libtorrent {
|
||||||
// it and return garbage for anything read from it.
|
// it and return garbage for anything read from it.
|
||||||
TORRENT_EXPORT storage_interface* disabled_storage_constructor(storage_params const&, file_pool&);
|
TORRENT_EXPORT storage_interface* disabled_storage_constructor(storage_params const&, file_pool&);
|
||||||
|
|
||||||
|
// the constructor function for the "zero" storage. This will always read
|
||||||
|
// zeroes and ignore all writes.
|
||||||
TORRENT_EXPORT storage_interface* zero_storage_constructor(storage_params const&, file_pool&);
|
TORRENT_EXPORT storage_interface* zero_storage_constructor(storage_params const&, file_pool&);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace libtorrent {
|
||||||
using string_view = boost::string_ref;
|
using string_view = boost::string_ref;
|
||||||
using wstring_view = boost::wstring_ref;
|
using wstring_view = boost::wstring_ref;
|
||||||
|
|
||||||
|
// internal
|
||||||
inline string_view::size_type find_first_of(string_view const v, char const c
|
inline string_view::size_type find_first_of(string_view const v, char const c
|
||||||
, string_view::size_type pos)
|
, string_view::size_type pos)
|
||||||
{
|
{
|
||||||
|
@ -56,6 +57,7 @@ inline string_view::size_type find_first_of(string_view const v, char const c
|
||||||
return string_view::npos;
|
return string_view::npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// internal
|
||||||
inline string_view::size_type find_first_of(string_view const v, char const* c
|
inline string_view::size_type find_first_of(string_view const v, char const* c
|
||||||
, string_view::size_type pos)
|
, string_view::size_type pos)
|
||||||
{
|
{
|
||||||
|
@ -74,12 +76,14 @@ namespace libtorrent {
|
||||||
using string_view = boost::string_view;
|
using string_view = boost::string_view;
|
||||||
using wstring_view = boost::wstring_view;
|
using wstring_view = boost::wstring_view;
|
||||||
|
|
||||||
|
// internal
|
||||||
inline string_view::size_type find_first_of(string_view const v, char const c
|
inline string_view::size_type find_first_of(string_view const v, char const c
|
||||||
, string_view::size_type pos)
|
, string_view::size_type pos)
|
||||||
{
|
{
|
||||||
return v.find_first_of(c, pos);
|
return v.find_first_of(c, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// internal
|
||||||
inline string_view::size_type find_first_of(string_view const v, char const* c
|
inline string_view::size_type find_first_of(string_view const v, char const* c
|
||||||
, string_view::size_type pos)
|
, string_view::size_type pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,8 +125,6 @@ namespace libtorrent {
|
||||||
int max_decode_tokens = 2000000;
|
int max_decode_tokens = 2000000;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: there may be some opportunities to optimize the size if torrent_info.
|
|
||||||
// specifically to turn some std::string and std::vector into pointers
|
|
||||||
class TORRENT_EXPORT torrent_info
|
class TORRENT_EXPORT torrent_info
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -574,6 +572,9 @@ namespace libtorrent {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
// TODO: there may be some opportunities to optimize the size if torrent_info.
|
||||||
|
// specifically to turn some std::string and std::vector into pointers
|
||||||
|
|
||||||
bool parse_torrent_file(bdecode_node const& libtorrent, error_code& ec);
|
bool parse_torrent_file(bdecode_node const& libtorrent, error_code& ec);
|
||||||
bool parse_torrent_file(bdecode_node const& libtorrent, error_code& ec, int piece_limit);
|
bool parse_torrent_file(bdecode_node const& libtorrent, error_code& ec, int piece_limit);
|
||||||
|
|
||||||
|
|
|
@ -594,6 +594,7 @@ namespace aux {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 2 the ip filter should probably be saved here too
|
||||||
void session_impl::save_state(entry* eptr, save_state_flags_t const flags) const
|
void session_impl::save_state(entry* eptr, save_state_flags_t const flags) const
|
||||||
{
|
{
|
||||||
TORRENT_ASSERT(is_single_thread());
|
TORRENT_ASSERT(is_single_thread());
|
||||||
|
|
|
@ -270,6 +270,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0;
|
||||||
SET(min_announce_interval, 5 * 60, nullptr),
|
SET(min_announce_interval, 5 * 60, nullptr),
|
||||||
SET(auto_manage_startup, 60, nullptr),
|
SET(auto_manage_startup, 60, nullptr),
|
||||||
SET(seeding_piece_quota, 20, nullptr),
|
SET(seeding_piece_quota, 20, nullptr),
|
||||||
|
// TODO: deprecate this
|
||||||
SET(max_rejects, 50, nullptr),
|
SET(max_rejects, 50, nullptr),
|
||||||
SET(recv_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),
|
SET(recv_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),
|
||||||
SET(send_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),
|
SET(send_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),
|
||||||
|
|
Loading…
Reference in New Issue