-
-
Notifications
You must be signed in to change notification settings - Fork 135
/
libtorrent.java
264 lines (199 loc) · 10.8 KB
/
libtorrent.java
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.8
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.frostwire.jlibtorrent.swig;
public class libtorrent implements libtorrentConstants {
public static boolean op_eq(error_condition lhs, error_condition rhs) {
return libtorrent_jni.op_eq__SWIG_0(error_condition.getCPtr(lhs), lhs, error_condition.getCPtr(rhs), rhs);
}
public static boolean op_lt(error_condition lhs, error_condition rhs) {
return libtorrent_jni.op_lt__SWIG_0(error_condition.getCPtr(lhs), lhs, error_condition.getCPtr(rhs), rhs);
}
public static boolean op_eq(error_code lhs, error_code rhs) {
return libtorrent_jni.op_eq__SWIG_1(error_code.getCPtr(lhs), lhs, error_code.getCPtr(rhs), rhs);
}
public static boolean op_lt(error_code lhs, error_code rhs) {
return libtorrent_jni.op_lt__SWIG_1(error_code.getCPtr(lhs), lhs, error_code.getCPtr(rhs), rhs);
}
public static boolean op_neq(error_code lhs, error_code rhs) {
return libtorrent_jni.op_neq__SWIG_0(error_code.getCPtr(lhs), lhs, error_code.getCPtr(rhs), rhs);
}
public static boolean op_neq(error_condition lhs, error_condition rhs) {
return libtorrent_jni.op_neq__SWIG_1(error_condition.getCPtr(lhs), lhs, error_condition.getCPtr(rhs), rhs);
}
public static boolean op_eq(error_code code, error_condition condition) {
return libtorrent_jni.op_eq__SWIG_2(error_code.getCPtr(code), code, error_condition.getCPtr(condition), condition);
}
public static boolean op_neq(error_code lhs, error_condition rhs) {
return libtorrent_jni.op_neq__SWIG_2(error_code.getCPtr(lhs), lhs, error_condition.getCPtr(rhs), rhs);
}
public static boolean op_eq(error_condition condition, error_code code) {
return libtorrent_jni.op_eq__SWIG_3(error_condition.getCPtr(condition), condition, error_code.getCPtr(code), code);
}
public static boolean op_neq(error_condition lhs, error_code rhs) {
return libtorrent_jni.op_neq__SWIG_3(error_condition.getCPtr(lhs), lhs, error_code.getCPtr(rhs), rhs);
}
public static long hash_value(error_code ec) {
return libtorrent_jni.hash_value(error_code.getCPtr(ec), ec);
}
public static error_code make_error_code(errc_t e) {
return new error_code(libtorrent_jni.make_error_code(e.swigValue()), true);
}
public static error_condition make_error_condition(errc_t e) {
return new error_condition(libtorrent_jni.make_error_condition(e.swigValue()), true);
}
public static String version() {
return libtorrent_jni.version();
}
public static error_category get_libtorrent_category() {
return new error_category(libtorrent_jni.get_libtorrent_category(), false);
}
public static error_category get_http_category() {
return new error_category(libtorrent_jni.get_http_category(), false);
}
public static high_resolution_clock.time_point min_time() {
return new high_resolution_clock.time_point(libtorrent_jni.min_time(), true);
}
public static high_resolution_clock.time_point max_time() {
return new high_resolution_clock.time_point(libtorrent_jni.max_time(), true);
}
public static stats_metric_vector session_stats_metrics() {
return new stats_metric_vector(libtorrent_jni.session_stats_metrics(), true);
}
public static int find_metric_idx(String name) {
return libtorrent_jni.find_metric_idx(name);
}
public static close_reason_t error_to_close_reason(error_code ec) {
return close_reason_t.swigToEnum(libtorrent_jni.error_to_close_reason(error_code.getCPtr(ec), ec));
}
public static String operation_name(int op) {
return libtorrent_jni.operation_name(op);
}
public static int getUser_alert_id() {
return libtorrent_jni.user_alert_id_get();
}
public static int setting_by_name(String name) {
return libtorrent_jni.setting_by_name(name);
}
public static String name_for_setting(int s) {
return libtorrent_jni.name_for_setting(s);
}
public static void min_memory_usage(settings_pack set) {
libtorrent_jni.min_memory_usage(settings_pack.getCPtr(set), set);
}
public static void high_performance_seed(settings_pack set) {
libtorrent_jni.high_performance_seed(settings_pack.getCPtr(set), set);
}
public static void TORRENT_CFG() {
libtorrent_jni.TORRENT_CFG();
}
public static int plus_one(int val) {
return libtorrent_jni.plus_one(val);
}
public static int minus_one(int val) {
return libtorrent_jni.minus_one(val);
}
public static error_category get_bdecode_category() {
return new error_category(libtorrent_jni.get_bdecode_category(), false);
}
public static String make_magnet_uri(torrent_handle handle) {
return libtorrent_jni.make_magnet_uri__SWIG_0(torrent_handle.getCPtr(handle), handle);
}
public static String make_magnet_uri(torrent_info info) {
return libtorrent_jni.make_magnet_uri__SWIG_1(torrent_info.getCPtr(info), info);
}
public static void parse_magnet_uri(String uri, add_torrent_params p, error_code ec) {
libtorrent_jni.parse_magnet_uri(uri, add_torrent_params.getCPtr(p), p, error_code.getCPtr(ec), ec);
}
public static void add_files(file_storage fs, String file, long flags) {
libtorrent_jni.add_files__SWIG_0(file_storage.getCPtr(fs), fs, file, flags);
}
public static void add_files(file_storage fs, String file) {
libtorrent_jni.add_files__SWIG_1(file_storage.getCPtr(fs), fs, file);
}
public static void set_piece_hashes(create_torrent t, String p, error_code ec) {
libtorrent_jni.set_piece_hashes(create_torrent.getCPtr(t), t, p, error_code.getCPtr(ec), ec);
}
public static boolean is_utp_stream_logging() {
return libtorrent_jni.is_utp_stream_logging();
}
public static void set_utp_stream_logging(boolean enable) {
libtorrent_jni.set_utp_stream_logging(enable);
}
public static high_resolution_clock.duration to_seconds(long n) {
return new high_resolution_clock.duration(libtorrent_jni.to_seconds(n), true);
}
public static high_resolution_clock.duration to_milliseconds(long n) {
return new high_resolution_clock.duration(libtorrent_jni.to_milliseconds(n), true);
}
public static high_resolution_clock.duration to_microseconds(long n) {
return new high_resolution_clock.duration(libtorrent_jni.to_microseconds(n), true);
}
public static high_resolution_clock.duration to_minutes(long n) {
return new high_resolution_clock.duration(libtorrent_jni.to_minutes(n), true);
}
public static high_resolution_clock.duration to_hours(long n) {
return new high_resolution_clock.duration(libtorrent_jni.to_hours(n), true);
}
public static void ed25519_create_seed(byte_vector seed) {
libtorrent_jni.ed25519_create_seed(byte_vector.getCPtr(seed), seed);
}
public static void ed25519_create_keypair(byte_vector public_key, byte_vector private_key, byte_vector seed) {
libtorrent_jni.ed25519_create_keypair(byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key, byte_vector.getCPtr(seed), seed);
}
public static void ed25519_sign(byte_vector signature, byte_vector message, byte_vector public_key, byte_vector private_key) {
libtorrent_jni.ed25519_sign(byte_vector.getCPtr(signature), signature, byte_vector.getCPtr(message), message, byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key);
}
public static int ed25519_verify(byte_vector signature, byte_vector message, byte_vector private_key) {
return libtorrent_jni.ed25519_verify(byte_vector.getCPtr(signature), signature, byte_vector.getCPtr(message), message, byte_vector.getCPtr(private_key), private_key);
}
public static void ed25519_add_scalar(byte_vector public_key, byte_vector private_key, byte_vector scalar) {
libtorrent_jni.ed25519_add_scalar(byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key, byte_vector.getCPtr(scalar), scalar);
}
public static void ed25519_key_exchange(byte_vector shared_secret, byte_vector public_key, byte_vector private_key) {
libtorrent_jni.ed25519_key_exchange(byte_vector.getCPtr(shared_secret), shared_secret, byte_vector.getCPtr(public_key), public_key, byte_vector.getCPtr(private_key), private_key);
}
public static int dht_item_canonical_string(byte_vector v, int seq, String salt, byte_vector out) {
return libtorrent_jni.dht_item_canonical_string(byte_vector.getCPtr(v), v, seq, salt, byte_vector.getCPtr(out), out);
}
public static sha1_hash dht_item_target_id(byte_vector v) {
return new sha1_hash(libtorrent_jni.dht_item_target_id__SWIG_0(byte_vector.getCPtr(v), v), true);
}
public static sha1_hash dht_item_target_id(byte_vector salt, byte_vector pk) {
return new sha1_hash(libtorrent_jni.dht_item_target_id__SWIG_1(byte_vector.getCPtr(salt), salt, byte_vector.getCPtr(pk), pk), true);
}
public static boolean dht_verify_mutable_item(byte_vector v, String salt, int seq, byte_vector pk, byte_vector sig) {
return libtorrent_jni.dht_verify_mutable_item(byte_vector.getCPtr(v), v, salt, seq, byte_vector.getCPtr(pk), pk, byte_vector.getCPtr(sig), sig);
}
public static void dht_sign_mutable_item(byte_vector v, String salt, int seq, byte_vector pk, byte_vector sk, byte_vector sig) {
libtorrent_jni.dht_sign_mutable_item(byte_vector.getCPtr(v), v, salt, seq, byte_vector.getCPtr(pk), pk, byte_vector.getCPtr(sk), sk, byte_vector.getCPtr(sig), sig);
}
public static boolean default_storage_disk_write_access_log() {
return libtorrent_jni.default_storage_disk_write_access_log__SWIG_0();
}
public static void default_storage_disk_write_access_log(boolean enable) {
libtorrent_jni.default_storage_disk_write_access_log__SWIG_1(enable);
}
public static boolean add_files_cb(String p, add_files_listener listener) {
return libtorrent_jni.add_files_cb(p, add_files_listener.getCPtr(listener), listener);
}
public static void add_files_ex(file_storage fs, String file, long flags, add_files_listener listener) {
libtorrent_jni.add_files_ex(file_storage.getCPtr(fs), fs, file, flags, add_files_listener.getCPtr(listener), listener);
}
public static void set_piece_hashes_ex(String id, create_torrent t, String p, error_code ec, set_piece_hashes_listener listener) {
libtorrent_jni.set_piece_hashes_ex(id, create_torrent.getCPtr(t), t, p, error_code.getCPtr(ec), ec, set_piece_hashes_listener.getCPtr(listener), listener);
}
public static int boost_version() {
return libtorrent_jni.boost_version();
}
public static String boost_lib_version() {
return libtorrent_jni.boost_lib_version();
}
public static void set_posix_wrapper(posix_wrapper obj) {
libtorrent_jni.set_posix_wrapper(posix_wrapper.getCPtr(obj), obj);
}
}