From afb3b48478e833090aef65be0d160cd0d97bc31c Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Thu, 4 Feb 2016 09:34:55 -0500 Subject: [PATCH] Swig api refactor to use byte_vector --- .../java/com/frostwire/jlibtorrent/DHT.java | 13 ++++--- .../java/com/frostwire/jlibtorrent/Entry.java | 4 +- .../com/frostwire/jlibtorrent/Session.java | 4 +- .../frostwire/jlibtorrent/TorrentInfo.java | 2 +- .../com/frostwire/jlibtorrent/Vectors.java | 17 +++++---- .../jlibtorrent/swig/bdecode_node.java | 4 +- .../com/frostwire/jlibtorrent/swig/entry.java | 8 ++-- .../jlibtorrent/swig/libtorrent_jni.java | 4 +- .../frostwire/jlibtorrent/demo/LazyRead.java | 2 +- .../jlibtorrent/demo/PartialDownload.java | 2 +- swig/libtorrent.i | 12 +++--- swig/libtorrent_jni.cpp | 30 +++++++-------- swig/libtorrent_node.cpp | 38 +++++++++---------- 13 files changed, 72 insertions(+), 68 deletions(-) diff --git a/src/main/java/com/frostwire/jlibtorrent/DHT.java b/src/main/java/com/frostwire/jlibtorrent/DHT.java index 904001d57..69e50665f 100644 --- a/src/main/java/com/frostwire/jlibtorrent/DHT.java +++ b/src/main/java/com/frostwire/jlibtorrent/DHT.java @@ -154,7 +154,7 @@ private void toggleDHT(boolean on) { * @return */ public static Sha1Hash itemTargetId(Entry e) { - return new Sha1Hash(dht_item.item_target_id(e.getSwig().bencode())); + return null;//new Sha1Hash(dht_item.item_target_id(e.getSwig().bencode())); } /** @@ -185,6 +185,7 @@ public static Sha1Hash itemTargetId(String salt, byte[] pk) { * @param sig */ public static void signMutableItem(Entry e, String salt, int seq, byte[] pk, byte[] sk, byte[] sig) { + /* if (sig == null || sig.length != Ed25519.SIGNATURE_SIZE) { throw new IllegalArgumentException("The signature array must be a valid one with length " + Ed25519.SIGNATURE_SIZE); } @@ -195,16 +196,17 @@ public static void signMutableItem(Entry e, String salt, int seq, byte[] pk, byt Vectors.bytes2char_vector(pk), Vectors.bytes2char_vector(sk), sig_v); Vectors.char_vector2bytes(sig_v, sig); + */ } public static boolean verifyMutableItem(Entry e, String salt, int seq, byte[] pk, byte[] sig) { - return dht_item.verify_mutable_item(e.getSwig().bencode(), salt, seq, + return false;/*dht_item.verify_mutable_item(e.getSwig().bencode(), salt, seq, Vectors.bytes2char_vector(pk), - Vectors.bytes2char_vector(sig)); + Vectors.bytes2char_vector(sig));*/ } public static int canonicalString(Entry e, int seq, String salt, byte[] out) { - if (out == null || out.length != 1200) { + /* if (out == null || out.length != 1200) { throw new IllegalArgumentException("The out array must be a valid one with length 1200"); } @@ -214,6 +216,7 @@ public static int canonicalString(Entry e, int seq, String salt, byte[] out) { Vectors.char_vector2bytes(out_v, out); - return r; + return r;*/ + return 0; } } diff --git a/src/main/java/com/frostwire/jlibtorrent/Entry.java b/src/main/java/com/frostwire/jlibtorrent/Entry.java index 80e06197b..297bac334 100644 --- a/src/main/java/com/frostwire/jlibtorrent/Entry.java +++ b/src/main/java/com/frostwire/jlibtorrent/Entry.java @@ -38,7 +38,7 @@ public entry getSwig() { } public byte[] bencode() { - return Vectors.char_vector2bytes(e.bencode()); + return Vectors.byte_vector2bytes(e.bencode()); } public String string() { @@ -84,7 +84,7 @@ public String toString() { } public static Entry bdecode(byte[] data) { - return new Entry(entry.bdecode(Vectors.bytes2char_vector(data))); + return new Entry(entry.bdecode(Vectors.bytes2byte_vector(data))); } public static Entry bdecode(File file) throws IOException { diff --git a/src/main/java/com/frostwire/jlibtorrent/Session.java b/src/main/java/com/frostwire/jlibtorrent/Session.java index bc6d4b520..86488f797 100644 --- a/src/main/java/com/frostwire/jlibtorrent/Session.java +++ b/src/main/java/com/frostwire/jlibtorrent/Session.java @@ -403,7 +403,7 @@ public boolean isListening() { public byte[] saveState() { entry e = new entry(); s.save_state(e); - return Vectors.char_vector2bytes(e.bencode()); + return Vectors.byte_vector2bytes(e.bencode()); } /** @@ -422,7 +422,7 @@ public byte[] saveState() { * @param data */ public void loadState(byte[] data) { - char_vector buffer = Vectors.bytes2char_vector(data); + byte_vector buffer = Vectors.bytes2byte_vector(data); bdecode_node n = new bdecode_node(); error_code ec = new error_code(); int ret = bdecode_node.bdecode(buffer, n, ec); diff --git a/src/main/java/com/frostwire/jlibtorrent/TorrentInfo.java b/src/main/java/com/frostwire/jlibtorrent/TorrentInfo.java index 6b9fcc00d..20c07e5ec 100644 --- a/src/main/java/com/frostwire/jlibtorrent/TorrentInfo.java +++ b/src/main/java/com/frostwire/jlibtorrent/TorrentInfo.java @@ -456,7 +456,7 @@ private static torrent_info bdecode0(File file) { private static torrent_info bdecode0(byte[] data) { bdecode_node n = new bdecode_node(); error_code ec = new error_code(); - int ret = bdecode_node.bdecode(Vectors.bytes2char_vector(data), n, ec); + int ret = bdecode_node.bdecode(Vectors.bytes2byte_vector(data), n, ec); if (ret == 0) { ec.clear(); diff --git a/src/main/java/com/frostwire/jlibtorrent/Vectors.java b/src/main/java/com/frostwire/jlibtorrent/Vectors.java index a839d79e2..9e5e05139 100644 --- a/src/main/java/com/frostwire/jlibtorrent/Vectors.java +++ b/src/main/java/com/frostwire/jlibtorrent/Vectors.java @@ -22,30 +22,31 @@ public static byte[] char_vector2bytes(char_vector v) { return arr; } - public static void byte_vector2bytes(byte_vector v, byte[] arr) { + public static byte[] byte_vector2bytes(byte_vector v) { int size = (int) v.size(); + byte[] arr = new byte[size]; for (int i = 0; i < size; i++) { arr[i] = v.get(i); } + + return arr; } - public static void char_vector2bytes(char_vector v, byte[] arr) { + public static void byte_vector2bytes(byte_vector v, byte[] arr) { int size = (int) v.size(); for (int i = 0; i < size; i++) { - arr[i] = (byte) v.get(i); + arr[i] = v.get(i); } } - public static String char_vector2string(char_vector v, int size) { - StringBuilder sb = new StringBuilder(size); + public static void char_vector2bytes(char_vector v, byte[] arr) { + int size = (int) v.size(); for (int i = 0; i < size; i++) { - sb.append(v.get(i)); + arr[i] = (byte) v.get(i); } - - return sb.toString(); } public static char_vector string2char_vector(String s) { diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/bdecode_node.java b/src/main/java/com/frostwire/jlibtorrent/swig/bdecode_node.java index 90c2b548d..934b508cf 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/bdecode_node.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/bdecode_node.java @@ -135,8 +135,8 @@ public static String to_string(bdecode_node e, boolean single_line, int indent) return libtorrent_jni.bdecode_node_to_string(bdecode_node.getCPtr(e), e, single_line, indent); } - public static int bdecode(char_vector buffer, bdecode_node ret, error_code ec) { - return libtorrent_jni.bdecode_node_bdecode(char_vector.getCPtr(buffer), buffer, bdecode_node.getCPtr(ret), ret, error_code.getCPtr(ec), ec); + public static int bdecode(byte_vector buffer, bdecode_node ret, error_code ec) { + return libtorrent_jni.bdecode_node_bdecode(byte_vector.getCPtr(buffer), buffer, bdecode_node.getCPtr(ret), ret, error_code.getCPtr(ec), ec); } public final static class type_t { diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/entry.java b/src/main/java/com/frostwire/jlibtorrent/swig/entry.java index 92db1e84a..78dd31753 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/entry.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/entry.java @@ -116,12 +116,12 @@ public short getM_type_queried() { return libtorrent_jni.entry_m_type_queried_get(swigCPtr, this); } - public char_vector bencode() { - return new char_vector(libtorrent_jni.entry_bencode(swigCPtr, this), true); + public byte_vector bencode() { + return new byte_vector(libtorrent_jni.entry_bencode(swigCPtr, this), true); } - public static entry bdecode(char_vector buffer) { - return new entry(libtorrent_jni.entry_bdecode(char_vector.getCPtr(buffer), buffer), true); + public static entry bdecode(byte_vector buffer) { + return new entry(libtorrent_jni.entry_bdecode(byte_vector.getCPtr(buffer), buffer), true); } public final static class data_type { diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java index 2121cab35..0fb37b765 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java @@ -666,7 +666,7 @@ public class libtorrent_jni { public final static native void entry_m_type_queried_set(long jarg1, entry jarg1_, short jarg2); public final static native short entry_m_type_queried_get(long jarg1, entry jarg1_); public final static native long entry_bencode(long jarg1, entry jarg1_); - public final static native long entry_bdecode(long jarg1, char_vector jarg1_); + public final static native long entry_bdecode(long jarg1, byte_vector jarg1_); public final static native int sha1_hash_size_get(); public final static native long new_sha1_hash__SWIG_0(); public final static native long sha1_hash_max(); @@ -2715,7 +2715,7 @@ public class libtorrent_jni { public final static native String bdecode_node_string_value(long jarg1, bdecode_node jarg1_); public final static native int bdecode_node_string_length(long jarg1, bdecode_node jarg1_); public final static native String bdecode_node_to_string(long jarg1, bdecode_node jarg1_, boolean jarg2, int jarg3); - public final static native int bdecode_node_bdecode(long jarg1, char_vector jarg1_, long jarg2, bdecode_node jarg2_, long jarg3, error_code jarg3_); + public final static native int bdecode_node_bdecode(long jarg1, byte_vector jarg1_, long jarg2, bdecode_node jarg2_, long jarg3, error_code jarg3_); public final static native void delete_bdecode_node(long jarg1); public final static native String make_magnet_uri__SWIG_0(long jarg1, torrent_handle jarg1_); public final static native String make_magnet_uri__SWIG_1(long jarg1, torrent_info jarg1_); diff --git a/src/test/java/com/frostwire/jlibtorrent/demo/LazyRead.java b/src/test/java/com/frostwire/jlibtorrent/demo/LazyRead.java index 86050ff64..88197da1d 100644 --- a/src/test/java/com/frostwire/jlibtorrent/demo/LazyRead.java +++ b/src/test/java/com/frostwire/jlibtorrent/demo/LazyRead.java @@ -24,7 +24,7 @@ public static void main(String[] args) throws Throwable { byte[] data = Utils.readFileToByteArray(torrentFile); - char_vector buffer = Vectors.bytes2char_vector(data); + byte_vector buffer = Vectors.bytes2byte_vector(data); bdecode_node e = new bdecode_node(); error_code ec = new error_code(); int ret = bdecode_node.bdecode(buffer, e, ec); diff --git a/src/test/java/com/frostwire/jlibtorrent/demo/PartialDownload.java b/src/test/java/com/frostwire/jlibtorrent/demo/PartialDownload.java index e67a38790..6a4ac89e2 100644 --- a/src/test/java/com/frostwire/jlibtorrent/demo/PartialDownload.java +++ b/src/test/java/com/frostwire/jlibtorrent/demo/PartialDownload.java @@ -25,7 +25,7 @@ public static void main(String[] args) throws Throwable { System.out.println("Using libtorrent version: " + LibTorrent.version()); byte[] data = Utils.readFileToByteArray(torrentFile); - entry e = entry.bdecode(Vectors.bytes2char_vector(data)); + entry e = entry.bdecode(Vectors.bytes2byte_vector(data)); entry_vector files = e.find_key("info").find_key("files").list().to_vector(); diff --git a/swig/libtorrent.i b/swig/libtorrent.i index b55213886..92f57c3d9 100644 --- a/swig/libtorrent.i +++ b/swig/libtorrent.i @@ -966,14 +966,14 @@ namespace libtorrent { }; %extend entry { - std::vector bencode() { - std::vector buffer; + std::vector bencode() { + std::vector buffer; libtorrent::bencode(std::back_inserter(buffer), *$self); return buffer; } - static entry bdecode(std::vector& buffer) { - return bdecode(buffer.begin(), buffer.end()); + static entry bdecode(std::vector& buffer) { + return libtorrent::bdecode(buffer.begin(), buffer.end()); } }; @@ -982,8 +982,8 @@ namespace libtorrent { return libtorrent::print_entry(e, single_line, indent); } - static int bdecode(std::vector& buffer, bdecode_node& ret, error_code& ec) { - return libtorrent::bdecode(&buffer[0], &buffer[0] + buffer.size(), ret, ec); + static int bdecode(std::vector& buffer, bdecode_node& ret, error_code& ec) { + return libtorrent::bdecode((char const*)&buffer[0], (char const*)&buffer[0] + buffer.size(), ret, ec); } }; diff --git a/swig/libtorrent_jni.cpp b/swig/libtorrent_jni.cpp index 4389801fa..57d0af7b7 100644 --- a/swig/libtorrent_jni.cpp +++ b/swig/libtorrent_jni.cpp @@ -1334,13 +1334,13 @@ SWIGINTERN void std_vector_Sl_std_pair_Sl_std_string_Sc_dht_extension_handler_li else throw std::out_of_range("vector index out of range"); } -SWIGINTERN std::vector< char > libtorrent_entry_bencode(libtorrent::entry *self){ - std::vector buffer; +SWIGINTERN std::vector< int8_t > libtorrent_entry_bencode(libtorrent::entry *self){ + std::vector buffer; libtorrent::bencode(std::back_inserter(buffer), *self); return buffer; } -SWIGINTERN libtorrent::entry libtorrent_entry_bdecode(std::vector< char > &buffer){ - return bdecode(buffer.begin(), buffer.end()); +SWIGINTERN libtorrent::entry libtorrent_entry_bdecode(std::vector< int8_t > &buffer){ + return libtorrent::bdecode(buffer.begin(), buffer.end()); } SWIGINTERN std::string libtorrent_sha1_hash_to_hex(libtorrent::sha1_hash *self){ return libtorrent::to_hex(self->to_string()); @@ -1537,8 +1537,8 @@ SWIGINTERN void libtorrent_session_handle_add_swig_extension(libtorrent::session SWIGINTERN std::string libtorrent_bdecode_node_to_string(libtorrent::bdecode_node const &e,bool single_line,int indent){ return libtorrent::print_entry(e, single_line, indent); } -SWIGINTERN int libtorrent_bdecode_node_bdecode(std::vector< char > &buffer,libtorrent::bdecode_node &ret,libtorrent::error_code &ec){ - return libtorrent::bdecode(&buffer[0], &buffer[0] + buffer.size(), ret, ec); +SWIGINTERN int libtorrent_bdecode_node_bdecode(std::vector< int8_t > &buffer,libtorrent::bdecode_node &ret,libtorrent::error_code &ec){ + return libtorrent::bdecode((char const*)&buffer[0], (char const*)&buffer[0] + buffer.size(), ret, ec); } SWIGINTERN std::string tcp_endpoint_address(tcp::endpoint *self){ return self->address().to_string(); @@ -18539,7 +18539,7 @@ SWIGEXPORT jshort JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_en SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_entry_1bencode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; libtorrent::entry *arg1 = (libtorrent::entry *) 0 ; - std::vector< char > result; + std::vector< int8_t > result; (void)jenv; (void)jcls; @@ -18554,22 +18554,22 @@ SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ent SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); } } - *(std::vector< char > **)&jresult = new std::vector< char >((const std::vector< char > &)result); + *(std::vector< int8_t > **)&jresult = new std::vector< int8_t >((const std::vector< int8_t > &)result); return jresult; } SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_entry_1bdecode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jlong jresult = 0 ; - std::vector< char > *arg1 = 0 ; + std::vector< int8_t > *arg1 = 0 ; libtorrent::entry result; (void)jenv; (void)jcls; (void)jarg1_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< int8_t > **)&jarg1; if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); return 0; } { @@ -57440,7 +57440,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_b SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1bdecode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { jint jresult = 0 ; - std::vector< char > *arg1 = 0 ; + std::vector< int8_t > *arg1 = 0 ; libtorrent::bdecode_node *arg2 = 0 ; libtorrent::error_code *arg3 = 0 ; int result; @@ -57450,9 +57450,9 @@ SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdec (void)jarg1_; (void)jarg2_; (void)jarg3_; - arg1 = *(std::vector< char > **)&jarg1; + arg1 = *(std::vector< int8_t > **)&jarg1; if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< char > & reference is null"); + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::vector< int8_t > & reference is null"); return 0; } arg2 = *(libtorrent::bdecode_node **)&jarg2; @@ -63916,7 +63916,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J (void)jenv; (void)jcls; - result = (char *)("21fdcd5374f98fec45e5697fc70af14fa57dec4e"); + result = (char *)("3f49c322e209c6cbf14886e79edd2d43820b93e0"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } diff --git a/swig/libtorrent_node.cpp b/swig/libtorrent_node.cpp index b128287a5..03c2df957 100644 --- a/swig/libtorrent_node.cpp +++ b/swig/libtorrent_node.cpp @@ -2769,13 +2769,13 @@ int SWIG_AsVal_bool (v8::Handle obj, bool *val) return SWIG_OK; } -SWIGINTERN std::vector< char > libtorrent_entry_bencode(libtorrent::entry *self){ - std::vector buffer; +SWIGINTERN std::vector< int8_t > libtorrent_entry_bencode(libtorrent::entry *self){ + std::vector buffer; libtorrent::bencode(std::back_inserter(buffer), *self); return buffer; } -SWIGINTERN libtorrent::entry libtorrent_entry_bdecode(std::vector< char > &buffer){ - return bdecode(buffer.begin(), buffer.end()); +SWIGINTERN libtorrent::entry libtorrent_entry_bdecode(std::vector< int8_t > &buffer){ + return libtorrent::bdecode(buffer.begin(), buffer.end()); } SWIGINTERN std::string libtorrent_sha1_hash_to_hex(libtorrent::sha1_hash *self){ return libtorrent::to_hex(self->to_string()); @@ -3073,8 +3073,8 @@ SWIG_AsVal_unsigned_SS_short (v8::Handle obj, unsigned short *val) SWIGINTERN std::string libtorrent_bdecode_node_to_string(libtorrent::bdecode_node const &e,bool single_line,int indent){ return libtorrent::print_entry(e, single_line, indent); } -SWIGINTERN int libtorrent_bdecode_node_bdecode(std::vector< char > &buffer,libtorrent::bdecode_node &ret,libtorrent::error_code &ec){ - return libtorrent::bdecode(&buffer[0], &buffer[0] + buffer.size(), ret, ec); +SWIGINTERN int libtorrent_bdecode_node_bdecode(std::vector< int8_t > &buffer,libtorrent::bdecode_node &ret,libtorrent::error_code &ec){ + return libtorrent::bdecode((char const*)&buffer[0], (char const*)&buffer[0] + buffer.size(), ret, ec); } SWIGINTERN std::string tcp_endpoint_address(tcp::endpoint *self){ return self->address().to_string(); @@ -25698,7 +25698,7 @@ static SwigV8ReturnValue _wrap_entry_bencode(const SwigV8Arguments &args) { libtorrent::entry *arg1 = (libtorrent::entry *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - std::vector< char > result; + std::vector< int8_t > result; if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_entry_bencode."); @@ -25708,7 +25708,7 @@ static SwigV8ReturnValue _wrap_entry_bencode(const SwigV8Arguments &args) { } arg1 = (libtorrent::entry *)(argp1); result = libtorrent_entry_bencode(arg1); - jsresult = SWIG_NewPointerObj((new std::vector< char >((const std::vector< char >&)(result))), SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_OWN | 0 ); + jsresult = SWIG_NewPointerObj((new std::vector< int8_t >((const std::vector< int8_t >&)(result))), SWIGTYPE_p_std__vectorT_signed_char_t, SWIG_POINTER_OWN | 0 ); SWIGV8_RETURN(jsresult); @@ -25723,21 +25723,21 @@ static SwigV8ReturnValue _wrap_entry_bdecode(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; + std::vector< int8_t > *arg1 = 0 ; void *argp1 = 0 ; int res1 = 0 ; libtorrent::entry result; if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_entry_bdecode."); - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "entry_bdecode" "', argument " "1"" of type '" "std::vector< char > &""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "entry_bdecode" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); } if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "entry_bdecode" "', argument " "1"" of type '" "std::vector< char > &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "entry_bdecode" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); } - arg1 = (std::vector< char > *)(argp1); + arg1 = (std::vector< int8_t > *)(argp1); result = libtorrent_entry_bdecode(*arg1); jsresult = SWIG_NewPointerObj((new libtorrent::entry((const libtorrent::entry&)(result))), SWIGTYPE_p_libtorrent__entry, SWIG_POINTER_OWN | 0 ); @@ -96531,7 +96531,7 @@ static SwigV8ReturnValue _wrap_bdecode_node_bdecode(const SwigV8Arguments &args) SWIGV8_HANDLESCOPE(); v8::Handle jsresult; - std::vector< char > *arg1 = 0 ; + std::vector< int8_t > *arg1 = 0 ; libtorrent::bdecode_node *arg2 = 0 ; libtorrent::error_code *arg3 = 0 ; void *argp1 = 0 ; @@ -96544,14 +96544,14 @@ static SwigV8ReturnValue _wrap_bdecode_node_bdecode(const SwigV8Arguments &args) if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_bdecode."); - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_char_t, 0 ); + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__vectorT_signed_char_t, 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_bdecode" "', argument " "1"" of type '" "std::vector< char > &""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_bdecode" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); } if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "bdecode_node_bdecode" "', argument " "1"" of type '" "std::vector< char > &""'"); + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "bdecode_node_bdecode" "', argument " "1"" of type '" "std::vector< int8_t > &""'"); } - arg1 = (std::vector< char > *)(argp1); + arg1 = (std::vector< int8_t > *)(argp1); res2 = SWIG_ConvertPtr(args[1], &argp2, SWIGTYPE_p_libtorrent__bdecode_node, 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bdecode_node_bdecode" "', argument " "2"" of type '" "libtorrent::bdecode_node &""'"); @@ -107766,7 +107766,7 @@ static SwigV8ReturnValue _wrap_JLIBTORRENT_REVISION_SHA1(v8::Local p v8::Handle jsresult; - jsresult = SWIG_FromCharPtr((const char *)"21fdcd5374f98fec45e5697fc70af14fa57dec4e"); + jsresult = SWIG_FromCharPtr((const char *)"3f49c322e209c6cbf14886e79edd2d43820b93e0"); SWIGV8_RETURN_INFO(jsresult, info);