forked from steeve/libtorrent-go
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathlibtorrent.swigcxx
120 lines (102 loc) · 4.12 KB
/
libtorrent.swigcxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
%module (directors="1") libtorrent
#pragma SWIG nowarn=204 // CPP #warning, ""unknown OS, assuming BSD"", ""unknown platform, assuming the longest path is 255"".
#pragma SWIG nowarn=302 // Identifier 'GetCArray' redefined (ignored) (Renamed from 'get_c_array'), previous definition of 'GetCArray' (Renamed from 'get_c_array').
#pragma SWIG nowarn=312 // Nested union not currently supported (ignored).
#pragma SWIG nowarn=314 // 'range' is a Go keyword, renaming to 'Xrange'
#pragma SWIG nowarn=315 // Nothing known about 'boost::asio::ip::tcp'.
#pragma SWIG nowarn=317 // Specialization of non-template '<name>'.
#pragma SWIG nowarn=319 // No access specifier given for base class 'boost::noncopyable' (ignored).
#pragma SWIG nowarn=325 // Nested struct not currently supported (const_iterator ignored)
#pragma SWIG nowarn=341 // The 'using' keyword in type aliasing is not fully supported yet.
#pragma SWIG nowarn=401 // Nothing known about base class '<name>'. Ignored.
#pragma SWIG nowarn=402 // Base class '<name>' is incomplete.
#pragma SWIG nowarn=451 // Setting a const char * variable may leak memory.
#pragma SWIG nowarn=503 // Can't wrap 'Operator ...' unless renamed to a valid identifier.
#pragma SWIG nowarn=516 // Overloaded method ... ignored, using ... instead.
#pragma SWIG nowarn=890 // Ignoring '...' due to Go name ('...') conflict with '...'
%{
// #include <boost/chrono.hpp>
// #include <libtorrent/time.hpp>
%}
%include <stl.i>
%include <stdint.i>
%include <typemaps.i>
#define BOOST_POSIX_API
#define BOOST_NO_TYPEID
#define BOOST_SYSTEM_CONSTEXPR
#define TORRENT_NO_DEPRECATE
namespace std {
typedef int time_t;
%template(stdVectorInt) vector<int>;
%template(stdVectorChar) vector<char>;
%template(stdVectorSizeType) vector<long long>;
%template(stdPairIntInt) pair<int, int>;
%template(stdPairStringInt) pair<string, int>;
}
namespace boost {
typedef ::int64_t int64_t;
}
namespace libtorrent
{
class time_duration;
time_duration milliseconds(int64_t n) {
return boost::chrono::milliseconds(n);
}
time_duration seconds(int64_t n) {
return boost::chrono::seconds(n);
}
}
%rename("%(camelcase)s", %$isclass) "";
%rename("%(camelcase)s", %$isvariable) "";
%rename("%(camelcase)s", %$isenumitem) "";
%rename("%(camelcase)s", %$isenum) "";
%rename("%(camelcase)s", %$istemplate) "";
%rename("%(camelcase)s", %$isfunction) "";
%rename("%(camelcase)s", %$isnamespace) "";
// These are problematic, ignore them for now
%ignore libtorrent::throw_invalid_handle;
%ignore libtorrent::web_seed_entry;
%ignore libtorrent::boosttime_deprecated_;
%ignore libtorrent::time_now_string;
%ignore libtorrent::merkle_num_leafs;
%ignore libtorrent::merkle_num_nodes;
%ignore libtorrent::merkle_get_parent;
%ignore libtorrent::trim_path_element;
%ignore libtorrent::merkle_get_sibling;
%ignore libtorrent::detail::get_symlink_path;
%ignore libtorrent::detail::get_file_attributes;
%ignore libtorrent::log_time;
%ignore libtorrent::parse_int;
%ignore libtorrent::blockinfo::setpeer;
// Windows...
%ignore libtorrent::file_status::block_special;
%ignore libtorrent::file_status::link;
%ignore libtorrent::file_status::socket;
%include <boost/preprocessor/cat.hpp>
%include <boost/version.hpp>
%include <boost/config/detail/suffix.hpp>
%include <boost/system/config.hpp>
%include <boost/asio/detail/config.hpp>
%include <boost/asio/error.hpp>
%include <boost/system/error_code.hpp>
%include <boost/system/system_error.hpp>
%include "interfaces/boost_array.i"
%include <libtorrent/config.hpp>
%include <libtorrent/export.hpp>
%include <libtorrent/version.hpp>
%include <libtorrent/build_config.hpp>
%include <libtorrent/error_code.hpp>
%include <libtorrent/error.hpp>
%include "interfaces/bitfield.i"
%include "interfaces/socket.i"
%include <libtorrent/address.hpp>
%include "interfaces/torrent_info.i"
%include <libtorrent/settings_pack.hpp>
%include <libtorrent/session_settings.hpp>
%include "interfaces/peer_info.i"
%include "interfaces/torrent_handle.i"
%include "interfaces/add_torrent_params.i"
%include "interfaces/alert.i"
%include "interfaces/alert_types.i"
%include "interfaces/create_torrent.i"
%include "interfaces/session.i"