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 4d62b4457..7a1995577 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java @@ -2477,6 +2477,7 @@ public class libtorrent_jni { public final static native void session_handle_dht_get_item__SWIG_1(long jarg1, session_handle jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_); public final static native void session_handle_dht_put_item__SWIG_1(long jarg1, session_handle jarg1_, long jarg2, byte_vector jarg2_, long jarg3, byte_vector jarg3_, long jarg4, entry jarg4_, long jarg5, byte_vector jarg5_); public final static native void session_handle_add_swig_extension(long jarg1, session_handle jarg1_, long jarg2, swig_plugin jarg2_); + public final static native void session_handle_set_swig_dht_storage(long jarg1, session_handle jarg1_, long jarg2, swig_dht_storage_constructor jarg2_); public final static native void delete_session_handle(long jarg1); public final static native void min_memory_usage(long jarg1, settings_pack jarg1_); public final static native void high_performance_seed(long jarg1, settings_pack jarg1_); @@ -3085,6 +3086,12 @@ public class libtorrent_jni { public final static native long new_swig_dht_storage(); public final static native void swig_dht_storage_director_connect(swig_dht_storage obj, long cptr, boolean mem_own, boolean weak_global); public final static native void swig_dht_storage_change_ownership(swig_dht_storage obj, long cptr, boolean take_or_release); + public final static native void delete_swig_dht_storage_constructor(long jarg1); + public final static native long swig_dht_storage_constructor_create(long jarg1, swig_dht_storage_constructor jarg1_, long jarg2, sha1_hash jarg2_, long jarg3, dht_settings jarg3_); + public final static native long swig_dht_storage_constructor_createSwigExplicitswig_dht_storage_constructor(long jarg1, swig_dht_storage_constructor jarg1_, long jarg2, sha1_hash jarg2_, long jarg3, dht_settings jarg3_); + public final static native long new_swig_dht_storage_constructor(); + public final static native void swig_dht_storage_constructor_director_connect(swig_dht_storage_constructor obj, long cptr, boolean mem_own, boolean weak_global); + public final static native void swig_dht_storage_constructor_change_ownership(swig_dht_storage_constructor obj, long cptr, boolean take_or_release); public final static native void delete_swig_plugin(long jarg1); public final static native long swig_plugin_new_torrent(long jarg1, swig_plugin jarg1_, long jarg2, torrent_handle jarg2_); public final static native long swig_plugin_new_torrentSwigExplicitswig_plugin(long jarg1, swig_plugin jarg1_, long jarg2, torrent_handle jarg2_); @@ -3392,6 +3399,9 @@ public static long SwigDirector_swig_dht_storage_num_immutable_data(swig_dht_sto public static long SwigDirector_swig_dht_storage_num_mutable_data(swig_dht_storage jself) { return jself.num_mutable_data(); } + public static long SwigDirector_swig_dht_storage_constructor_create(swig_dht_storage_constructor jself, long id, long settings) { + return swig_dht_storage.getCPtr(jself.create(new sha1_hash(id, false), new dht_settings(settings, false))); + } public static long SwigDirector_swig_plugin_new_torrent(swig_plugin jself, long t) { return swig_torrent_plugin.getCPtr(jself.new_torrent(new torrent_handle(t, false))); } diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/session_handle.java b/src/main/java/com/frostwire/jlibtorrent/swig/session_handle.java index b67e3ce99..a899e51db 100644 --- a/src/main/java/com/frostwire/jlibtorrent/swig/session_handle.java +++ b/src/main/java/com/frostwire/jlibtorrent/swig/session_handle.java @@ -256,6 +256,10 @@ public void add_swig_extension(swig_plugin p) { libtorrent_jni.session_handle_add_swig_extension(swigCPtr, this, swig_plugin.getCPtr(p), p); } + public void set_swig_dht_storage(swig_dht_storage_constructor sc) { + libtorrent_jni.session_handle_set_swig_dht_storage(swigCPtr, this, swig_dht_storage_constructor.getCPtr(sc), sc); + } + public final static class save_state_flags_t { public final static session_handle.save_state_flags_t save_settings = new session_handle.save_state_flags_t("save_settings", libtorrent_jni.session_handle_save_settings_get()); public final static session_handle.save_state_flags_t save_dht_settings = new session_handle.save_state_flags_t("save_dht_settings", libtorrent_jni.session_handle_save_dht_settings_get()); diff --git a/src/main/java/com/frostwire/jlibtorrent/swig/swig_dht_storage_constructor.java b/src/main/java/com/frostwire/jlibtorrent/swig/swig_dht_storage_constructor.java new file mode 100644 index 000000000..f04ae446f --- /dev/null +++ b/src/main/java/com/frostwire/jlibtorrent/swig/swig_dht_storage_constructor.java @@ -0,0 +1,63 @@ +/* ---------------------------------------------------------------------------- + * 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 swig_dht_storage_constructor { + private transient long swigCPtr; + protected transient boolean swigCMemOwn; + + protected swig_dht_storage_constructor(long cPtr, boolean cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = cPtr; + } + + protected static long getCPtr(swig_dht_storage_constructor 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_swig_dht_storage_constructor(swigCPtr); + } + swigCPtr = 0; + } + } + + protected void swigDirectorDisconnect() { + swigCMemOwn = false; + delete(); + } + + public void swigReleaseOwnership() { + swigCMemOwn = false; + libtorrent_jni.swig_dht_storage_constructor_change_ownership(this, swigCPtr, false); + } + + public void swigTakeOwnership() { + swigCMemOwn = true; + libtorrent_jni.swig_dht_storage_constructor_change_ownership(this, swigCPtr, true); + } + + public swig_dht_storage create(sha1_hash id, dht_settings settings) { + long cPtr = (getClass() == swig_dht_storage_constructor.class) ? libtorrent_jni.swig_dht_storage_constructor_create(swigCPtr, this, sha1_hash.getCPtr(id), id, dht_settings.getCPtr(settings), settings) : libtorrent_jni.swig_dht_storage_constructor_createSwigExplicitswig_dht_storage_constructor(swigCPtr, this, sha1_hash.getCPtr(id), id, dht_settings.getCPtr(settings), settings); + return (cPtr == 0) ? null : new swig_dht_storage(cPtr, false); + } + + public swig_dht_storage_constructor() { + this(libtorrent_jni.new_swig_dht_storage_constructor(), true); + libtorrent_jni.swig_dht_storage_constructor_director_connect(this, swigCPtr, swigCMemOwn, true); + } + +} diff --git a/swig/libtorrent.h b/swig/libtorrent.h index cab5ea65d..a1faba1ff 100644 --- a/swig/libtorrent.h +++ b/swig/libtorrent.h @@ -420,6 +420,22 @@ struct swig_dht_storage : dht::dht_storage_interface virtual ~swig_dht_storage() {} }; +class swig_dht_storage_constructor { +public: + virtual ~swig_dht_storage_constructor() { + } + + virtual swig_dht_storage* create(libtorrent::sha1_hash const& id, libtorrent::dht_settings const& settings) { + return NULL; + } +}; + +dht::dht_storage_interface* swig_dht_storage_constructor_cb(libtorrent::sha1_hash const& id + , libtorrent::dht_settings const& settings + , swig_dht_storage_constructor* sc) { + return sc->create(id, settings); +} + //------------------------------------------------------ void dht_put_item_cb(entry& e, boost::array& sig, boost::uint64_t& seq, diff --git a/swig/libtorrent.i b/swig/libtorrent.i index 6146521d7..995c2a4e5 100644 --- a/swig/libtorrent.i +++ b/swig/libtorrent.i @@ -876,6 +876,10 @@ namespace libtorrent { void add_swig_extension(swig_plugin *p) { $self->add_extension(boost::shared_ptr(p)); } + + void set_swig_dht_storage(swig_dht_storage_constructor *sc) { + $self->set_dht_storage(boost::bind(&swig_dht_storage_constructor_cb, _1, _2, sc)); + } }; %extend entry { @@ -1040,6 +1044,7 @@ void set_utp_stream_logging(bool enable); %ignore swig_storage::set_file_priority; %ignore swig_storage::readv; %ignore swig_storage::writev; +%ignore swig_storage_constructor_cb; %feature("director") swig_storage; %feature("director") swig_storage_constructor; @@ -1051,8 +1056,12 @@ void set_utp_stream_logging(bool enable); %ignore swig_dht_storage::get_mutable_item_seq; %ignore swig_dht_storage::put_mutable_item(libtorrent::sha1_hash const&, char const*, int, char const*, boost::int64_t, char const*, char const*, int, libtorrent::address const&); %ignore swig_dht_storage::counters; +%ignore swig_dht_storage_constructor_cb; %feature("director") swig_dht_storage; +%feature("director") swig_dht_storage_constructor; + +%typemap("javapackage") SwigDhtStorage, SwigDhtStorage *, SwigDhtStorage & "com.frostwire.jlibtorrent.plugins"; // libtorrent plugins %feature("director") swig_plugin; @@ -1071,7 +1080,6 @@ void set_utp_stream_logging(bool enable); %ignore swig_peer_plugin::on_extended; %ignore swig_peer_plugin::on_unknown_message; -%ignore swig_storage_constructor_cb; %ignore dht_put_item_cb; %feature("director") posix_wrapper; diff --git a/swig/libtorrent_jni.cpp b/swig/libtorrent_jni.cpp index 108824bdf..bc407a5b7 100644 --- a/swig/libtorrent_jni.cpp +++ b/swig/libtorrent_jni.cpp @@ -676,7 +676,7 @@ namespace Swig { namespace Swig { namespace { jclass jclass_libtorrent_jni = NULL; - jmethodID director_method_ids[80]; + jmethodID director_method_ids[81]; } } @@ -1434,6 +1434,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 void libtorrent_session_handle_set_swig_dht_storage(libtorrent::session_handle *self,swig_dht_storage_constructor *sc){ + self->set_dht_storage(boost::bind(&swig_dht_storage_constructor_cb, _1, _2, sc)); + } 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); } @@ -2604,6 +2607,81 @@ void SwigDirector_swig_dht_storage::swig_connect_director(JNIEnv *jenv, jobject } +SwigDirector_swig_dht_storage_constructor::SwigDirector_swig_dht_storage_constructor(JNIEnv *jenv) : swig_dht_storage_constructor(), Swig::Director(jenv) { +} + +SwigDirector_swig_dht_storage_constructor::~SwigDirector_swig_dht_storage_constructor() { + swig_disconnect_director_self("swigDirectorDisconnect"); +} + + +swig_dht_storage *SwigDirector_swig_dht_storage_constructor::create(libtorrent::sha1_hash const &id, libtorrent::dht_settings const &settings) { + swig_dht_storage *c_result = 0 ; + jlong jresult = 0 ; + JNIEnvWrapper swigjnienv(this) ; + JNIEnv * jenv = swigjnienv.getJNIEnv() ; + jobject swigjobj = (jobject) NULL ; + jlong jid = 0 ; + jlong jsettings = 0 ; + + if (!swig_override[0]) { + return swig_dht_storage_constructor::create(id,settings); + } + swigjobj = swig_get_self(jenv); + if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { + *(libtorrent::sha1_hash **)&jid = (libtorrent::sha1_hash *) &id; + *(libtorrent::dht_settings **)&jsettings = (libtorrent::dht_settings *) &settings; + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[27], swigjobj, jid, jsettings); + jthrowable swigerror = jenv->ExceptionOccurred(); + if (swigerror) { + jenv->ExceptionClear(); + throw Swig::DirectorException(jenv, swigerror); + } + + c_result = *(swig_dht_storage **)&jresult; + } else { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null upcall object in swig_dht_storage_constructor::create "); + } + if (swigjobj) jenv->DeleteLocalRef(swigjobj); + return c_result; +} + +void SwigDirector_swig_dht_storage_constructor::swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global) { + static struct { + const char *mname; + const char *mdesc; + jmethodID base_methid; + } methods[] = { + { + "create", "(Lcom/frostwire/jlibtorrent/swig/sha1_hash;Lcom/frostwire/jlibtorrent/swig/dht_settings;)Lcom/frostwire/jlibtorrent/swig/swig_dht_storage;", NULL + } + }; + + static jclass baseclass = 0 ; + + if (swig_set_self(jenv, jself, swig_mem_own, weak_global)) { + if (!baseclass) { + baseclass = jenv->FindClass("com/frostwire/jlibtorrent/swig/swig_dht_storage_constructor"); + if (!baseclass) return; + baseclass = (jclass) jenv->NewGlobalRef(baseclass); + } + bool derived = (jenv->IsSameObject(baseclass, jcls) ? false : true); + for (int i = 0; i < 1; ++i) { + if (!methods[i].base_methid) { + methods[i].base_methid = jenv->GetMethodID(baseclass, methods[i].mname, methods[i].mdesc); + if (!methods[i].base_methid) return; + } + swig_override[i] = false; + if (derived) { + jmethodID methid = jenv->GetMethodID(jcls, methods[i].mname, methods[i].mdesc); + swig_override[i] = (methid != methods[i].base_methid); + jenv->ExceptionClear(); + } + } + } +} + + SwigDirector_swig_plugin::SwigDirector_swig_plugin(JNIEnv *jenv) : swig_plugin(), Swig::Director(jenv) { } @@ -2626,7 +2704,7 @@ swig_torrent_plugin *SwigDirector_swig_plugin::new_torrent(libtorrent::torrent_h swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::torrent_handle **)&jt = (libtorrent::torrent_handle *) &t; - jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[27], swigjobj, jt); + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[28], swigjobj, jt); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2655,7 +2733,7 @@ void SwigDirector_swig_plugin::added(libtorrent::session_handle s) { if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { js = 0; *((libtorrent::session_handle **)&js) = &s; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[28], swigjobj, js); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[29], swigjobj, js); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2681,7 +2759,7 @@ void SwigDirector_swig_plugin::register_dht_extensions(std::vector< std::pair< s swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(std::vector< std::pair< std::string,dht_extension_handler_listener * > > **)&jdht_extensions = (std::vector< std::pair< std::string,dht_extension_handler_listener * > > *) &dht_extensions; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[29], swigjobj, jdht_extensions); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[30], swigjobj, jdht_extensions); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2707,7 +2785,7 @@ void SwigDirector_swig_plugin::on_alert(libtorrent::alert const *a) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *((libtorrent::alert **)&ja) = (libtorrent::alert *) a; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[30], swigjobj, ja); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[31], swigjobj, ja); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2738,7 +2816,7 @@ bool SwigDirector_swig_plugin::on_unknown_torrent(libtorrent::sha1_hash const &i *(libtorrent::sha1_hash **)&jinfo_hash = (libtorrent::sha1_hash *) &info_hash; *(libtorrent::peer_connection_handle **)&jpc = (libtorrent::peer_connection_handle *) &pc; *(libtorrent::add_torrent_params **)&jp = (libtorrent::add_torrent_params *) &p; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[31], swigjobj, jinfo_hash, jpc, jp); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[32], swigjobj, jinfo_hash, jpc, jp); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2764,7 +2842,7 @@ void SwigDirector_swig_plugin::on_tick() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[32], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[33], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2791,7 +2869,7 @@ bool SwigDirector_swig_plugin::on_optimistic_unchoke(std::vector< libtorrent::pe swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(std::vector< libtorrent::peer_connection_handle > **)&jpeers = (std::vector< libtorrent::peer_connection_handle > *) &peers; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[33], swigjobj, jpeers); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[34], swigjobj, jpeers); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2819,7 +2897,7 @@ void SwigDirector_swig_plugin::save_state(libtorrent::entry &e) const { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::entry **)&je = (libtorrent::entry *) &e; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[34], swigjobj, je); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[35], swigjobj, je); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2845,7 +2923,7 @@ void SwigDirector_swig_plugin::load_state(libtorrent::bdecode_node const &n) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::bdecode_node **)&jn = (libtorrent::bdecode_node *) &n; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[35], swigjobj, jn); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[36], swigjobj, jn); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2940,7 +3018,7 @@ swig_peer_plugin *SwigDirector_swig_torrent_plugin::new_peer_connection(libtorre swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::peer_connection_handle **)&jpc = (libtorrent::peer_connection_handle *) &pc; - jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[36], swigjobj, jpc); + jresult = (jlong) jenv->CallStaticLongMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[37], swigjobj, jpc); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2968,7 +3046,7 @@ void SwigDirector_swig_torrent_plugin::on_piece_pass(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[37], swigjobj, jindex); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[38], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -2994,7 +3072,7 @@ void SwigDirector_swig_torrent_plugin::on_piece_failed(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[38], swigjobj, jindex); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[39], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3018,7 +3096,7 @@ void SwigDirector_swig_torrent_plugin::tick() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[39], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[40], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3043,7 +3121,7 @@ bool SwigDirector_swig_torrent_plugin::on_pause() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[40], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[41], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3070,7 +3148,7 @@ bool SwigDirector_swig_torrent_plugin::on_resume() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[41], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[42], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3096,7 +3174,7 @@ void SwigDirector_swig_torrent_plugin::on_files_checked() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[42], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[43], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3122,7 +3200,7 @@ void SwigDirector_swig_torrent_plugin::on_state(int s) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { js = (jint) s; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[43], swigjobj, js); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[44], swigjobj, js); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3146,7 +3224,7 @@ void SwigDirector_swig_torrent_plugin::on_unload() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[44], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[45], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3170,7 +3248,7 @@ void SwigDirector_swig_torrent_plugin::on_load() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[45], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[46], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3200,7 +3278,7 @@ void SwigDirector_swig_torrent_plugin::on_add_peer(tcp::endpoint const &endp, in *(tcp::endpoint **)&jendp = (tcp::endpoint *) &endp; jsrc = (jint) src; jflags = (jint) flags; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[46], swigjobj, jendp, jsrc, jflags); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[47], swigjobj, jendp, jsrc, jflags); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3299,7 +3377,7 @@ char const *SwigDirector_swig_peer_plugin::type() const { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jstring) jenv->CallStaticObjectMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[47], swigjobj); + jresult = (jstring) jenv->CallStaticObjectMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[48], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3331,7 +3409,7 @@ void SwigDirector_swig_peer_plugin::add_handshake(libtorrent::entry &e) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::entry **)&je = (libtorrent::entry *) &e; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[48], swigjobj, je); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[49], swigjobj, je); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3357,7 +3435,7 @@ void SwigDirector_swig_peer_plugin::on_disconnect(boost::system::error_code cons swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(boost::system::error_code **)&jec = (boost::system::error_code *) &ec; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[49], swigjobj, jec); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[50], swigjobj, jec); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3381,7 +3459,7 @@ void SwigDirector_swig_peer_plugin::on_connected() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[50], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[51], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3414,7 +3492,7 @@ bool SwigDirector_swig_peer_plugin::on_handshake(char const *reserved_bits) { } Swig::LocalRefGuard reserved_bits_refguard(jenv, jreserved_bits); // boohoo - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[51], swigjobj, jreserved_bits); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[52], swigjobj, jreserved_bits); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3443,7 +3521,7 @@ bool SwigDirector_swig_peer_plugin::on_extension_handshake(libtorrent::bdecode_n swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::bdecode_node **)&jn = (libtorrent::bdecode_node *) &n; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[52], swigjobj, jn); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[53], swigjobj, jn); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3470,7 +3548,7 @@ bool SwigDirector_swig_peer_plugin::on_choke() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[53], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[54], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3497,7 +3575,7 @@ bool SwigDirector_swig_peer_plugin::on_unchoke() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[54], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[55], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3524,7 +3602,7 @@ bool SwigDirector_swig_peer_plugin::on_interested() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[55], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[56], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3551,7 +3629,7 @@ bool SwigDirector_swig_peer_plugin::on_not_interested() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[56], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[57], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3580,7 +3658,7 @@ bool SwigDirector_swig_peer_plugin::on_have(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[57], swigjobj, jindex); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[58], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3609,7 +3687,7 @@ bool SwigDirector_swig_peer_plugin::on_dont_have(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[58], swigjobj, jindex); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[59], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3638,7 +3716,7 @@ bool SwigDirector_swig_peer_plugin::on_bitfield(libtorrent::bitfield const &bitf swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::bitfield **)&jbitfield = (libtorrent::bitfield *) &bitfield; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[59], swigjobj, jbitfield); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[60], swigjobj, jbitfield); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3665,7 +3743,7 @@ bool SwigDirector_swig_peer_plugin::on_have_all() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[60], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[61], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3692,7 +3770,7 @@ bool SwigDirector_swig_peer_plugin::on_have_none() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[61], swigjobj); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[62], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3721,7 +3799,7 @@ bool SwigDirector_swig_peer_plugin::on_allowed_fast(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[62], swigjobj, jindex); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[63], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3750,7 +3828,7 @@ bool SwigDirector_swig_peer_plugin::on_request(libtorrent::peer_request const &r swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::peer_request **)&jr = (libtorrent::peer_request *) &r; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[63], swigjobj, jr); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[64], swigjobj, jr); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3781,7 +3859,7 @@ bool SwigDirector_swig_peer_plugin::on_piece(libtorrent::peer_request const &pie if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::peer_request **)&jpiece = (libtorrent::peer_request *) &piece; *(libtorrent::disk_buffer_holder **)&jdata = (libtorrent::disk_buffer_holder *) &data; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[64], swigjobj, jpiece, jdata); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[65], swigjobj, jpiece, jdata); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3810,7 +3888,7 @@ bool SwigDirector_swig_peer_plugin::on_cancel(libtorrent::peer_request const &r) swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::peer_request **)&jr = (libtorrent::peer_request *) &r; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[65], swigjobj, jr); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[66], swigjobj, jr); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3839,7 +3917,7 @@ bool SwigDirector_swig_peer_plugin::on_reject(libtorrent::peer_request const &r) swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::peer_request **)&jr = (libtorrent::peer_request *) &r; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[66], swigjobj, jr); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[67], swigjobj, jr); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3868,7 +3946,7 @@ bool SwigDirector_swig_peer_plugin::on_suggest(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[67], swigjobj, jindex); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[68], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3894,7 +3972,7 @@ void SwigDirector_swig_peer_plugin::sent_unchoke() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[68], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[69], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3920,7 +3998,7 @@ void SwigDirector_swig_peer_plugin::sent_payload(int bytes) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jbytes = (jint) bytes; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[69], swigjobj, jbytes); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[70], swigjobj, jbytes); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3947,7 +4025,7 @@ bool SwigDirector_swig_peer_plugin::can_disconnect(boost::system::error_code con swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(boost::system::error_code **)&jec = (boost::system::error_code *) &ec; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[70], swigjobj, jec); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[71], swigjobj, jec); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -3975,7 +4053,7 @@ void SwigDirector_swig_peer_plugin::on_piece_pass(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[71], swigjobj, jindex); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[72], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4001,7 +4079,7 @@ void SwigDirector_swig_peer_plugin::on_piece_failed(int index) { swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { jindex = (jint) index; - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[72], swigjobj, jindex); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[73], swigjobj, jindex); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4025,7 +4103,7 @@ void SwigDirector_swig_peer_plugin::tick() { } swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { - jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[73], swigjobj); + jenv->CallStaticVoidMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[74], swigjobj); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4052,7 +4130,7 @@ bool SwigDirector_swig_peer_plugin::write_request(libtorrent::peer_request const swigjobj = swig_get_self(jenv); if (swigjobj && jenv->IsSameObject(swigjobj, NULL) == JNI_FALSE) { *(libtorrent::peer_request **)&jr = (libtorrent::peer_request *) &r; - jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[74], swigjobj, jr); + jresult = (jboolean) jenv->CallStaticBooleanMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[75], swigjobj, jr); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4216,7 +4294,7 @@ int SwigDirector_posix_wrapper::open(char const *path, int flags, int mode) { // boohoo jflags = (jint) flags; jmode = (jint) mode; - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[75], swigjobj, jpath, jflags, jmode); + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[76], swigjobj, jpath, jflags, jmode); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4253,7 +4331,7 @@ int SwigDirector_posix_wrapper::stat(char const *path, posix_stat *buf) { Swig::LocalRefGuard path_refguard(jenv, jpath); // boohoo *((posix_stat **)&jbuf) = (posix_stat *) buf; - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[76], swigjobj, jpath, jbuf); + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[77], swigjobj, jpath, jbuf); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4290,7 +4368,7 @@ int SwigDirector_posix_wrapper::mkdir(char const *path, int mode) { Swig::LocalRefGuard path_refguard(jenv, jpath); // boohoo jmode = (jint) mode; - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[77], swigjobj, jpath, jmode); + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[78], swigjobj, jpath, jmode); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4333,7 +4411,7 @@ int SwigDirector_posix_wrapper::rename(char const *oldpath, char const *newpath) } Swig::LocalRefGuard newpath_refguard(jenv, jnewpath); // boohoo - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[78], swigjobj, joldpath, jnewpath); + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[79], swigjobj, joldpath, jnewpath); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -4368,7 +4446,7 @@ int SwigDirector_posix_wrapper::remove(char const *path) { } Swig::LocalRefGuard path_refguard(jenv, jpath); // boohoo - jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[79], swigjobj, jpath); + jresult = (jint) jenv->CallStaticIntMethod(Swig::jclass_libtorrent_jni, Swig::director_method_ids[80], swigjobj, jpath); jthrowable swigerror = jenv->ExceptionOccurred(); if (swigerror) { jenv->ExceptionClear(); @@ -52090,6 +52168,28 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_sess } +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_session_1handle_1set_1swig_1dht_1storage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { + libtorrent::session_handle *arg1 = (libtorrent::session_handle *) 0 ; + swig_dht_storage_constructor *arg2 = (swig_dht_storage_constructor *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(libtorrent::session_handle **)&jarg1; + arg2 = *(swig_dht_storage_constructor **)&jarg2; + { + try { + libtorrent_session_handle_set_swig_dht_storage(arg1,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_delete_1session_1handle(JNIEnv *jenv, jclass jcls, jlong jarg1) { libtorrent::session_handle *arg1 = (libtorrent::session_handle *) 0 ; @@ -62042,7 +62142,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_L (void)jenv; (void)jcls; - result = (char *)("6ad2b0709e8453765b913a7a035d769e14f57044"); + result = (char *)("5de20dc214154572e3dae8291c62bc36636450a3"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } @@ -62054,7 +62154,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J (void)jenv; (void)jcls; - result = (char *)("cb2541c8486591738ce33e7c6b55b50efe34086c"); + result = (char *)("38876d032107d06d7a80dbba4580b3d3b8403012"); if (result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } @@ -64955,6 +65055,138 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_swig } +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1swig_1dht_1storage_1constructor(JNIEnv *jenv, jclass jcls, jlong jarg1) { + swig_dht_storage_constructor *arg1 = (swig_dht_storage_constructor *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(swig_dht_storage_constructor **)&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_swig_1dht_1storage_1constructor_1create(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + jlong jresult = 0 ; + swig_dht_storage_constructor *arg1 = (swig_dht_storage_constructor *) 0 ; + libtorrent::sha1_hash *arg2 = 0 ; + libtorrent::dht_settings *arg3 = 0 ; + swig_dht_storage *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + arg1 = *(swig_dht_storage_constructor **)&jarg1; + arg2 = *(libtorrent::sha1_hash **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::sha1_hash const & reference is null"); + return 0; + } + arg3 = *(libtorrent::dht_settings **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::dht_settings const & reference is null"); + return 0; + } + { + try { + result = (swig_dht_storage *)(arg1)->create((libtorrent::sha1_hash const &)*arg2,(libtorrent::dht_settings const &)*arg3); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + *(swig_dht_storage **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_swig_1dht_1storage_1constructor_1createSwigExplicitswig_1dht_1storage_1constructor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { + jlong jresult = 0 ; + swig_dht_storage_constructor *arg1 = (swig_dht_storage_constructor *) 0 ; + libtorrent::sha1_hash *arg2 = 0 ; + libtorrent::dht_settings *arg3 = 0 ; + swig_dht_storage *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + (void)jarg3_; + arg1 = *(swig_dht_storage_constructor **)&jarg1; + arg2 = *(libtorrent::sha1_hash **)&jarg2; + if (!arg2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::sha1_hash const & reference is null"); + return 0; + } + arg3 = *(libtorrent::dht_settings **)&jarg3; + if (!arg3) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::dht_settings const & reference is null"); + return 0; + } + { + try { + result = (swig_dht_storage *)(arg1)->swig_dht_storage_constructor::create((libtorrent::sha1_hash const &)*arg2,(libtorrent::dht_settings const &)*arg3); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + *(swig_dht_storage **)&jresult = result; + return jresult; +} + + +SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1swig_1dht_1storage_1constructor(JNIEnv *jenv, jclass jcls) { + jlong jresult = 0 ; + swig_dht_storage_constructor *result = 0 ; + + (void)jenv; + (void)jcls; + { + try { + result = (swig_dht_storage_constructor *)new SwigDirector_swig_dht_storage_constructor(jenv); + } catch (std::exception& e) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what()); + } catch (...) { + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type"); + } + } + *(swig_dht_storage_constructor **)&jresult = result; + return jresult; +} + + +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_swig_1dht_1storage_1constructor_1director_1connect(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jswig_mem_own, jboolean jweak_global) { + swig_dht_storage_constructor *obj = *((swig_dht_storage_constructor **)&objarg); + (void)jcls; + SwigDirector_swig_dht_storage_constructor *director = static_cast(obj); + if (director) { + director->swig_connect_director(jenv, jself, jenv->GetObjectClass(jself), (jswig_mem_own == JNI_TRUE), (jweak_global == JNI_TRUE)); + } +} + + +SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_swig_1dht_1storage_1constructor_1change_1ownership(JNIEnv *jenv, jclass jcls, jobject jself, jlong objarg, jboolean jtake_or_release) { + swig_dht_storage_constructor *obj = *((swig_dht_storage_constructor **)&objarg); + SwigDirector_swig_dht_storage_constructor *director = static_cast(obj); + (void)jcls; + if (director) { + director->swig_java_change_ownership(jenv, jself, jtake_or_release ? true : false); + } +} + + SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1swig_1plugin(JNIEnv *jenv, jclass jcls, jlong jarg1) { swig_plugin *arg1 = (swig_plugin *) 0 ; @@ -68854,7 +69086,7 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_swig static struct { const char *method; const char *signature; - } methods[80] = { + } methods[81] = { { "SwigDirector_add_files_listener_pred", "(Lcom/frostwire/jlibtorrent/swig/add_files_listener;Ljava/lang/String;)Z" }, @@ -68936,6 +69168,9 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_swig { "SwigDirector_swig_dht_storage_num_mutable_data", "(Lcom/frostwire/jlibtorrent/swig/swig_dht_storage;)J" }, + { + "SwigDirector_swig_dht_storage_constructor_create", "(Lcom/frostwire/jlibtorrent/swig/swig_dht_storage_constructor;JJ)J" + }, { "SwigDirector_swig_plugin_new_torrent", "(Lcom/frostwire/jlibtorrent/swig/swig_plugin;J)J" }, diff --git a/swig/libtorrent_jni.h b/swig/libtorrent_jni.h index 3c2527b6e..6e76c49ba 100644 --- a/swig/libtorrent_jni.h +++ b/swig/libtorrent_jni.h @@ -123,6 +123,21 @@ struct SwigDirector_swig_dht_storage : public swig_dht_storage, public Swig::Dir Swig::BoolArray<12> swig_override; }; +class SwigDirector_swig_dht_storage_constructor : public swig_dht_storage_constructor, public Swig::Director { + +public: + void swig_connect_director(JNIEnv *jenv, jobject jself, jclass jcls, bool swig_mem_own, bool weak_global); + SwigDirector_swig_dht_storage_constructor(JNIEnv *jenv); + virtual ~SwigDirector_swig_dht_storage_constructor(); + virtual swig_dht_storage *create(libtorrent::sha1_hash const &id, libtorrent::dht_settings const &settings); +public: + bool swig_overrides(int n) { + return (n < 1 ? swig_override[n] : false); + } +protected: + Swig::BoolArray<1> swig_override; +}; + struct SwigDirector_swig_plugin : public swig_plugin, public Swig::Director { public: diff --git a/swig/libtorrent_node.cpp b/swig/libtorrent_node.cpp index bd96bc5b3..51d14afec 100644 --- a/swig/libtorrent_node.cpp +++ b/swig/libtorrent_node.cpp @@ -1691,22 +1691,23 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local< #define SWIGTYPE_p_std__vectorT_tcp__endpoint_t swig_types[210] #define SWIGTYPE_p_string_type swig_types[211] #define SWIGTYPE_p_swig_dht_storage swig_types[212] -#define SWIGTYPE_p_swig_peer_plugin swig_types[213] -#define SWIGTYPE_p_swig_plugin swig_types[214] -#define SWIGTYPE_p_swig_storage swig_types[215] -#define SWIGTYPE_p_swig_storage_constructor swig_types[216] -#define SWIGTYPE_p_swig_torrent_plugin swig_types[217] -#define SWIGTYPE_p_tailqueueT_libtorrent__disk_io_job_t swig_types[218] -#define SWIGTYPE_p_tcp__endpoint swig_types[219] -#define SWIGTYPE_p_udp__endpoint swig_types[220] -#define SWIGTYPE_p_unsigned_char swig_types[221] -#define SWIGTYPE_p_unsigned_int swig_types[222] -#define SWIGTYPE_p_unsigned_long_long swig_types[223] -#define SWIGTYPE_p_unsigned_short swig_types[224] -#define SWIGTYPE_p_unspecified_bool_type swig_types[225] -#define SWIGTYPE_p_value_type swig_types[226] -static swig_type_info *swig_types[228]; -static swig_module_info swig_module = {swig_types, 227, 0, 0, 0, 0}; +#define SWIGTYPE_p_swig_dht_storage_constructor swig_types[213] +#define SWIGTYPE_p_swig_peer_plugin swig_types[214] +#define SWIGTYPE_p_swig_plugin swig_types[215] +#define SWIGTYPE_p_swig_storage swig_types[216] +#define SWIGTYPE_p_swig_storage_constructor swig_types[217] +#define SWIGTYPE_p_swig_torrent_plugin swig_types[218] +#define SWIGTYPE_p_tailqueueT_libtorrent__disk_io_job_t swig_types[219] +#define SWIGTYPE_p_tcp__endpoint swig_types[220] +#define SWIGTYPE_p_udp__endpoint swig_types[221] +#define SWIGTYPE_p_unsigned_char swig_types[222] +#define SWIGTYPE_p_unsigned_int swig_types[223] +#define SWIGTYPE_p_unsigned_long_long swig_types[224] +#define SWIGTYPE_p_unsigned_short swig_types[225] +#define SWIGTYPE_p_unspecified_bool_type swig_types[226] +#define SWIGTYPE_p_value_type swig_types[227] +static swig_type_info *swig_types[229]; +static swig_module_info swig_module = {swig_types, 228, 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) @@ -2951,6 +2952,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 void libtorrent_session_handle_set_swig_dht_storage(libtorrent::session_handle *self,swig_dht_storage_constructor *sc){ + self->set_dht_storage(boost::bind(&swig_dht_storage_constructor_cb, _1, _2, sc)); + } SWIGINTERN int SWIG_AsVal_unsigned_SS_short (v8::Handle obj, unsigned short *val) @@ -3167,6 +3171,7 @@ SWIGV8_ClientData _exports_dht_extension_handler_listener_clientData; SWIGV8_ClientData _exports_swig_storage_clientData; SWIGV8_ClientData _exports_swig_storage_constructor_clientData; SWIGV8_ClientData _exports_swig_dht_storage_clientData; +SWIGV8_ClientData _exports_swig_dht_storage_constructor_clientData; SWIGV8_ClientData _exports_swig_plugin_clientData; SWIGV8_ClientData _exports_swig_torrent_plugin_clientData; SWIGV8_ClientData _exports_swig_peer_plugin_clientData; @@ -87404,6 +87409,42 @@ static SwigV8ReturnValue _wrap_session_handle_add_swig_extension(const SwigV8Arg } +static SwigV8ReturnValue _wrap_session_handle_set_swig_dht_storage(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + libtorrent::session_handle *arg1 = (libtorrent::session_handle *) 0 ; + swig_dht_storage_constructor *arg2 = (swig_dht_storage_constructor *) 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_session_handle_set_swig_dht_storage."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__session_handle, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_handle_set_swig_dht_storage" "', argument " "1"" of type '" "libtorrent::session_handle *""'"); + } + arg1 = (libtorrent::session_handle *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_swig_dht_storage_constructor, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "session_handle_set_swig_dht_storage" "', argument " "2"" of type '" "swig_dht_storage_constructor *""'"); + } + arg2 = (swig_dht_storage_constructor *)(argp2); + libtorrent_session_handle_set_swig_dht_storage(arg1,arg2); + jsresult = SWIGV8_UNDEFINED(); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + #if (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_session_handle(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); @@ -104290,7 +104331,7 @@ static SwigV8ReturnValue _wrap_LIBTORRENT_REVISION_SHA1(v8::Local pr v8::Handle jsresult; - jsresult = SWIG_FromCharPtr((const char *)"6ad2b0709e8453765b913a7a035d769e14f57044"); + jsresult = SWIG_FromCharPtr((const char *)"5de20dc214154572e3dae8291c62bc36636450a3"); SWIGV8_RETURN_INFO(jsresult, info); @@ -104305,7 +104346,7 @@ static SwigV8ReturnValue _wrap_JLIBTORRENT_REVISION_SHA1(v8::Local p v8::Handle jsresult; - jsresult = SWIG_FromCharPtr((const char *)"cb2541c8486591738ce33e7c6b55b50efe34086c"); + jsresult = SWIG_FromCharPtr((const char *)"38876d032107d06d7a80dbba4580b3d3b8403012"); SWIGV8_RETURN_INFO(jsresult, info); @@ -107140,6 +107181,111 @@ static SwigV8ReturnValue _wrap_new_swig_dht_storage(const SwigV8Arguments &args) } +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_swig_dht_storage_constructor(v8::Persistent object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_swig_dht_storage_constructor(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_swig_dht_storage_constructor(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_swig_dht_storage_constructor(const v8::WeakCallbackData &data) { + v8::Local object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + swig_dht_storage_constructor * arg1 = (swig_dht_storage_constructor *)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_swig_dht_storage_constructor_create(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + swig_dht_storage_constructor *arg1 = (swig_dht_storage_constructor *) 0 ; + libtorrent::sha1_hash *arg2 = 0 ; + libtorrent::dht_settings *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + void *argp3 ; + int res3 = 0 ; + swig_dht_storage *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_swig_dht_storage_constructor_create."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_swig_dht_storage_constructor, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "swig_dht_storage_constructor_create" "', argument " "1"" of type '" "swig_dht_storage_constructor *""'"); + } + arg1 = (swig_dht_storage_constructor *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2, SWIGTYPE_p_libtorrent__sha1_hash, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "swig_dht_storage_constructor_create" "', argument " "2"" of type '" "libtorrent::sha1_hash const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "swig_dht_storage_constructor_create" "', argument " "2"" of type '" "libtorrent::sha1_hash const &""'"); + } + arg2 = (libtorrent::sha1_hash *)(argp2); + res3 = SWIG_ConvertPtr(args[1], &argp3, SWIGTYPE_p_libtorrent__dht_settings, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "swig_dht_storage_constructor_create" "', argument " "3"" of type '" "libtorrent::dht_settings const &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "swig_dht_storage_constructor_create" "', argument " "3"" of type '" "libtorrent::dht_settings const &""'"); + } + arg3 = (libtorrent::dht_settings *)(argp3); + result = (swig_dht_storage *)(arg1)->create((libtorrent::sha1_hash const &)*arg2,(libtorrent::dht_settings const &)*arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig_dht_storage, 0 | 0 ); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_swig_dht_storage_constructor(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle self = args.Holder(); + swig_dht_storage_constructor *result; + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_swig_dht_storage_constructor."); + result = (swig_dht_storage_constructor *)new swig_dht_storage_constructor(); + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_swig_dht_storage_constructor, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + #if (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_swig_plugin(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); @@ -110423,6 +110569,7 @@ static swig_type_info _swigt__p_std__vectorT_std__string_t = {"_p_std__vectorT_s static swig_type_info _swigt__p_std__vectorT_tcp__endpoint_t = {"_p_std__vectorT_tcp__endpoint_t", "p_std__vectorT_tcp__endpoint_t|std::vector< tcp::endpoint > *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_string_type = {"_p_string_type", "string_type *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swig_dht_storage = {"_p_swig_dht_storage", "swig_dht_storage *|p_swig_dht_storage", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_swig_dht_storage_constructor = {"_p_swig_dht_storage_constructor", "p_swig_dht_storage_constructor|swig_dht_storage_constructor *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swig_peer_plugin = {"_p_swig_peer_plugin", "p_swig_peer_plugin|swig_peer_plugin *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swig_plugin = {"_p_swig_plugin", "p_swig_plugin|swig_plugin *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swig_storage = {"_p_swig_storage", "swig_storage *|p_swig_storage", 0, 0, (void*)0, 0}; @@ -110652,6 +110799,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_std__vectorT_tcp__endpoint_t, &_swigt__p_string_type, &_swigt__p_swig_dht_storage, + &_swigt__p_swig_dht_storage_constructor, &_swigt__p_swig_peer_plugin, &_swigt__p_swig_plugin, &_swigt__p_swig_storage, @@ -110881,6 +111029,7 @@ static swig_cast_info _swigc__p_std__vectorT_std__string_t[] = { {&_swigt__p_st static swig_cast_info _swigc__p_std__vectorT_tcp__endpoint_t[] = { {&_swigt__p_std__vectorT_tcp__endpoint_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_string_type[] = { {&_swigt__p_string_type, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_swig_dht_storage[] = { {&_swigt__p_swig_dht_storage, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_swig_dht_storage_constructor[] = { {&_swigt__p_swig_dht_storage_constructor, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_swig_peer_plugin[] = { {&_swigt__p_swig_peer_plugin, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_swig_plugin[] = { {&_swigt__p_swig_plugin, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_swig_storage[] = { {&_swigt__p_swig_storage, 0, 0, 0},{0, 0, 0, 0}}; @@ -111110,6 +111259,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_std__vectorT_tcp__endpoint_t, _swigc__p_string_type, _swigc__p_swig_dht_storage, + _swigc__p_swig_dht_storage_constructor, _swigc__p_swig_peer_plugin, _swigc__p_swig_plugin, _swigc__p_swig_storage, @@ -112715,6 +112865,13 @@ _exports_swig_dht_storage_clientData.dtor = _wrap_delete_swig_dht_storage; if (SWIGTYPE_p_swig_dht_storage->clientdata == 0) { SWIGTYPE_p_swig_dht_storage->clientdata = &_exports_swig_dht_storage_clientData; } +/* Name: _exports_swig_dht_storage_constructor, Type: p_swig_dht_storage_constructor, Dtor: _wrap_delete_swig_dht_storage_constructor */ +v8::Handle _exports_swig_dht_storage_constructor_class = SWIGV8_CreateClassTemplate("_exports_swig_dht_storage_constructor"); +SWIGV8_SET_CLASS_TEMPL(_exports_swig_dht_storage_constructor_clientData.class_templ, _exports_swig_dht_storage_constructor_class); +_exports_swig_dht_storage_constructor_clientData.dtor = _wrap_delete_swig_dht_storage_constructor; +if (SWIGTYPE_p_swig_dht_storage_constructor->clientdata == 0) { + SWIGTYPE_p_swig_dht_storage_constructor->clientdata = &_exports_swig_dht_storage_constructor_clientData; +} /* Name: _exports_swig_plugin, Type: p_swig_plugin, Dtor: _wrap_delete_swig_plugin */ v8::Handle _exports_swig_plugin_class = SWIGV8_CreateClassTemplate("_exports_swig_plugin"); SWIGV8_SET_CLASS_TEMPL(_exports_swig_plugin_clientData.class_templ, _exports_swig_plugin_class); @@ -114303,6 +114460,7 @@ SWIGV8_AddMemberFunction(_exports_session_handle_class, "delete_port_mapping", _ SWIGV8_AddMemberFunction(_exports_session_handle_class, "dht_get_item", _wrap_session_handle__wrap_session_handle_dht_get_item); SWIGV8_AddMemberFunction(_exports_session_handle_class, "dht_put_item", _wrap_session_handle__wrap_session_handle_dht_put_item); SWIGV8_AddMemberFunction(_exports_session_handle_class, "add_swig_extension", _wrap_session_handle_add_swig_extension); +SWIGV8_AddMemberFunction(_exports_session_handle_class, "set_swig_dht_storage", _wrap_session_handle_set_swig_dht_storage); SWIGV8_AddMemberFunction(_exports_session_class, "abort", _wrap_session_abort); SWIGV8_AddMemberFunction(_exports_disk_buffer_holder_class, "release", _wrap_disk_buffer_holder_release); SWIGV8_AddMemberFunction(_exports_disk_buffer_holder_class, "get", _wrap_disk_buffer_holder_get); @@ -114614,6 +114772,7 @@ SWIGV8_AddMemberFunction(_exports_swig_dht_storage_class, "num_torrents", _wrap_ SWIGV8_AddMemberFunction(_exports_swig_dht_storage_class, "num_peers", _wrap_swig_dht_storage_num_peers); SWIGV8_AddMemberFunction(_exports_swig_dht_storage_class, "num_immutable_data", _wrap_swig_dht_storage_num_immutable_data); SWIGV8_AddMemberFunction(_exports_swig_dht_storage_class, "num_mutable_data", _wrap_swig_dht_storage_num_mutable_data); +SWIGV8_AddMemberFunction(_exports_swig_dht_storage_constructor_class, "create", _wrap_swig_dht_storage_constructor_create); SWIGV8_AddMemberFunction(_exports_swig_plugin_class, "new_torrent", _wrap_swig_plugin_new_torrent); SWIGV8_AddMemberFunction(_exports_swig_plugin_class, "added", _wrap_swig_plugin_added); SWIGV8_AddMemberFunction(_exports_swig_plugin_class, "register_dht_extensions", _wrap_swig_plugin_register_dht_extensions); @@ -117582,6 +117741,12 @@ _exports_swig_dht_storage_class_0->SetCallHandler(_wrap_new_swig_dht_storage); _exports_swig_dht_storage_class_0->Inherit(_exports_swig_dht_storage_class); _exports_swig_dht_storage_class_0->SetHiddenPrototype(true); v8::Handle _exports_swig_dht_storage_obj = _exports_swig_dht_storage_class_0->GetFunction(); +/* Class: swig_dht_storage_constructor (_exports_swig_dht_storage_constructor) */ +v8::Handle _exports_swig_dht_storage_constructor_class_0 = SWIGV8_CreateClassTemplate("swig_dht_storage_constructor"); +_exports_swig_dht_storage_constructor_class_0->SetCallHandler(_wrap_new_swig_dht_storage_constructor); +_exports_swig_dht_storage_constructor_class_0->Inherit(_exports_swig_dht_storage_constructor_class); +_exports_swig_dht_storage_constructor_class_0->SetHiddenPrototype(true); +v8::Handle _exports_swig_dht_storage_constructor_obj = _exports_swig_dht_storage_constructor_class_0->GetFunction(); /* Class: swig_plugin (_exports_swig_plugin) */ v8::Handle _exports_swig_plugin_class_0 = SWIGV8_CreateClassTemplate("swig_plugin"); _exports_swig_plugin_class_0->SetCallHandler(_wrap_new_swig_plugin); @@ -119279,6 +119444,7 @@ exports_obj->Set(SWIGV8_SYMBOL_NEW("dht_extension_handler_listener"), _exports_d exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_storage"), _exports_swig_storage_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_storage_constructor"), _exports_swig_storage_constructor_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_dht_storage"), _exports_swig_dht_storage_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_dht_storage_constructor"), _exports_swig_dht_storage_constructor_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_plugin"), _exports_swig_plugin_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_torrent_plugin"), _exports_swig_torrent_plugin_obj); exports_obj->Set(SWIGV8_SYMBOL_NEW("swig_peer_plugin"), _exports_swig_peer_plugin_obj);