projects
/
ldk-java
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
16e2274
)
Map more methods that go in UtilMethods
author
Matt Corallo
<git@bluematt.me>
Thu, 29 Apr 2021 18:29:34 +0000
(18:29 +0000)
committer
Matt Corallo
<git@bluematt.me>
Sat, 1 May 2021 00:11:31 +0000
(
00:11
+0000)
genbindings.py
patch
|
blob
|
history
java_strings.py
patch
|
blob
|
history
diff --git
a/genbindings.py
b/genbindings.py
index 32980aa3c4e7cf8071ebcff248bac9d1ca9993d2..fe0d6f74a3bf3fbb2625e043f720b027df121825 100755
(executable)
--- a/
genbindings.py
+++ b/
genbindings.py
@@
-468,8
+468,8
@@
with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java:
or expected_struct in complex_enums or expected_cstruct in complex_enums
or expected_cstruct in result_types) and not is_free:
out_java_struct = open(f"{sys.argv[3]}/structs/{struct_meth}{consts.file_ext}", "a")
or expected_struct in complex_enums or expected_cstruct in complex_enums
or expected_cstruct in result_types) and not is_free:
out_java_struct = open(f"{sys.argv[3]}/structs/{struct_meth}{consts.file_ext}", "a")
- elif
method_name.startswith("C2Tuple_") and method_name.endswith("_read"):
- struct_meth = method_name.rsplit("_", 1)[0]
+ elif
(method_name.startswith("C2Tuple_") and method_name.endswith("_read")) or \
+ (return_type_info.rust_obj is not None and "Result" in return_type_info.rust_obj and "from" in method_name):
out_java_struct = open(f"{sys.argv[3]}/structs/UtilMethods{consts.file_ext}", "a")
if out_java_struct is not None:
out_java_struct.write(out_java_struct_delta)
out_java_struct = open(f"{sys.argv[3]}/structs/UtilMethods{consts.file_ext}", "a")
if out_java_struct is not None:
out_java_struct.write(out_java_struct_delta)
diff --git
a/java_strings.py
b/java_strings.py
index 96d6909678ce7e58997f7866a4af65b0db8b40ef..0c86200e9a1535ec378ad0436374ccadbae62deb 100644
(file)
--- a/
java_strings.py
+++ b/
java_strings.py
@@
-60,6
+60,7
@@
public class bindings {
self.util_fn_pfx = """package org.ldk.structs;
import org.ldk.impl.bindings;
import java.util.Arrays;
self.util_fn_pfx = """package org.ldk.structs;
import org.ldk.impl.bindings;
import java.util.Arrays;
+import org.ldk.enums.*;
public class UtilMethods {
"""
public class UtilMethods {
"""