Skip to content

Commit

Permalink
Swig cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 3, 2016
1 parent 9fdad5c commit 864305b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 61 deletions.
Expand Up @@ -677,7 +677,6 @@ public class libtorrent_jni {
public final static native boolean sha1_hash_op_eq(long jarg1, sha1_hash jarg1_, long jarg2, sha1_hash jarg2_);
public final static native boolean sha1_hash_op_neq(long jarg1, sha1_hash jarg1_, long jarg2, sha1_hash jarg2_);
public final static native boolean sha1_hash_op_lt(long jarg1, sha1_hash jarg1_, long jarg2, sha1_hash jarg2_);
public final static native String sha1_hash_to_string(long jarg1, sha1_hash jarg1_);
public final static native String sha1_hash_to_hex(long jarg1, sha1_hash jarg1_);
public final static native boolean sha1_hash_from_hex(String jarg1, long jarg2, sha1_hash jarg2_);
public final static native void delete_sha1_hash(long jarg1);
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/frostwire/jlibtorrent/swig/sha1_hash.java
Expand Up @@ -79,10 +79,6 @@ public boolean op_lt(sha1_hash n) {
return libtorrent_jni.sha1_hash_op_lt(swigCPtr, this, sha1_hash.getCPtr(n), n);
}

public String to_string() {
return libtorrent_jni.sha1_hash_to_string(swigCPtr, this);
}

public String to_hex() {
return libtorrent_jni.sha1_hash_to_hex(swigCPtr, this);
}
Expand Down
1 change: 1 addition & 0 deletions swig/libtorrent.i
Expand Up @@ -532,6 +532,7 @@ namespace std {
%ignore libtorrent::sha1_hash::operator[];
%ignore libtorrent::sha1_hash::assign(char const *);
%ignore libtorrent::sha1_hash::data() const;
%ignore libtorrent::sha1_hash::to_string;
%ignore libtorrent::entry::integer();
%ignore libtorrent::entry::string();
%ignore libtorrent::entry::dict() const;
Expand Down
27 changes: 2 additions & 25 deletions swig/libtorrent_jni.cpp
Expand Up @@ -18842,29 +18842,6 @@ SWIGEXPORT jboolean JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_
}


SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_sha1_1hash_1to_1string(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jstring jresult = 0 ;
libtorrent::sha1_hash *arg1 = (libtorrent::sha1_hash *) 0 ;
std::string result;

(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(libtorrent::sha1_hash **)&jarg1;
{
try {
result = ((libtorrent::sha1_hash const *)arg1)->to_string();
} 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_sha1_1hash_1to_1hex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jstring jresult = 0 ;
libtorrent::sha1_hash *arg1 = (libtorrent::sha1_hash *) 0 ;
Expand Down Expand Up @@ -64298,7 +64275,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_L

(void)jenv;
(void)jcls;
result = (char *)("06aef866f6a86bda3135f6abdc7fd5377d3cbb02");
result = (char *)("38c1b1d93280a8e865977fc9a176ec32896a053b");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand All @@ -64310,7 +64287,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J

(void)jenv;
(void)jcls;
result = (char *)("5da6d58ffb8f2e8b2e381406d8df9ef659b0caee");
result = (char *)("9fdad5c9f78883032c4c1b1d7bb6c3aacdf94ff3");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand Down
33 changes: 2 additions & 31 deletions swig/libtorrent_node.cpp
Expand Up @@ -26137,34 +26137,6 @@ static SwigV8ReturnValue _wrap_sha1_hash_op_lt(const SwigV8Arguments &args) {
}


static SwigV8ReturnValue _wrap_sha1_hash_to_string(const SwigV8Arguments &args) {
SWIGV8_HANDLESCOPE();

v8::Handle<v8::Value> jsresult;
libtorrent::sha1_hash *arg1 = (libtorrent::sha1_hash *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
std::string result;

if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_sha1_hash_to_string.");

res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_libtorrent__sha1_hash, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sha1_hash_to_string" "', argument " "1"" of type '" "libtorrent::sha1_hash const *""'");
}
arg1 = (libtorrent::sha1_hash *)(argp1);
result = ((libtorrent::sha1_hash const *)arg1)->to_string();
jsresult = SWIG_From_std_string((std::string)(result));


SWIGV8_RETURN(jsresult);

goto fail;
fail:
SWIGV8_RETURN(SWIGV8_UNDEFINED());
}


static SwigV8ReturnValue _wrap_sha1_hash_to_hex(const SwigV8Arguments &args) {
SWIGV8_HANDLESCOPE();

Expand Down Expand Up @@ -108453,7 +108425,7 @@ static SwigV8ReturnValue _wrap_LIBTORRENT_REVISION_SHA1(v8::Local<v8::String> pr

v8::Handle<v8::Value> jsresult;

jsresult = SWIG_FromCharPtr((const char *)"06aef866f6a86bda3135f6abdc7fd5377d3cbb02");
jsresult = SWIG_FromCharPtr((const char *)"38c1b1d93280a8e865977fc9a176ec32896a053b");

SWIGV8_RETURN_INFO(jsresult, info);

Expand All @@ -108468,7 +108440,7 @@ static SwigV8ReturnValue _wrap_JLIBTORRENT_REVISION_SHA1(v8::Local<v8::String> p

v8::Handle<v8::Value> jsresult;

jsresult = SWIG_FromCharPtr((const char *)"5da6d58ffb8f2e8b2e381406d8df9ef659b0caee");
jsresult = SWIG_FromCharPtr((const char *)"9fdad5c9f78883032c4c1b1d7bb6c3aacdf94ff3");

SWIGV8_RETURN_INFO(jsresult, info);

Expand Down Expand Up @@ -116223,7 +116195,6 @@ SWIGV8_AddMemberFunction(_exports_sha1_hash_class, "is_all_zeros", _wrap_sha1_ha
SWIGV8_AddMemberFunction(_exports_sha1_hash_class, "op_eq", _wrap_sha1_hash_op_eq);
SWIGV8_AddMemberFunction(_exports_sha1_hash_class, "op_neq", _wrap_sha1_hash_op_neq);
SWIGV8_AddMemberFunction(_exports_sha1_hash_class, "op_lt", _wrap_sha1_hash_op_lt);
SWIGV8_AddMemberFunction(_exports_sha1_hash_class, "to_string", _wrap_sha1_hash_to_string);
SWIGV8_AddMemberFunction(_exports_sha1_hash_class, "to_hex", _wrap_sha1_hash_to_hex);
SWIGV8_AddStaticVariable(exports_obj, "storage_mode_allocate", _wrap_libtorrent_storage_mode_allocate, JS_veto_set_variable);
SWIGV8_AddStaticVariable(exports_obj, "storage_mode_sparse", _wrap_libtorrent_storage_mode_sparse, JS_veto_set_variable);
Expand Down

0 comments on commit 864305b

Please sign in to comment.