Skip to content

Commit

Permalink
Swig cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 10, 2016
1 parent 5b0465c commit f85cb7c
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 940 deletions.
8 changes: 0 additions & 8 deletions src/main/java/com/frostwire/jlibtorrent/swig/libtorrent.java
Expand Up @@ -101,14 +101,6 @@ public static int getUser_alert_id() {
return libtorrent_jni.user_alert_id_get();
}

public static void initialize_default_settings(session_settings s) {
libtorrent_jni.initialize_default_settings(session_settings.getCPtr(s), s);
}

public static void save_settings_to_dict(session_settings s, string_entry_map sett) {
libtorrent_jni.save_settings_to_dict(session_settings.getCPtr(s), s, string_entry_map.getCPtr(sett), sett);
}

public static int setting_by_name(String name) {
return libtorrent_jni.setting_by_name(name);
}
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/frostwire/jlibtorrent/swig/libtorrent_jni.java
Expand Up @@ -2332,16 +2332,6 @@ public class libtorrent_jni {
public final static native void dht_settings_item_lifetime_set(long jarg1, dht_settings jarg1_, int jarg2);
public final static native int dht_settings_item_lifetime_get(long jarg1, dht_settings jarg1_);
public final static native void delete_dht_settings(long jarg1);
public final static native void initialize_default_settings(long jarg1, session_settings jarg1_);
public final static native void session_settings_set_str(long jarg1, session_settings jarg1_, int jarg2, String jarg3);
public final static native String session_settings_get_str(long jarg1, session_settings jarg1_, int jarg2);
public final static native void session_settings_set_int(long jarg1, session_settings jarg1_, int jarg2, int jarg3);
public final static native int session_settings_get_int(long jarg1, session_settings jarg1_, int jarg2);
public final static native void session_settings_set_bool(long jarg1, session_settings jarg1_, int jarg2, boolean jarg3);
public final static native boolean session_settings_get_bool(long jarg1, session_settings jarg1_, int jarg2);
public final static native long new_session_settings();
public final static native void delete_session_settings(long jarg1);
public final static native void save_settings_to_dict(long jarg1, session_settings jarg1_, long jarg2, string_entry_map jarg2_);
public final static native int setting_by_name(String jarg1);
public final static native String name_for_setting(int jarg1);
public final static native void settings_pack_set_str(long jarg1, settings_pack jarg1_, int jarg2, String jarg3);
Expand Down
66 changes: 0 additions & 66 deletions src/main/java/com/frostwire/jlibtorrent/swig/session_settings.java

This file was deleted.

3 changes: 1 addition & 2 deletions swig/libtorrent.i
Expand Up @@ -55,7 +55,6 @@
#include "libtorrent/peer_info.hpp"
#include "libtorrent/session_status.hpp"
#include "libtorrent/session_settings.hpp"
#include "libtorrent/aux_/session_settings.hpp"
#include "libtorrent/settings_pack.hpp"
#include "libtorrent/peer_class.hpp"
#include "libtorrent/peer_class_type_filter.hpp"
Expand Down Expand Up @@ -460,6 +459,7 @@ namespace std {
%ignore libtorrent::copy_bufs;
%ignore libtorrent::apply_pack;
%ignore libtorrent::load_pack_from_dict;
%ignore libtorrent::save_settings_to_dict;
%ignore libtorrent::error_code;

%ignore libtorrent::detail::nop;
Expand Down Expand Up @@ -580,7 +580,6 @@ namespace std {
%include "libtorrent/peer_info.hpp"
%include "libtorrent/session_status.hpp"
%include "libtorrent/session_settings.hpp"
%include "libtorrent/aux_/session_settings.hpp"
%include "libtorrent/settings_pack.hpp"
%include "libtorrent/peer_class.hpp"
%include "libtorrent/peer_class_type_filter.hpp"
Expand Down
248 changes: 2 additions & 246 deletions swig/libtorrent_jni.cpp
Expand Up @@ -717,7 +717,6 @@ namespace Swig {
#include "libtorrent/peer_info.hpp"
#include "libtorrent/session_status.hpp"
#include "libtorrent/session_settings.hpp"
#include "libtorrent/aux_/session_settings.hpp"
#include "libtorrent/settings_pack.hpp"
#include "libtorrent/peer_class.hpp"
#include "libtorrent/peer_class_type_filter.hpp"
Expand Down Expand Up @@ -48775,249 +48774,6 @@ SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_dele
}


SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_initialize_1default_1settings(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
libtorrent::aux::session_settings *arg1 = 0 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
if (!arg1) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::aux::session_settings & reference is null");
return ;
}
{
try {
libtorrent::initialize_default_settings(*arg1);
} 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_session_1settings_1set_1str(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) {
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;
int arg2 ;
std::string *arg3 = 0 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
arg2 = (int)jarg2;
if(!jarg3) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null string");
return ;
}
const char *arg3_pstr = (const char *)jenv->GetStringUTFChars(jarg3, 0);
if (!arg3_pstr) return ;
std::string arg3_str(arg3_pstr);
arg3 = &arg3_str;
jenv->ReleaseStringUTFChars(jarg3, arg3_pstr);
{
try {
(arg1)->set_str(arg2,(std::string const &)*arg3);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
}


SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_session_1settings_1get_1str(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
jstring jresult = 0 ;
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;
int arg2 ;
std::string *result = 0 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
arg2 = (int)jarg2;
{
try {
result = (std::string *) &((libtorrent::aux::session_settings const *)arg1)->get_str(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 void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_session_1settings_1set_1int(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) {
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;
int arg2 ;
int arg3 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
arg2 = (int)jarg2;
arg3 = (int)jarg3;
{
try {
(arg1)->set_int(arg2,arg3);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
}


SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_session_1settings_1get_1int(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
jint jresult = 0 ;
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;
int arg2 ;
int result;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
arg2 = (int)jarg2;
{
try {
result = (int)((libtorrent::aux::session_settings const *)arg1)->get_int(arg2);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
jresult = (jint)result;
return jresult;
}


SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_session_1settings_1set_1bool(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3) {
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;
int arg2 ;
bool arg3 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
arg2 = (int)jarg2;
arg3 = jarg3 ? true : false;
{
try {
(arg1)->set_bool(arg2,arg3);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
}


SWIGEXPORT jboolean JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_session_1settings_1get_1bool(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
jboolean jresult = 0 ;
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;
int arg2 ;
bool result;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
arg2 = (int)jarg2;
{
try {
result = (bool)((libtorrent::aux::session_settings const *)arg1)->get_bool(arg2);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
jresult = (jboolean)result;
return jresult;
}


SWIGEXPORT jlong JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_new_1session_1settings(JNIEnv *jenv, jclass jcls) {
jlong jresult = 0 ;
libtorrent::aux::session_settings *result = 0 ;

(void)jenv;
(void)jcls;
{
try {
result = (libtorrent::aux::session_settings *)new libtorrent::aux::session_settings();
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
*(libtorrent::aux::session_settings **)&jresult = result;
return jresult;
}


SWIGEXPORT void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_delete_1session_1settings(JNIEnv *jenv, jclass jcls, jlong jarg1) {
libtorrent::aux::session_settings *arg1 = (libtorrent::aux::session_settings *) 0 ;

(void)jenv;
(void)jcls;
arg1 = *(libtorrent::aux::session_settings **)&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 void JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_save_1settings_1to_1dict(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
libtorrent::aux::session_settings *arg1 = 0 ;
libtorrent::entry::dictionary_type *arg2 = 0 ;

(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(libtorrent::aux::session_settings **)&jarg1;
if (!arg1) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::aux::session_settings const & reference is null");
return ;
}
arg2 = *(libtorrent::entry::dictionary_type **)&jarg2;
if (!arg2) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "libtorrent::entry::dictionary_type & reference is null");
return ;
}
{
try {
libtorrent::save_settings_to_dict((libtorrent::aux::session_settings const &)*arg1,*arg2);
} catch (std::exception& e) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, e.what());
} catch (...) {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "Unknown exception type");
}
}
}


SWIGEXPORT jint JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_setting_1by_1name(JNIEnv *jenv, jclass jcls, jstring jarg1) {
jint jresult = 0 ;
std::string *arg1 = 0 ;
Expand Down Expand Up @@ -61973,7 +61729,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_L

(void)jenv;
(void)jcls;
result = (char *)("896bcaf3dee0fb3ff5152636727fd8827fb1de6f");
result = (char *)("6ad2b0709e8453765b913a7a035d769e14f57044");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand All @@ -61985,7 +61741,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J

(void)jenv;
(void)jcls;
result = (char *)("f673ea18495c467b4e2e196cf4b504d9b9b57893");
result = (char *)("5b0465ca135a5457cafee7d11eeef64fdbd8dd87");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand Down

0 comments on commit f85cb7c

Please sign in to comment.