projects
/
ldk-java
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add some additional writing hooks which C# needs
[ldk-java]
/
java_strings.py
diff --git
a/java_strings.py
b/java_strings.py
index fcf9edd29e43cd331fd62c6217e5f5ead03542ee..d956e0e11678ba66e3db3bbe4b2f7a941a8263cd 100644
(file)
--- a/
java_strings.py
+++ b/
java_strings.py
@@
-11,6
+11,7
@@
class Consts:
self.target = target
self.c_array_class_caches = set()
self.c_type_map = dict(
self.target = target
self.c_array_class_caches = set()
self.c_type_map = dict(
+ bool = ['boolean'],
uint8_t = ['byte'],
uint16_t = ['short'],
uint32_t = ['int'],
uint8_t = ['byte'],
uint16_t = ['short'],
uint32_t = ['int'],
@@
-84,8
+85,6
@@
public class version {
}
}"""
}
}"""
- self.bindings_footer = "}\n"
-
self.util_fn_pfx = """package org.ldk.structs;
import org.ldk.impl.bindings;
import org.ldk.enums.*;
self.util_fn_pfx = """package org.ldk.structs;
import org.ldk.impl.bindings;
import org.ldk.enums.*;
@@
-474,6
+473,7
@@
import java.lang.ref.Reference;
import javax.annotation.Nullable;
"""
import javax.annotation.Nullable;
"""
+ self.hu_struct_file_suffix = ""
self.c_fn_ty_pfx = "JNIEXPORT "
self.c_fn_args_pfx = "JNIEnv *env, jclass clz"
self.file_ext = ".java"
self.c_fn_ty_pfx = "JNIEXPORT "
self.c_fn_args_pfx = "JNIEnv *env, jclass clz"
self.file_ext = ".java"
@@
-488,6
+488,9
@@
import javax.annotation.Nullable;
self.is_arr_some_check = ("", " != NULL")
self.get_native_arr_len_call = ("(*env)->GetArrayLength(env, ", ")")
self.is_arr_some_check = ("", " != NULL")
self.get_native_arr_len_call = ("(*env)->GetArrayLength(env, ", ")")
+ def bindings_footer(self):
+ return "}\n"
+
def construct_jenv(self):
res = "JNIEnv *env;\n"
res += "jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);\n"
def construct_jenv(self):
res = "JNIEnv *env;\n"
res += "jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);\n"