diff --git a/src/main/java/com/frostwire/jlibtorrent/demo/LazyRead.java b/src/main/java/com/frostwire/jlibtorrent/demo/LazyRead.java index e92db4924..86050ff64 100644 --- a/src/main/java/com/frostwire/jlibtorrent/demo/LazyRead.java +++ b/src/main/java/com/frostwire/jlibtorrent/demo/LazyRead.java @@ -38,6 +38,6 @@ public static void main(String[] args) throws Throwable { torrent_info ti = new torrent_info(e, ec); System.out.println(new Sha1Hash(ti.info_hash())); - System.out.println(libtorrent.print_entry(e)); + System.out.println(bdecode_node.to_string(e, false, 0)); } } 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 2a1c66d69..90c2b548d 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/bdecode_node.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/bdecode_node.java @@ -51,12 +51,8 @@ public boolean op_bool() { return libtorrent_jni.bdecode_node_op_bool(swigCPtr, this); } - public bdecode_node non_owning() { - return new bdecode_node(libtorrent_jni.bdecode_node_non_owning(swigCPtr, this), true); - } - - public char_const_ptr_int_pair data_section() { - return new char_const_ptr_int_pair(libtorrent_jni.bdecode_node_data_section(swigCPtr, this), true); + public bdecode_node list_at(int i) { + return new bdecode_node(libtorrent_jni.bdecode_node_list_at(swigCPtr, this, i), true); } public String list_string_value_at(int i, String default_val) { @@ -131,28 +127,12 @@ public String string_value() { return libtorrent_jni.bdecode_node_string_value(swigCPtr, this); } - public String string_ptr() { - return libtorrent_jni.bdecode_node_string_ptr(swigCPtr, this); - } - public int string_length() { return libtorrent_jni.bdecode_node_string_length(swigCPtr, this); } - public void clear() { - libtorrent_jni.bdecode_node_clear(swigCPtr, this); - } - - public void swap(bdecode_node n) { - libtorrent_jni.bdecode_node_swap(swigCPtr, this, bdecode_node.getCPtr(n), n); - } - - public void reserve(int tokens) { - libtorrent_jni.bdecode_node_reserve(swigCPtr, this, tokens); - } - - public void switch_underlying_buffer(String buf) { - libtorrent_jni.bdecode_node_switch_underlying_buffer(swigCPtr, this, buf); + 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) { diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/char_const_ptr_int_pair.java b/src/main/java/com/frostwire/jlibtorrent/swig/char_const_ptr_int_pair.java deleted file mode 100644 index 2721ab436..000000000 --- a/src/main/java/com/frostwire/jlibtorrent/swig/char_const_ptr_int_pair.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 char_const_ptr_int_pair { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected char_const_ptr_int_pair(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(char_const_ptr_int_pair 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_char_const_ptr_int_pair(swigCPtr); - } - swigCPtr = 0; - } - } - - public char_const_ptr_int_pair() { - this(libtorrent_jni.new_char_const_ptr_int_pair__SWIG_0(), true); - } - - public char_const_ptr_int_pair(String first, int second) { - this(libtorrent_jni.new_char_const_ptr_int_pair__SWIG_1(first, second), true); - } - - public char_const_ptr_int_pair(char_const_ptr_int_pair p) { - this(libtorrent_jni.new_char_const_ptr_int_pair__SWIG_2(char_const_ptr_int_pair.getCPtr(p), p), true); - } - - public void setFirst(String value) { - libtorrent_jni.char_const_ptr_int_pair_first_set(swigCPtr, this, value); - } - - public String getFirst() { - return libtorrent_jni.char_const_ptr_int_pair_first_get(swigCPtr, this); - } - - public void setSecond(int value) { - libtorrent_jni.char_const_ptr_int_pair_second_set(swigCPtr, this, value); - } - - public int getSecond() { - return libtorrent_jni.char_const_ptr_int_pair_second_get(swigCPtr, this); - } - -} diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java index d3ec6b8f8..10b03671c 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java @@ -141,18 +141,6 @@ public static error_category get_bdecode_category() { return new error_category(libtorrent_jni.get_bdecode_category(), false); } - public static String print_entry(bdecode_node e, boolean single_line, int indent) { - return libtorrent_jni.print_entry__SWIG_0(bdecode_node.getCPtr(e), e, single_line, indent); - } - - public static String print_entry(bdecode_node e, boolean single_line) { - return libtorrent_jni.print_entry__SWIG_1(bdecode_node.getCPtr(e), e, single_line); - } - - public static String print_entry(bdecode_node e) { - return libtorrent_jni.print_entry__SWIG_2(bdecode_node.getCPtr(e), e); - } - public static String make_magnet_uri(torrent_handle handle) { return libtorrent_jni.make_magnet_uri__SWIG_0(torrent_handle.getCPtr(handle), handle); } 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 5cf92b870..e2fc675e8 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java @@ -25,14 +25,6 @@ public class libtorrent_jni { } } - public final static native long new_char_const_ptr_int_pair__SWIG_0(); - public final static native long new_char_const_ptr_int_pair__SWIG_1(String jarg1, int jarg2); - public final static native long new_char_const_ptr_int_pair__SWIG_2(long jarg1, char_const_ptr_int_pair jarg1_); - public final static native void char_const_ptr_int_pair_first_set(long jarg1, char_const_ptr_int_pair jarg1_, String jarg2); - public final static native String char_const_ptr_int_pair_first_get(long jarg1, char_const_ptr_int_pair jarg1_); - public final static native void char_const_ptr_int_pair_second_set(long jarg1, char_const_ptr_int_pair jarg1_, int jarg2); - public final static native int char_const_ptr_int_pair_second_get(long jarg1, char_const_ptr_int_pair jarg1_); - public final static native void delete_char_const_ptr_int_pair(long jarg1); public final static native long new_int_int_pair__SWIG_0(); public final static native long new_int_int_pair__SWIG_1(int jarg1, int jarg2); public final static native long new_int_int_pair__SWIG_2(long jarg1, int_int_pair jarg1_); @@ -2692,8 +2684,7 @@ public class libtorrent_jni { public final static native long new_bdecode_node__SWIG_1(long jarg1, bdecode_node jarg1_); public final static native int bdecode_node_type(long jarg1, bdecode_node jarg1_); public final static native boolean bdecode_node_op_bool(long jarg1, bdecode_node jarg1_); - public final static native long bdecode_node_non_owning(long jarg1, bdecode_node jarg1_); - public final static native long bdecode_node_data_section(long jarg1, bdecode_node jarg1_); + public final static native long bdecode_node_list_at(long jarg1, bdecode_node jarg1_, int jarg2); public final static native String bdecode_node_list_string_value_at__SWIG_0(long jarg1, bdecode_node jarg1_, int jarg2, String jarg3); public final static native String bdecode_node_list_string_value_at__SWIG_1(long jarg1, bdecode_node jarg1_, int jarg2); public final static native long bdecode_node_list_int_value_at__SWIG_0(long jarg1, bdecode_node jarg1_, int jarg2, long jarg3); @@ -2712,17 +2703,10 @@ public class libtorrent_jni { public final static native int bdecode_node_dict_size(long jarg1, bdecode_node jarg1_); public final static native long bdecode_node_int_value(long jarg1, bdecode_node jarg1_); public final static native String bdecode_node_string_value(long jarg1, bdecode_node jarg1_); - public final static native String bdecode_node_string_ptr(long jarg1, bdecode_node jarg1_); public final static native int bdecode_node_string_length(long jarg1, bdecode_node jarg1_); - public final static native void bdecode_node_clear(long jarg1, bdecode_node jarg1_); - public final static native void bdecode_node_swap(long jarg1, bdecode_node jarg1_, long jarg2, bdecode_node jarg2_); - public final static native void bdecode_node_reserve(long jarg1, bdecode_node jarg1_, int jarg2); - public final static native void bdecode_node_switch_underlying_buffer(long jarg1, bdecode_node jarg1_, String jarg2); + 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 void delete_bdecode_node(long jarg1); - public final static native String print_entry__SWIG_0(long jarg1, bdecode_node jarg1_, boolean jarg2, int jarg3); - public final static native String print_entry__SWIG_1(long jarg1, bdecode_node jarg1_, boolean jarg2); - public final static native String print_entry__SWIG_2(long jarg1, bdecode_node 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_); public final static native void parse_magnet_uri(String jarg1, long jarg2, add_torrent_params jarg2_, long jarg3, error_code jarg3_); diff --git a/swig/libtorrent.i b/swig/libtorrent.i index 53dfa35d7..ed94e3921 100644 --- a/swig/libtorrent.i +++ b/swig/libtorrent.i @@ -356,7 +356,6 @@ namespace std { typedef long time_t; namespace std { - %template(char_const_ptr_int_pair) pair; %template(int_int_pair) pair; %template(string_int_pair) pair; %template(string_string_pair) pair; @@ -446,6 +445,7 @@ namespace std { %ignore libtorrent::block_cache_reference; %ignore libtorrent::torrent_hot_members; %ignore libtorrent::storage_piece_set; +%ignore libtorrent::print_entry; %ignore libtorrent::to_string(size_type); %ignore libtorrent::read_until; @@ -573,10 +573,14 @@ namespace std { %ignore libtorrent::peer_plugin::on_extended; %ignore libtorrent::peer_plugin::on_unknown_message; %ignore libtorrent::bdecode_node::dict_find(char const *) const; -%ignore libtorrent::bdecode_node::list_at(int) const; -%ignore libtorrent::bdecode_node::dict_find(std::string const &); -%ignore libtorrent::bdecode_node::dict_find(std::string const &) const; %ignore libtorrent::bdecode_node::dict_find_dict(char const *) const; +%ignore libtorrent::bdecode_node::non_owning; +%ignore libtorrent::bdecode_node::data_section; +%ignore libtorrent::bdecode_node::string_ptr; +%ignore libtorrent::bdecode_node::clear; +%ignore libtorrent::bdecode_node::swap; +%ignore libtorrent::bdecode_node::reserve; +%ignore libtorrent::bdecode_node::switch_underlying_buffer; %ignore libtorrent::errors::make_error_code; %ignore libtorrent::bdecode_errors::make_error_code; %ignore libtorrent::set_bits; @@ -1023,6 +1027,10 @@ namespace libtorrent { }; %extend bdecode_node { + static std::string to_string(bdecode_node const& e, bool single_line, int indent) { + 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); } diff --git a/swig/libtorrent_jni.cpp b/swig/libtorrent_jni.cpp index 68baa4fee..f7faca079 100644 --- a/swig/libtorrent_jni.cpp +++ b/swig/libtorrent_jni.cpp @@ -1579,6 +1579,9 @@ SWIGINTERN void libtorrent_session_handle_dht_put_item__SWIG_1(libtorrent::sessi SWIGINTERN void libtorrent_session_handle_add_swig_extension(libtorrent::session_handle *self,swig_plugin *p){ self->add_extension(boost::shared_ptr(p)); } +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); } @@ -4165,168 +4168,6 @@ void SwigDirector_posix_wrapper::swig_connect_director(JNIEnv *jenv, jobject jse extern "C" { #endif -SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1char_1const_1ptr_1int_1pair_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - std::pair< char const *,int > *result = 0 ; - - (void)jenv; - (void)jcls; - { - try { - result = (std::pair< char const *,int > *)new std::pair< char const *,int >(); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - *(std::pair< char const *,int > **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1char_1const_1ptr_1int_1pair_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - int arg2 ; - std::pair< char const *,int > *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (int)jarg2; - { - try { - result = (std::pair< char const *,int > *)new std::pair< char const *,int >((char const *)arg1,arg2); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - *(std::pair< char const *,int > **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1char_1const_1ptr_1int_1pair_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - std::pair< char const *,int > *arg1 = 0 ; - std::pair< char const *,int > *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(std::pair< char const *,int > **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "std::pair< char const *,int > const & reference is null"); - return 0; - } - { - try { - result = (std::pair< char const *,int > *)new std::pair< char const *,int >((std::pair< char const *,int > const &)*arg1); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - *(std::pair< char const *,int > **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_char_1const_1ptr_1int_1pair_1first_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(std::pair< char const *,int > **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - { - if (arg2) { - arg1->first = (char const *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->first, (const char *)arg2); - } else { - arg1->first = 0; - } - } - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_char_1const_1ptr_1int_1pair_1first_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(std::pair< char const *,int > **)&jarg1; - result = (char *) ((arg1)->first); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_char_1const_1ptr_1int_1pair_1second_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - int arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(std::pair< char const *,int > **)&jarg1; - arg2 = (int)jarg2; - if (arg1) (arg1)->second = arg2; -} - - -SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_char_1const_1ptr_1int_1pair_1second_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(std::pair< char const *,int > **)&jarg1; - result = (int) ((arg1)->second); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1char_1const_1ptr_1int_1pair(JNIEnv *jenv, jclass jcls, jlong jarg1) { - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(std::pair< char const *,int > **)&jarg1; - { - try { - delete arg1; - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1int_1int_1pair_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; std::pair< int,int > *result = 0 ; @@ -56820,18 +56661,20 @@ SWIGEXPORT jboolean JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_ } -SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1non_1owning(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { +SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1list_1at(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { jlong jresult = 0 ; libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; + int arg2 ; libtorrent::bdecode_node result; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(libtorrent::bdecode_node **)&jarg1; + arg2 = (int)jarg2; { try { - result = ((libtorrent::bdecode_node const *)arg1)->non_owning(); + result = ((libtorrent::bdecode_node const *)arg1)->list_at(arg2); } catch (std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); } catch (...) { @@ -56843,29 +56686,6 @@ SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bde } -SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1data_1section(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - std::pair< char const *,int > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - { - try { - result = ((libtorrent::bdecode_node const *)arg1)->data_section(); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - *(std::pair< char const *,int > **)&jresult = new std::pair< char const *,int >((const std::pair< char const *,int > &)result); - return jresult; -} - - SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1list_1string_1value_1at_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) { jstring jresult = 0 ; libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; @@ -57375,29 +57195,6 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_b } -SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1string_1ptr(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - { - try { - result = (char *)((libtorrent::bdecode_node const *)arg1)->string_ptr(); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1string_1length(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jint jresult = 0 ; libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; @@ -57421,95 +57218,34 @@ SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdec } -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - { - try { - (arg1)->clear(); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1swap(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - libtorrent::bdecode_node *arg2 = 0 ; +SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1to_1string(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jint jarg3) { + jstring jresult = 0 ; + libtorrent::bdecode_node *arg1 = 0 ; + bool arg2 ; + int arg3 ; + std::string result; (void)jenv; (void)jcls; (void)jarg1_; - (void)jarg2_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - arg2 = *(libtorrent::bdecode_node **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::bdecode_node & reference is null"); - return ; + arg1 = *(libtorrent::bdecode_node **)&jarg1; + if (!arg1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::bdecode_node const & reference is null"); + return 0; } + arg2 = jarg2 ? true : false; + arg3 = (int)jarg3; { try { - (arg1)->swap(*arg2); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1reserve(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - int arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - arg2 = (int)jarg2; - { - try { - (arg1)->reserve(arg2); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } -} - - -SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_bdecode_1node_1switch_1underlying_1buffer(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - { - try { - (arg1)->switch_underlying_buffer((char const *)arg2); + result = libtorrent_bdecode_node_to_string((libtorrent::bdecode_node const &)*arg1,arg2,arg3); } catch (std::exception& e) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); } catch (...) { SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); } } - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + jresult = jenv->NewStringUTF((&result)->c_str()); + return jresult; } @@ -57572,93 +57308,6 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_dele } -SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_print_1entry_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jint jarg3) { - jstring jresult = 0 ; - libtorrent::bdecode_node *arg1 = 0 ; - bool arg2 ; - int arg3 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::bdecode_node const & reference is null"); - return 0; - } - arg2 = jarg2 ? true : false; - arg3 = (int)jarg3; - { - try { - result = libtorrent::print_entry((libtorrent::bdecode_node const &)*arg1,arg2,arg3); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_print_1entry_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jstring jresult = 0 ; - libtorrent::bdecode_node *arg1 = 0 ; - bool arg2 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::bdecode_node const & reference is null"); - return 0; - } - arg2 = jarg2 ? true : false; - { - try { - result = libtorrent::print_entry((libtorrent::bdecode_node const &)*arg1,arg2); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_print_1entry_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - libtorrent::bdecode_node *arg1 = 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(libtorrent::bdecode_node **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::bdecode_node const & reference is null"); - return 0; - } - { - try { - result = libtorrent::print_entry((libtorrent::bdecode_node const &)*arg1); - } catch (std::exception& e) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); - } catch (...) { - SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); - } - } - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_make_1magnet_1uri_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; libtorrent::torrent_handle *arg1 = 0 ; @@ -64275,7 +63924,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_L (void)jenv; (void)jcls; - result = (char *)("930a33b59c49965a8a2caa13517b21e3142078af"); + result = (char *)("b7a6d8114ea7144f4c912c35d9ba2bbaacd51968"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } @@ -64287,7 +63936,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J (void)jenv; (void)jcls; - result = (char *)("864305be12ea95f6f32ffd7621db705e967a26f2"); + result = (char *)("9c9b3580a9f7888746c6c49019a05a1215f0c140"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } diff --git a/swig/libtorrent_node.cpp b/swig/libtorrent_node.cpp index a32465693..87897952b 100644 --- a/swig/libtorrent_node.cpp +++ b/swig/libtorrent_node.cpp @@ -1661,56 +1661,55 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local< #define SWIGTYPE_p_std__mapT_int_libtorrent__sha1_hash_t swig_types[180] #define SWIGTYPE_p_std__mapT_std__string_libtorrent__entry_t swig_types[181] #define SWIGTYPE_p_std__mapT_std__string_long_t swig_types[182] -#define SWIGTYPE_p_std__pairT_char_const_p_int_t swig_types[183] -#define SWIGTYPE_p_std__pairT_int_int_t swig_types[184] -#define SWIGTYPE_p_std__pairT_std__string_dht_extension_handler_listener_p_t swig_types[185] -#define SWIGTYPE_p_std__pairT_std__string_int_t swig_types[186] -#define SWIGTYPE_p_std__pairT_std__string_libtorrent__bdecode_node_t swig_types[187] -#define SWIGTYPE_p_std__pairT_std__string_std__string_t swig_types[188] -#define SWIGTYPE_p_std__runtime_error swig_types[189] -#define SWIGTYPE_p_std__vectorT_char_t swig_types[190] -#define SWIGTYPE_p_std__vectorT_int_t swig_types[191] -#define SWIGTYPE_p_std__vectorT_libtorrent__alert_p_t swig_types[192] -#define SWIGTYPE_p_std__vectorT_libtorrent__announce_entry_t swig_types[193] -#define SWIGTYPE_p_std__vectorT_libtorrent__dht_lookup_t swig_types[194] -#define SWIGTYPE_p_std__vectorT_libtorrent__dht_routing_bucket_t swig_types[195] -#define SWIGTYPE_p_std__vectorT_libtorrent__entry_t swig_types[196] -#define SWIGTYPE_p_std__vectorT_libtorrent__file_slice_t swig_types[197] -#define SWIGTYPE_p_std__vectorT_libtorrent__partial_piece_info_t swig_types[198] -#define SWIGTYPE_p_std__vectorT_libtorrent__peer_connection_handle_t swig_types[199] -#define SWIGTYPE_p_std__vectorT_libtorrent__peer_info_t swig_types[200] -#define SWIGTYPE_p_std__vectorT_libtorrent__peer_list_entry_t swig_types[201] -#define SWIGTYPE_p_std__vectorT_libtorrent__sha1_hash_t swig_types[202] -#define SWIGTYPE_p_std__vectorT_libtorrent__stats_metric_t swig_types[203] -#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_handle_t swig_types[204] -#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_status_t swig_types[205] -#define SWIGTYPE_p_std__vectorT_libtorrent__web_seed_entry_t swig_types[206] -#define SWIGTYPE_p_std__vectorT_long_long_t swig_types[207] -#define SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t swig_types[208] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_boost__functionT_bool_fudp__endpoint_const_R_libtorrent__bdecode_node_const_R_libtorrent__entry_RF_t_t_t swig_types[209] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_dht_extension_handler_listener_p_t_t swig_types[210] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_int_t_t swig_types[211] -#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_std__string_t_t swig_types[212] -#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[213] -#define SWIGTYPE_p_std__vectorT_tcp__endpoint_t swig_types[214] -#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[215] -#define SWIGTYPE_p_string_type swig_types[216] -#define SWIGTYPE_p_swig_peer_plugin swig_types[217] -#define SWIGTYPE_p_swig_plugin swig_types[218] -#define SWIGTYPE_p_swig_storage swig_types[219] -#define SWIGTYPE_p_swig_storage_constructor swig_types[220] -#define SWIGTYPE_p_swig_torrent_plugin swig_types[221] -#define SWIGTYPE_p_tailqueueT_libtorrent__disk_io_job_t swig_types[222] -#define SWIGTYPE_p_tcp__endpoint swig_types[223] -#define SWIGTYPE_p_udp__endpoint swig_types[224] -#define SWIGTYPE_p_unsigned_char swig_types[225] -#define SWIGTYPE_p_unsigned_int swig_types[226] -#define SWIGTYPE_p_unsigned_long_long swig_types[227] -#define SWIGTYPE_p_unsigned_short swig_types[228] -#define SWIGTYPE_p_unspecified_bool_type swig_types[229] -#define SWIGTYPE_p_value_type swig_types[230] -static swig_type_info *swig_types[232]; -static swig_module_info swig_module = {swig_types, 231, 0, 0, 0, 0}; +#define SWIGTYPE_p_std__pairT_int_int_t swig_types[183] +#define SWIGTYPE_p_std__pairT_std__string_dht_extension_handler_listener_p_t swig_types[184] +#define SWIGTYPE_p_std__pairT_std__string_int_t swig_types[185] +#define SWIGTYPE_p_std__pairT_std__string_libtorrent__bdecode_node_t swig_types[186] +#define SWIGTYPE_p_std__pairT_std__string_std__string_t swig_types[187] +#define SWIGTYPE_p_std__runtime_error swig_types[188] +#define SWIGTYPE_p_std__vectorT_char_t swig_types[189] +#define SWIGTYPE_p_std__vectorT_int_t swig_types[190] +#define SWIGTYPE_p_std__vectorT_libtorrent__alert_p_t swig_types[191] +#define SWIGTYPE_p_std__vectorT_libtorrent__announce_entry_t swig_types[192] +#define SWIGTYPE_p_std__vectorT_libtorrent__dht_lookup_t swig_types[193] +#define SWIGTYPE_p_std__vectorT_libtorrent__dht_routing_bucket_t swig_types[194] +#define SWIGTYPE_p_std__vectorT_libtorrent__entry_t swig_types[195] +#define SWIGTYPE_p_std__vectorT_libtorrent__file_slice_t swig_types[196] +#define SWIGTYPE_p_std__vectorT_libtorrent__partial_piece_info_t swig_types[197] +#define SWIGTYPE_p_std__vectorT_libtorrent__peer_connection_handle_t swig_types[198] +#define SWIGTYPE_p_std__vectorT_libtorrent__peer_info_t swig_types[199] +#define SWIGTYPE_p_std__vectorT_libtorrent__peer_list_entry_t swig_types[200] +#define SWIGTYPE_p_std__vectorT_libtorrent__sha1_hash_t swig_types[201] +#define SWIGTYPE_p_std__vectorT_libtorrent__stats_metric_t swig_types[202] +#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_handle_t swig_types[203] +#define SWIGTYPE_p_std__vectorT_libtorrent__torrent_status_t swig_types[204] +#define SWIGTYPE_p_std__vectorT_libtorrent__web_seed_entry_t swig_types[205] +#define SWIGTYPE_p_std__vectorT_long_long_t swig_types[206] +#define SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t swig_types[207] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_boost__functionT_bool_fudp__endpoint_const_R_libtorrent__bdecode_node_const_R_libtorrent__entry_RF_t_t_t swig_types[208] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_dht_extension_handler_listener_p_t_t swig_types[209] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_int_t_t swig_types[210] +#define SWIGTYPE_p_std__vectorT_std__pairT_std__string_std__string_t_t swig_types[211] +#define SWIGTYPE_p_std__vectorT_std__string_t swig_types[212] +#define SWIGTYPE_p_std__vectorT_tcp__endpoint_t swig_types[213] +#define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[214] +#define SWIGTYPE_p_string_type swig_types[215] +#define SWIGTYPE_p_swig_peer_plugin swig_types[216] +#define SWIGTYPE_p_swig_plugin swig_types[217] +#define SWIGTYPE_p_swig_storage swig_types[218] +#define SWIGTYPE_p_swig_storage_constructor swig_types[219] +#define SWIGTYPE_p_swig_torrent_plugin swig_types[220] +#define SWIGTYPE_p_tailqueueT_libtorrent__disk_io_job_t swig_types[221] +#define SWIGTYPE_p_tcp__endpoint swig_types[222] +#define SWIGTYPE_p_udp__endpoint swig_types[223] +#define SWIGTYPE_p_unsigned_char swig_types[224] +#define SWIGTYPE_p_unsigned_int swig_types[225] +#define SWIGTYPE_p_unsigned_long_long swig_types[226] +#define SWIGTYPE_p_unsigned_short swig_types[227] +#define SWIGTYPE_p_unspecified_bool_type swig_types[228] +#define SWIGTYPE_p_value_type swig_types[229] +static swig_type_info *swig_types[231]; +static swig_module_info swig_module = {swig_types, 230, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -1950,6 +1949,25 @@ class dht_item { #include +SWIGINTERN +int SWIG_AsVal_int (v8::Handle valRef, int* val) +{ + if (!valRef->IsNumber()) { + return SWIG_TypeError; + } + if(val) *val = valRef->IntegerValue(); + + return SWIG_OK; +} + + +SWIGINTERNINLINE +v8::Handle SWIG_From_int (int value) +{ + return SWIGV8_INT32_NEW(value); +} + + SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { @@ -2000,52 +2018,6 @@ SWIG_AsCharPtrAndSize(v8::Handle valRef, char** cptr, size_t* psize, } - - - -SWIGINTERN -int SWIG_AsVal_int (v8::Handle valRef, int* val) -{ - if (!valRef->IsNumber()) { - return SWIG_TypeError; - } - if(val) *val = valRef->IntegerValue(); - - return SWIG_OK; -} - - -SWIGINTERNINLINE v8::Handle -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - // TODO: handle extra long strings - return SWIGV8_UNDEFINED(); - } else { - v8::Handle js_str = SWIGV8_STRING_NEW2(carray, size); - return js_str; - } - } else { - return SWIGV8_UNDEFINED(); - } -} - - -SWIGINTERNINLINE v8::Handle -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERNINLINE -v8::Handle SWIG_From_int (int value) -{ - return SWIGV8_INT32_NEW(value); -} - - SWIGINTERN int SWIG_AsPtr_std_string (v8::Handle obj, std::string **val) { @@ -2077,6 +2049,23 @@ SWIG_AsPtr_std_string (v8::Handle obj, std::string **val) } +SWIGINTERNINLINE v8::Handle +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + // TODO: handle extra long strings + return SWIGV8_UNDEFINED(); + } else { + v8::Handle js_str = SWIGV8_STRING_NEW2(carray, size); + return js_str; + } + } else { + return SWIGV8_UNDEFINED(); + } +} + + SWIGINTERNINLINE v8::Handle SWIG_From_std_string (const std::string& s) { @@ -2755,6 +2744,13 @@ SWIGINTERN void std_vector_Sl_std_pair_Sl_std_string_Sc_dht_extension_handler_li throw std::out_of_range("vector index out of range"); } +SWIGINTERNINLINE v8::Handle +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + SWIGINTERN int SWIG_AsVal_unsigned_SS_int (v8::Handle obj, unsigned int *val) { @@ -2771,6 +2767,9 @@ SWIG_AsVal_unsigned_SS_int (v8::Handle obj, unsigned int *val) } + + + size_t SWIG_strnlen(const char* s, size_t maxlen) { @@ -3093,6 +3092,9 @@ SWIG_AsVal_unsigned_SS_short (v8::Handle obj, unsigned short *val) return res; } +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); } @@ -3106,7 +3108,6 @@ SWIGINTERN std::string udp_endpoint_address(udp::endpoint *self){ #define SWIGV8_INIT libtorrent_initialize -SWIGV8_ClientData _exports_char_const_ptr_int_pair_clientData; SWIGV8_ClientData _exports_int_int_pair_clientData; SWIGV8_ClientData _exports_string_int_pair_clientData; SWIGV8_ClientData _exports_string_string_pair_clientData; @@ -3304,310 +3305,6 @@ SWIGV8_ClientData _exports_posix_stat_clientData; SWIGV8_ClientData _exports_posix_wrapper_clientData; -static SwigV8ReturnValue _wrap_new_char_const_ptr_int_pair__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { - SWIGV8_HANDLESCOPE(); - - v8::Handle self = args.Holder(); - std::pair< char const *,int > *result; - if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_char_const_ptr_int_pair__SWIG_0."); - result = (std::pair< char const *,int > *)new std::pair< char const *,int >(); - - - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_std__pairT_char_const_p_int_t, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_new_char_const_ptr_int_pair__SWIG_1(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { - SWIGV8_HANDLESCOPE(); - - v8::Handle self = args.Holder(); - char *arg1 = (char *) 0 ; - int arg2 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - std::pair< char const *,int > *result; - if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_char_const_ptr_int_pair__SWIG_1."); - res1 = SWIG_AsCharPtrAndSize(args[0], &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_char_const_ptr_int_pair" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = (char *)(buf1); - ecode2 = SWIG_AsVal_int(args[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_char_const_ptr_int_pair" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - result = (std::pair< char const *,int > *)new std::pair< char const *,int >((char const *)arg1,arg2); - - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - - - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_std__pairT_char_const_p_int_t, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_new_char_const_ptr_int_pair__SWIG_2(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { - SWIGV8_HANDLESCOPE(); - - v8::Handle self = args.Holder(); - std::pair< char const *,int > *arg1 = 0 ; - void *argp1 ; - int res1 = 0 ; - std::pair< char const *,int > *result; - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_char_const_ptr_int_pair__SWIG_2."); - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__pairT_char_const_p_int_t, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_char_const_ptr_int_pair" "', argument " "1"" of type '" "std::pair< char const *,int > const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_char_const_ptr_int_pair" "', argument " "1"" of type '" "std::pair< char const *,int > const &""'"); - } - arg1 = (std::pair< char const *,int > *)(argp1); - result = (std::pair< char const *,int > *)new std::pair< char const *,int >((std::pair< char const *,int > const &)*arg1); - - - - - SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_std__pairT_char_const_p_int_t, SWIG_POINTER_OWN); - SWIGV8_RETURN(self); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_new_char_const_ptr_int_pair(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - OverloadErrorHandler errorHandler; - v8::Handle self; - - // switch all cases by means of series of if-returns. - - if(args.Length() == 0) { - errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) - self = _wrap_new_char_const_ptr_int_pair__SWIG_0(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - SWIGV8_ESCAPE(self); - } -#else - _wrap_new_char_const_ptr_int_pair__SWIG_0(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } -#endif - } - - if(args.Length() == 2) { - errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) - self = _wrap_new_char_const_ptr_int_pair__SWIG_1(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - SWIGV8_ESCAPE(self); - } -#else - _wrap_new_char_const_ptr_int_pair__SWIG_1(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } -#endif - } - - if(args.Length() == 1) { - errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) - self = _wrap_new_char_const_ptr_int_pair__SWIG_2(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - SWIGV8_ESCAPE(self); - } -#else - _wrap_new_char_const_ptr_int_pair__SWIG_2(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } -#endif - } - - - // default: - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of _exports_char_const_ptr_int_pair"); - -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static void _wrap_char_const_ptr_int_pair_first_set(v8::Local property, v8::Local value, - const SwigV8PropertyCallbackInfoVoid &info) { - SWIGV8_HANDLESCOPE(); - - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - - res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_std__pairT_char_const_p_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "char_const_ptr_int_pair_first_set" "', argument " "1"" of type '" "std::pair< char const *,int > *""'"); - } - arg1 = (std::pair< char const *,int > *)(argp1); - res2 = SWIG_AsCharPtrAndSize(value, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "char_const_ptr_int_pair_first_set" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - if (arg2) { - size_t size = strlen((const char *)((const char *)(arg2))) + 1; - arg1->first = (char const *)(char*)(memcpy((new char[size]), arg2, sizeof(char)*(size))); - } else { - arg1->first = 0; - } - - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - - goto fail; -fail: - return; -} - - -static SwigV8ReturnValue _wrap_char_const_ptr_int_pair_first_get(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *result = 0 ; - - res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_std__pairT_char_const_p_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "char_const_ptr_int_pair_first_get" "', argument " "1"" of type '" "std::pair< char const *,int > *""'"); - } - arg1 = (std::pair< char const *,int > *)(argp1); - result = (char *) ((arg1)->first); - jsresult = SWIG_FromCharPtr((const char *)result); - - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -static void _wrap_char_const_ptr_int_pair_second_set(v8::Local property, v8::Local value, - const SwigV8PropertyCallbackInfoVoid &info) { - SWIGV8_HANDLESCOPE(); - - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - - res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_std__pairT_char_const_p_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "char_const_ptr_int_pair_second_set" "', argument " "1"" of type '" "std::pair< char const *,int > *""'"); - } - arg1 = (std::pair< char const *,int > *)(argp1); - ecode2 = SWIG_AsVal_int(value, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "char_const_ptr_int_pair_second_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = (int)(val2); - if (arg1) (arg1)->second = arg2; - - - - goto fail; -fail: - return; -} - - -static SwigV8ReturnValue _wrap_char_const_ptr_int_pair_second_get(v8::Local property, const SwigV8PropertyCallbackInfo &info) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - std::pair< char const *,int > *arg1 = (std::pair< char const *,int > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int result; - - res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_std__pairT_char_const_p_int_t, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "char_const_ptr_int_pair_second_get" "', argument " "1"" of type '" "std::pair< char const *,int > *""'"); - } - arg1 = (std::pair< char const *,int > *)(argp1); - result = (int) ((arg1)->second); - jsresult = SWIG_From_int((int)(result)); - - - SWIGV8_RETURN_INFO(jsresult, info); - - goto fail; -fail: - SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); -} - - -#if (SWIG_V8_VERSION < 0x031710) -static void _wrap_delete_char_const_ptr_int_pair(v8::Persistent object, void *parameter) { - SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) - static void _wrap_delete_char_const_ptr_int_pair(v8::Isolate *isolate, v8::Persistent object, void *parameter) { - SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) - static void _wrap_delete_char_const_ptr_int_pair(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { -#else - static void _wrap_delete_char_const_ptr_int_pair(const v8::WeakCallbackData &data) { - v8::Local object = data.GetValue(); - SWIGV8_Proxy *proxy = data.GetParameter(); -#endif - - if(proxy->swigCMemOwn && proxy->swigCObject) { - std::pair< char const *,int > * arg1 = (std::pair< char const *,int > *)proxy->swigCObject; - delete arg1; - } - delete proxy; - -#if (SWIG_V8_VERSION < 0x031710) - object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) - object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) - object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) - object->Dispose(); -#else - object.Clear(); -#endif - } - - static SwigV8ReturnValue _wrap_new_int_int_pair__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { SWIGV8_HANDLESCOPE(); @@ -95545,53 +95242,34 @@ static SwigV8ReturnValue _wrap_bdecode_node_op_bool(const SwigV8Arguments &args) } -static SwigV8ReturnValue _wrap_bdecode_node_non_owning(const SwigV8Arguments &args) { +static SwigV8ReturnValue _wrap_bdecode_node_list_at(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); v8::Handle jsresult; libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; libtorrent::bdecode_node result; - if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_non_owning."); + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_list_at."); res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_non_owning" "', argument " "1"" of type '" "libtorrent::bdecode_node const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_list_at" "', argument " "1"" of type '" "libtorrent::bdecode_node const *""'"); } arg1 = (libtorrent::bdecode_node *)(argp1); - result = ((libtorrent::bdecode_node const *)arg1)->non_owning(); + ecode2 = SWIG_AsVal_int(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bdecode_node_list_at" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = ((libtorrent::bdecode_node const *)arg1)->list_at(arg2); jsresult = SWIG_NewPointerObj((new libtorrent::bdecode_node((const libtorrent::bdecode_node&)(result))), SWIGTYPE_p_libtorrent__bdecode_node, SWIG_POINTER_OWN | 0 ); - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_bdecode_node_data_section(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - std::pair< char const *,int > result; - - if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_data_section."); - - res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_data_section" "', argument " "1"" of type '" "libtorrent::bdecode_node const *""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - result = ((libtorrent::bdecode_node const *)arg1)->data_section(); - jsresult = SWIG_NewPointerObj((new std::pair< char const *,int >((const std::pair< char const *,int >&)(result))), SWIGTYPE_p_std__pairT_char_const_p_int_t, SWIG_POINTER_OWN | 0 ); - SWIGV8_RETURN(jsresult); @@ -96460,34 +96138,6 @@ static SwigV8ReturnValue _wrap_bdecode_node_string_value(const SwigV8Arguments & } -static SwigV8ReturnValue _wrap_bdecode_node_string_ptr(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char *result = 0 ; - - if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_string_ptr."); - - res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_string_ptr" "', argument " "1"" of type '" "libtorrent::bdecode_node const *""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - result = (char *)((libtorrent::bdecode_node const *)arg1)->string_ptr(); - jsresult = SWIG_FromCharPtr((const char *)result); - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - static SwigV8ReturnValue _wrap_bdecode_node_string_length(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); @@ -96516,136 +96166,46 @@ static SwigV8ReturnValue _wrap_bdecode_node_string_length(const SwigV8Arguments } -static SwigV8ReturnValue _wrap_bdecode_node_clear(const SwigV8Arguments &args) { +static SwigV8ReturnValue _wrap_bdecode_node_to_string(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - - if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_clear."); - - res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_clear" "', argument " "1"" of type '" "libtorrent::bdecode_node *""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - (arg1)->clear(); - jsresult = SWIGV8_UNDEFINED(); - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_bdecode_node_swap(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - libtorrent::bdecode_node *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_swap."); - - res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_swap" "', argument " "1"" of type '" "libtorrent::bdecode_node *""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - res2 = SWIG_ConvertPtr(args[0], &argp2, SWIGTYPE_p_libtorrent__bdecode_node, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bdecode_node_swap" "', argument " "2"" of type '" "libtorrent::bdecode_node &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "bdecode_node_swap" "', argument " "2"" of type '" "libtorrent::bdecode_node &""'"); - } - arg2 = (libtorrent::bdecode_node *)(argp2); - (arg1)->swap(*arg2); - jsresult = SWIGV8_UNDEFINED(); - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_bdecode_node_reserve(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - int arg2 ; - void *argp1 = 0 ; + libtorrent::bdecode_node *arg1 = 0 ; + bool arg2 ; + int arg3 ; + void *argp1 ; int res1 = 0 ; - int val2 ; + bool val2 ; int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + std::string result; - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_reserve."); + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_to_string."); - res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_libtorrent__bdecode_node, 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_reserve" "', argument " "1"" of type '" "libtorrent::bdecode_node *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_to_string" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "bdecode_node_to_string" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); } arg1 = (libtorrent::bdecode_node *)(argp1); - ecode2 = SWIG_AsVal_int(args[0], &val2); + ecode2 = SWIG_AsVal_bool(args[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bdecode_node_reserve" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bdecode_node_to_string" "', argument " "2"" of type '" "bool""'"); } - arg2 = (int)(val2); - (arg1)->reserve(arg2); - jsresult = SWIGV8_UNDEFINED(); - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_bdecode_node_switch_underlying_buffer(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); + arg2 = (bool)(val2); + ecode3 = SWIG_AsVal_int(args[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bdecode_node_to_string" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + result = libtorrent_bdecode_node_to_string((libtorrent::bdecode_node const &)*arg1,arg2,arg3); + jsresult = SWIG_From_std_string((std::string)(result)); - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = (libtorrent::bdecode_node *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_bdecode_node_switch_underlying_buffer."); - res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__bdecode_node, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bdecode_node_switch_underlying_buffer" "', argument " "1"" of type '" "libtorrent::bdecode_node *""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - res2 = SWIG_AsCharPtrAndSize(args[0], &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bdecode_node_switch_underlying_buffer" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = (char *)(buf2); - (arg1)->switch_underlying_buffer((char const *)arg2); - jsresult = SWIGV8_UNDEFINED(); - - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; SWIGV8_RETURN(jsresult); @@ -96744,186 +96304,6 @@ static void _wrap_delete_bdecode_node(v8::Persistent object, void *pa } -static SwigV8ReturnValue _wrap_print_entry__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) -{ - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = 0 ; - bool arg2 ; - int arg3 ; - void *argp1 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - std::string result; - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_libtorrent__bdecode_node, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_entry" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_entry" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - ecode2 = SWIG_AsVal_bool(args[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "print_entry" "', argument " "2"" of type '" "bool""'"); - } - arg2 = (bool)(val2); - ecode3 = SWIG_AsVal_int(args[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "print_entry" "', argument " "3"" of type '" "int""'"); - } - arg3 = (int)(val3); - result = libtorrent::print_entry((libtorrent::bdecode_node const &)*arg1,arg2,arg3); - jsresult = SWIG_From_std_string((std::string)(result)); - - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_print_entry__SWIG_1(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) -{ - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = 0 ; - bool arg2 ; - void *argp1 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - std::string result; - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_libtorrent__bdecode_node, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_entry" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_entry" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - ecode2 = SWIG_AsVal_bool(args[1], &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "print_entry" "', argument " "2"" of type '" "bool""'"); - } - arg2 = (bool)(val2); - result = libtorrent::print_entry((libtorrent::bdecode_node const &)*arg1,arg2); - jsresult = SWIG_From_std_string((std::string)(result)); - - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_print_entry__SWIG_2(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) -{ - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - libtorrent::bdecode_node *arg1 = 0 ; - void *argp1 ; - int res1 = 0 ; - std::string result; - - res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_libtorrent__bdecode_node, 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "print_entry" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "print_entry" "', argument " "1"" of type '" "libtorrent::bdecode_node const &""'"); - } - arg1 = (libtorrent::bdecode_node *)(argp1); - result = libtorrent::print_entry((libtorrent::bdecode_node const &)*arg1); - jsresult = SWIG_From_std_string((std::string)(result)); - - - SWIGV8_RETURN(jsresult); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - -static SwigV8ReturnValue _wrap_libtorrent__wrap_print_entry(const SwigV8Arguments &args) { - SWIGV8_HANDLESCOPE(); - - v8::Handle jsresult; - OverloadErrorHandler errorHandler; - - - if(args.Length() == 3) { - errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) - jsresult = _wrap_print_entry__SWIG_0(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - SWIGV8_ESCAPE(jsresult); - } -#else - _wrap_print_entry__SWIG_0(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } -#endif - } - - - if(args.Length() == 2) { - errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) - jsresult = _wrap_print_entry__SWIG_1(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - SWIGV8_ESCAPE(jsresult); - } -#else - _wrap_print_entry__SWIG_1(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } -#endif - } - - - if(args.Length() == 1) { - errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) - jsresult = _wrap_print_entry__SWIG_2(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - SWIGV8_ESCAPE(jsresult); - } -#else - _wrap_print_entry__SWIG_2(args, errorHandler); - if(errorHandler.err.IsEmpty()) { - return; - } -#endif - } - - - SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function print_entry."); - - goto fail; -fail: - SWIGV8_RETURN(SWIGV8_UNDEFINED()); -} - - static SwigV8ReturnValue _wrap_make_magnet_uri__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { SWIGV8_HANDLESCOPE(); @@ -108425,7 +107805,7 @@ static SwigV8ReturnValue _wrap_LIBTORRENT_REVISION_SHA1(v8::Local pr v8::Handle jsresult; - jsresult = SWIG_FromCharPtr((const char *)"930a33b59c49965a8a2caa13517b21e3142078af"); + jsresult = SWIG_FromCharPtr((const char *)"b7a6d8114ea7144f4c912c35d9ba2bbaacd51968"); SWIGV8_RETURN_INFO(jsresult, info); @@ -108440,7 +107820,7 @@ static SwigV8ReturnValue _wrap_JLIBTORRENT_REVISION_SHA1(v8::Local p v8::Handle jsresult; - jsresult = SWIG_FromCharPtr((const char *)"864305be12ea95f6f32ffd7621db705e967a26f2"); + jsresult = SWIG_FromCharPtr((const char *)"9c9b3580a9f7888746c6c49019a05a1215f0c140"); SWIGV8_RETURN_INFO(jsresult, info); @@ -113154,7 +112534,6 @@ static swig_type_info _swigt__p_std__listT_std__string_t = {"_p_std__listT_std__ static swig_type_info _swigt__p_std__mapT_int_libtorrent__sha1_hash_t = {"_p_std__mapT_int_libtorrent__sha1_hash_t", "std::map< int,libtorrent::sha1_hash > *|p_std__mapT_int_libtorrent__sha1_hash_t", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__mapT_std__string_libtorrent__entry_t = {"_p_std__mapT_std__string_libtorrent__entry_t", "p_std__mapT_std__string_libtorrent__entry_t|std::map< std::string,libtorrent::entry > *|libtorrent::entry::dictionary_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__mapT_std__string_long_t = {"_p_std__mapT_std__string_long_t", "std::map< std::string,long > *|p_std__mapT_std__string_long_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_std__pairT_char_const_p_int_t = {"_p_std__pairT_char_const_p_int_t", "p_std__pairT_char_const_p_int_t|std::pair< char const *,int > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__pairT_int_int_t = {"_p_std__pairT_int_int_t", "std::vector< std::pair< int,int > >::value_type *|p_std__pairT_int_int_t|std::pair< int,int > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__pairT_std__string_dht_extension_handler_listener_p_t = {"_p_std__pairT_std__string_dht_extension_handler_listener_p_t", "std::pair< std::string,dht_extension_handler_listener * > *|p_std__pairT_std__string_dht_extension_handler_listener_p_t|std::vector< std::pair< std::string,dht_extension_handler_listener * > >::value_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_std__pairT_std__string_int_t = {"_p_std__pairT_std__string_int_t", "std::vector< std::pair< std::string,int > >::value_type *|p_std__pairT_std__string_int_t|std::pair< std::string,int > *", 0, 0, (void*)0, 0}; @@ -113387,7 +112766,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_std__mapT_int_libtorrent__sha1_hash_t, &_swigt__p_std__mapT_std__string_libtorrent__entry_t, &_swigt__p_std__mapT_std__string_long_t, - &_swigt__p_std__pairT_char_const_p_int_t, &_swigt__p_std__pairT_int_int_t, &_swigt__p_std__pairT_std__string_dht_extension_handler_listener_p_t, &_swigt__p_std__pairT_std__string_int_t, @@ -113620,7 +112998,6 @@ static swig_cast_info _swigc__p_std__listT_std__string_t[] = { {&_swigt__p_std_ static swig_cast_info _swigc__p_std__mapT_int_libtorrent__sha1_hash_t[] = { {&_swigt__p_std__mapT_int_libtorrent__sha1_hash_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__mapT_std__string_libtorrent__entry_t[] = { {&_swigt__p_std__mapT_std__string_libtorrent__entry_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__mapT_std__string_long_t[] = { {&_swigt__p_std__mapT_std__string_long_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__pairT_char_const_p_int_t[] = { {&_swigt__p_std__pairT_char_const_p_int_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__pairT_int_int_t[] = { {&_swigt__p_std__pairT_int_int_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__pairT_std__string_dht_extension_handler_listener_p_t[] = { {&_swigt__p_std__pairT_std__string_dht_extension_handler_listener_p_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_std__pairT_std__string_int_t[] = { {&_swigt__p_std__pairT_std__string_int_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -113853,7 +113230,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_std__mapT_int_libtorrent__sha1_hash_t, _swigc__p_std__mapT_std__string_libtorrent__entry_t, _swigc__p_std__mapT_std__string_long_t, - _swigc__p_std__pairT_char_const_p_int_t, _swigc__p_std__pairT_int_int_t, _swigc__p_std__pairT_std__string_dht_extension_handler_listener_p_t, _swigc__p_std__pairT_std__string_int_t, @@ -114204,14 +113580,7 @@ void SWIGV8_INIT (v8::Handle exports, v8::Handle /*modul /* create class templates */ - /* Name: _exports_char_const_ptr_int_pair, Type: p_std__pairT_char_const_p_int_t, Dtor: _wrap_delete_char_const_ptr_int_pair */ -v8::Handle _exports_char_const_ptr_int_pair_class = SWIGV8_CreateClassTemplate("_exports_char_const_ptr_int_pair"); -SWIGV8_SET_CLASS_TEMPL(_exports_char_const_ptr_int_pair_clientData.class_templ, _exports_char_const_ptr_int_pair_class); -_exports_char_const_ptr_int_pair_clientData.dtor = _wrap_delete_char_const_ptr_int_pair; -if (SWIGTYPE_p_std__pairT_char_const_p_int_t->clientdata == 0) { - SWIGTYPE_p_std__pairT_char_const_p_int_t->clientdata = &_exports_char_const_ptr_int_pair_clientData; -} -/* Name: _exports_int_int_pair, Type: p_std__pairT_int_int_t, Dtor: _wrap_delete_int_int_pair */ + /* Name: _exports_int_int_pair, Type: p_std__pairT_int_int_t, Dtor: _wrap_delete_int_int_pair */ v8::Handle _exports_int_int_pair_class = SWIGV8_CreateClassTemplate("_exports_int_int_pair"); SWIGV8_SET_CLASS_TEMPL(_exports_int_int_pair_clientData.class_templ, _exports_int_int_pair_class); _exports_int_int_pair_clientData.dtor = _wrap_delete_int_int_pair; @@ -115579,9 +114948,7 @@ if (SWIGTYPE_p_posix_wrapper->clientdata == 0) { /* register wrapper functions */ - SWIGV8_AddMemberVariable(_exports_char_const_ptr_int_pair_class, "first", _wrap_char_const_ptr_int_pair_first_get, _wrap_char_const_ptr_int_pair_first_set); -SWIGV8_AddMemberVariable(_exports_char_const_ptr_int_pair_class, "second", _wrap_char_const_ptr_int_pair_second_get, _wrap_char_const_ptr_int_pair_second_set); -SWIGV8_AddMemberVariable(_exports_int_int_pair_class, "first", _wrap_int_int_pair_first_get, _wrap_int_int_pair_first_set); + SWIGV8_AddMemberVariable(_exports_int_int_pair_class, "first", _wrap_int_int_pair_first_get, _wrap_int_int_pair_first_set); SWIGV8_AddMemberVariable(_exports_int_int_pair_class, "second", _wrap_int_int_pair_second_get, _wrap_int_int_pair_second_set); SWIGV8_AddMemberVariable(_exports_string_int_pair_class, "first", _wrap_string_int_pair_first_get, _wrap_string_int_pair_first_set); SWIGV8_AddMemberVariable(_exports_string_int_pair_class, "second", _wrap_string_int_pair_second_get, _wrap_string_int_pair_second_set); @@ -117277,8 +116644,7 @@ SWIGV8_AddMemberVariable(_exports_bdecode_token_class, "next_item", _wrap_bdecod SWIGV8_AddMemberVariable(_exports_bdecode_token_class, "header", _wrap_bdecode_token_header_get, _wrap_bdecode_token_header_set); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "type", _wrap_bdecode_node_type); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "op_bool", _wrap_bdecode_node_op_bool); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "non_owning", _wrap_bdecode_node_non_owning); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "data_section", _wrap_bdecode_node_data_section); +SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "list_at", _wrap_bdecode_node_list_at); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "list_string_value_at", _wrap_bdecode_node__wrap_bdecode_node_list_string_value_at); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "list_int_value_at", _wrap_bdecode_node__wrap_bdecode_node_list_int_value_at); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "list_size", _wrap_bdecode_node_list_size); @@ -117293,12 +116659,7 @@ SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "dict_find_int_value", _wr SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "dict_size", _wrap_bdecode_node_dict_size); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "int_value", _wrap_bdecode_node_int_value); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "string_value", _wrap_bdecode_node_string_value); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "string_ptr", _wrap_bdecode_node_string_ptr); SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "string_length", _wrap_bdecode_node_string_length); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "clear", _wrap_bdecode_node_clear); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "swap", _wrap_bdecode_node_swap); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "reserve", _wrap_bdecode_node_reserve); -SWIGV8_AddMemberFunction(_exports_bdecode_node_class, "switch_underlying_buffer", _wrap_bdecode_node_switch_underlying_buffer); SWIGV8_AddMemberFunction(_exports_create_torrent_class, "generate", _wrap_create_torrent_generate); SWIGV8_AddMemberFunction(_exports_create_torrent_class, "files", _wrap_create_torrent_files); SWIGV8_AddMemberFunction(_exports_create_torrent_class, "set_comment", _wrap_create_torrent_set_comment); @@ -119340,13 +118701,7 @@ if (SWIGTYPE_p_libtorrent__peer_connection_handle->clientdata && !(static_cast _exports_char_const_ptr_int_pair_class_0 = SWIGV8_CreateClassTemplate("char_const_ptr_int_pair"); -_exports_char_const_ptr_int_pair_class_0->SetCallHandler(_wrap_new_char_const_ptr_int_pair); -_exports_char_const_ptr_int_pair_class_0->Inherit(_exports_char_const_ptr_int_pair_class); -_exports_char_const_ptr_int_pair_class_0->SetHiddenPrototype(true); -v8::Handle _exports_char_const_ptr_int_pair_obj = _exports_char_const_ptr_int_pair_class_0->GetFunction(); -/* Class: int_int_pair (_exports_int_int_pair) */ + /* Class: int_int_pair (_exports_int_int_pair) */ v8::Handle _exports_int_int_pair_class_0 = SWIGV8_CreateClassTemplate("int_int_pair"); _exports_int_int_pair_class_0->SetCallHandler(_wrap_new_int_int_pair); _exports_int_int_pair_class_0->Inherit(_exports_int_int_pair_class); @@ -121936,8 +121291,8 @@ SWIGV8_AddStaticVariable(_exports_bdecode_node_obj, "dict_t", _wrap_libtorrent_b SWIGV8_AddStaticVariable(_exports_bdecode_node_obj, "list_t", _wrap_libtorrent_bdecode_node_list_t, JS_veto_set_variable); SWIGV8_AddStaticVariable(_exports_bdecode_node_obj, "string_t", _wrap_libtorrent_bdecode_node_string_t, JS_veto_set_variable); SWIGV8_AddStaticVariable(_exports_bdecode_node_obj, "int_t", _wrap_libtorrent_bdecode_node_int_t, JS_veto_set_variable); +SWIGV8_AddStaticFunction(_exports_bdecode_node_obj, "to_string", _wrap_bdecode_node_to_string); SWIGV8_AddStaticFunction(_exports_bdecode_node_obj, "bdecode", _wrap_bdecode_node_bdecode); -SWIGV8_AddStaticFunction(exports_obj, "print_entry", _wrap_libtorrent__wrap_print_entry); SWIGV8_AddStaticFunction(exports_obj, "make_magnet_uri", _wrap_libtorrent__wrap_make_magnet_uri); SWIGV8_AddStaticFunction(exports_obj, "parse_magnet_uri", _wrap_parse_magnet_uri); SWIGV8_AddStaticVariable(_exports_create_torrent_obj, "optimize_alignment", _wrap_libtorrent_create_torrent_optimize_alignment, JS_veto_set_variable); @@ -122013,8 +121368,7 @@ SWIGV8_AddStaticFunction(exports_obj, "set_posix_wrapper", _wrap_set_posix_wrapp /* register classes */ - exports_obj->Set(SWIGV8_SYMBOL_NEW("char_const_ptr_int_pair"), _exports_char_const_ptr_int_pair_obj); -exports_obj->Set(SWIGV8_SYMBOL_NEW("int_int_pair"), _exports_int_int_pair_obj); + exports_obj->Set(SWIGV8_SYMBOL_NEW("int_int_pair"), _exports_int_int_pair_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("string_int_pair"), _exports_string_int_pair_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("string_string_pair"), _exports_string_string_pair_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("string_bdecode_node_pair"), _exports_string_bdecode_node_pair_obj);