Skip to content

Commit

Permalink
Type cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 25, 2015
1 parent 17e9d94 commit 9c91019
Show file tree
Hide file tree
Showing 11 changed files with 398 additions and 163 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions src/com/frostwire/jlibtorrent/swig/libtorrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public static long peer_priority(tcp_endpoint e1, tcp_endpoint e2) {
return libtorrent_jni.peer_priority(tcp_endpoint.getCPtr(e1), e1, tcp_endpoint.getCPtr(e2), e2);
}

public static void initialize_file_progress(SWIGTYPE_p_std__vectorT_unsigned_long_long_t file_progress, SWIGTYPE_p_piece_picker picker, file_storage fs) {
libtorrent_jni.initialize_file_progress(SWIGTYPE_p_std__vectorT_unsigned_long_long_t.getCPtr(file_progress), SWIGTYPE_p_piece_picker.getCPtr(picker), file_storage.getCPtr(fs), fs);
public static void initialize_file_progress(uint64_vector file_progress, SWIGTYPE_p_piece_picker picker, file_storage fs) {
libtorrent_jni.initialize_file_progress(uint64_vector.getCPtr(file_progress), file_progress, SWIGTYPE_p_piece_picker.getCPtr(picker), file_storage.getCPtr(fs), fs);
}

public static void min_memory_usage(SWIGTYPE_p_settings_pack set) {
Expand Down
17 changes: 12 additions & 5 deletions src/com/frostwire/jlibtorrent/swig/libtorrent_jni.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ public class libtorrent_jni {
public final static native long int64_vector_get(long jarg1, int64_vector jarg1_, int jarg2);
public final static native void int64_vector_set(long jarg1, int64_vector jarg1_, int jarg2, long jarg3);
public final static native void delete_int64_vector(long jarg1);
public final static native long new_uint64_vector();
public final static native long uint64_vector_size(long jarg1, uint64_vector jarg1_);
public final static native long uint64_vector_capacity(long jarg1, uint64_vector jarg1_);
public final static native void uint64_vector_reserve(long jarg1, uint64_vector jarg1_, long jarg2);
public final static native boolean uint64_vector_isEmpty(long jarg1, uint64_vector jarg1_);
public final static native void uint64_vector_clear(long jarg1, uint64_vector jarg1_);
public final static native void uint64_vector_add(long jarg1, uint64_vector jarg1_, java.math.BigInteger jarg2);
public final static native java.math.BigInteger uint64_vector_get(long jarg1, uint64_vector jarg1_, int jarg2);
public final static native void uint64_vector_set(long jarg1, uint64_vector jarg1_, int jarg2, java.math.BigInteger jarg3);
public final static native void delete_uint64_vector(long jarg1);
public final static native long new_sha1_hash_vector();
public final static native long sha1_hash_vector_size(long jarg1, sha1_hash_vector jarg1_);
public final static native long sha1_hash_vector_capacity(long jarg1, sha1_hash_vector jarg1_);
Expand Down Expand Up @@ -1069,7 +1079,6 @@ public class libtorrent_jni {
public final static native int torrent_handle_piece_granularity_get();
public final static native void torrent_handle_file_progress__SWIG_0(long jarg1, torrent_handle jarg1_, long jarg2, int64_vector jarg2_, int jarg3);
public final static native void torrent_handle_file_progress__SWIG_1(long jarg1, torrent_handle jarg1_, long jarg2, int64_vector jarg2_);
public final static native void torrent_handle_file_status(long jarg1, torrent_handle jarg1_, long jarg2);
public final static native void torrent_handle_clear_error(long jarg1, torrent_handle jarg1_);
public final static native long torrent_handle_trackers(long jarg1, torrent_handle jarg1_);
public final static native void torrent_handle_replace_trackers(long jarg1, torrent_handle jarg1_, long jarg2, announce_entry_vector jarg2_);
Expand Down Expand Up @@ -2300,7 +2309,7 @@ public class libtorrent_jni {
public final static native boolean session_stats_alert_discardable(long jarg1, session_stats_alert jarg1_);
public final static native void session_stats_alert_timestamp_set(long jarg1, session_stats_alert jarg1_, java.math.BigInteger jarg2);
public final static native java.math.BigInteger session_stats_alert_timestamp_get(long jarg1, session_stats_alert jarg1_);
public final static native void session_stats_alert_values_set(long jarg1, session_stats_alert jarg1_, long jarg2);
public final static native void session_stats_alert_values_set(long jarg1, session_stats_alert jarg1_, long jarg2, uint64_vector jarg2_);
public final static native long session_stats_alert_values_get(long jarg1, session_stats_alert jarg1_);
public final static native void delete_session_stats_alert(long jarg1);
public final static native long new_torrent_update_alert(long jarg1, torrent_handle jarg1_, long jarg2, sha1_hash jarg2_, long jarg3, sha1_hash jarg3_);
Expand Down Expand Up @@ -2913,8 +2922,6 @@ public class libtorrent_jni {
public final static native int peer_connection_get_priority(long jarg1, peer_connection jarg1_, int jarg2);
public final static native void peer_connection_m_send_buffer_set(long jarg1, peer_connection jarg1_, long jarg2);
public final static native long peer_connection_m_send_buffer_get(long jarg1, peer_connection jarg1_);
public final static native void peer_connection_m_extensions_set(long jarg1, peer_connection jarg1_, long jarg2);
public final static native long peer_connection_m_extensions_get(long jarg1, peer_connection jarg1_);
public final static native long new_proxy_settings__SWIG_0();
public final static native long new_proxy_settings__SWIG_1(long jarg1);
public final static native void proxy_settings_hostname_set(long jarg1, proxy_settings jarg1_, String jarg2);
Expand Down Expand Up @@ -2965,7 +2972,7 @@ public class libtorrent_jni {
public final static native int dht_settings_block_ratelimit_get(long jarg1, dht_settings jarg1_);
public final static native void delete_dht_settings(long jarg1);
public final static native int TORRENT_DEBUG_STREAMING_get();
public final static native void initialize_file_progress(long jarg1, long jarg2, long jarg3, file_storage jarg3_);
public final static native void initialize_file_progress(long jarg1, uint64_vector jarg1_, long jarg2, long jarg3, file_storage jarg3_);
public final static native void resume_data_t_buf_set(long jarg1, resume_data_t jarg1_, long jarg2, char_vector jarg2_);
public final static native long resume_data_t_buf_get(long jarg1, resume_data_t jarg1_);
public final static native long resume_data_t_entry_get(long jarg1, resume_data_t jarg1_);
Expand Down
9 changes: 0 additions & 9 deletions src/com/frostwire/jlibtorrent/swig/peer_connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -635,15 +635,6 @@ public SWIGTYPE_p_chained_buffer getM_send_buffer() {
return new SWIGTYPE_p_chained_buffer(libtorrent_jni.peer_connection_m_send_buffer_get(swigCPtr, this), true);
}

public void setM_extensions(SWIGTYPE_p_std__listT_boost__shared_ptrT_libtorrent__peer_plugin_t_t value) {
libtorrent_jni.peer_connection_m_extensions_set(swigCPtr, this, SWIGTYPE_p_std__listT_boost__shared_ptrT_libtorrent__peer_plugin_t_t.getCPtr(value));
}

public SWIGTYPE_p_std__listT_boost__shared_ptrT_libtorrent__peer_plugin_t_t getM_extensions() {
long cPtr = libtorrent_jni.peer_connection_m_extensions_get(swigCPtr, this);
return (cPtr == 0) ? null : new SWIGTYPE_p_std__listT_boost__shared_ptrT_libtorrent__peer_plugin_t_t(cPtr, false);
}

public enum connection_type {
bittorrent_connection(libtorrent_jni.peer_connection_bittorrent_connection_get()),
url_seed_connection(libtorrent_jni.peer_connection_url_seed_connection_get()),
Expand Down
8 changes: 4 additions & 4 deletions src/com/frostwire/jlibtorrent/swig/session_stats_alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public java.math.BigInteger getTimestamp() {
return libtorrent_jni.session_stats_alert_timestamp_get(swigCPtr, this);
}

public void setValues(SWIGTYPE_p_std__vectorT_unsigned_long_long_t value) {
libtorrent_jni.session_stats_alert_values_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_unsigned_long_long_t.getCPtr(value));
public void setValues(uint64_vector value) {
libtorrent_jni.session_stats_alert_values_set(swigCPtr, this, uint64_vector.getCPtr(value), value);
}

public SWIGTYPE_p_std__vectorT_unsigned_long_long_t getValues() {
public uint64_vector getValues() {
long cPtr = libtorrent_jni.session_stats_alert_values_get(swigCPtr, this);
return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_unsigned_long_long_t(cPtr, false);
return (cPtr == 0) ? null : new uint64_vector(cPtr, false);
}

public final static int alert_type = libtorrent_jni.session_stats_alert_alert_type_get();
Expand Down
4 changes: 0 additions & 4 deletions src/com/frostwire/jlibtorrent/swig/torrent_handle.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ public void file_progress(int64_vector progress) {
libtorrent_jni.torrent_handle_file_progress__SWIG_1(swigCPtr, this, int64_vector.getCPtr(progress), progress);
}

public void file_status(SWIGTYPE_p_std__vectorT_pool_file_status_t status) {
libtorrent_jni.torrent_handle_file_status(swigCPtr, this, SWIGTYPE_p_std__vectorT_pool_file_status_t.getCPtr(status));
}

public void clear_error() {
libtorrent_jni.torrent_handle_clear_error(swigCPtr, this);
}
Expand Down
74 changes: 74 additions & 0 deletions src/com/frostwire/jlibtorrent/swig/uint64_vector.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.5
*
* 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 uint64_vector {
private long swigCPtr;
protected boolean swigCMemOwn;

protected uint64_vector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}

protected static long getCPtr(uint64_vector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}

protected void finalize() {
delete();
}

public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
libtorrent_jni.delete_uint64_vector(swigCPtr);
}
swigCPtr = 0;
}
}

public uint64_vector() {
this(libtorrent_jni.new_uint64_vector(), true);
}

public long size() {
return libtorrent_jni.uint64_vector_size(swigCPtr, this);
}

public long capacity() {
return libtorrent_jni.uint64_vector_capacity(swigCPtr, this);
}

public void reserve(long n) {
libtorrent_jni.uint64_vector_reserve(swigCPtr, this, n);
}

public boolean isEmpty() {
return libtorrent_jni.uint64_vector_isEmpty(swigCPtr, this);
}

public void clear() {
libtorrent_jni.uint64_vector_clear(swigCPtr, this);
}

public void add(java.math.BigInteger x) {
libtorrent_jni.uint64_vector_add(swigCPtr, this, x);
}

public java.math.BigInteger get(int i) {
return libtorrent_jni.uint64_vector_get(swigCPtr, this, i);
}

public void set(int i, java.math.BigInteger val) {
libtorrent_jni.uint64_vector_set(swigCPtr, this, i, val);
}

}
5 changes: 4 additions & 1 deletion swig/libtorrent.i
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ namespace std {
%template(unsigned_char_vector) vector<unsigned char>;
%template(int_vector) vector<int>;
%template(int64_vector) vector<long long>;
%template(uint64_vector) vector<unsigned long long>;
%template(sha1_hash_vector) vector<libtorrent::sha1_hash>;
%template(torrent_status_vector) vector<libtorrent::torrent_status>;
%template(torrent_handle_vector) vector<libtorrent::torrent_handle>;
Expand All @@ -315,7 +316,7 @@ namespace std {
%template(peer_request_vector) vector<libtorrent::peer_request>;
%template(dht_routing_bucket_vector) vector<libtorrent::dht_routing_bucket>;
%template(dht_lookup_vector) vector<libtorrent::dht_lookup>;

%template(partial_piece_info_vector) vector<libtorrent::partial_piece_info>;
%template(cached_piece_info_vector) vector<libtorrent::cached_piece_info>;
%template(peer_info_vector) vector<libtorrent::peer_info>;
Expand Down Expand Up @@ -476,6 +477,7 @@ namespace std {
%ignore libtorrent::peer_connection::append_const_send_buffer;
%ignore libtorrent::peer_connection::append_send_buffer;
%ignore libtorrent::peer_connection::m_allocator;
%ignore libtorrent::peer_connection::m_extensions;
%ignore libtorrent::bt_peer_connection::send_buffer;
%ignore libtorrent::bt_peer_connection::write_metadata;
%ignore libtorrent::bt_peer_connection::write_metadata_request;
Expand Down Expand Up @@ -512,6 +514,7 @@ namespace std {
%ignore libtorrent::torrent_handle::url_seeds;
%ignore libtorrent::torrent_handle::native_handle;
%ignore libtorrent::torrent_handle::get_storage_impl;
%ignore libtorrent::torrent_handle::file_status;
%ignore libtorrent::sha1_hash::sha1_hash(char const *);
%ignore libtorrent::sha1_hash::begin;
%ignore libtorrent::sha1_hash::end;
Expand Down

0 comments on commit 9c91019

Please sign in to comment.