Test current state of things, which actually doesn't crash!
[ldk-java] / genbindings.py
index 838bd2710a9c98448f6afb8b529f441009dcdc9e..cf033916ee719da00482740e0f8f33fd109f63f1 100755 (executable)
@@ -290,6 +290,13 @@ public class bindings {
     out_c.write("#include <string.h>\n")
     out_c.write("#include <stdatomic.h>\n\n")
 
+    # XXX: Temporarily write out a manual SecretKey_new() for testing, we should auto-gen this kind of thing
+    out_java.write("\tpublic static native long LDKSecretKey_new();\n\n") # TODO: rm me
+    out_c.write("JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {\n") # TODO: rm me
+    out_c.write("\tLDKSecretKey* key = (LDKSecretKey*)malloc(sizeof(LDKSecretKey));\n") # TODO: rm me
+    out_c.write("\treturn (long)key;\n") # TODO: rm me
+    out_c.write("}\n") # TODO: rm me
+
     in_block_comment = False
     in_block_enum = False
     cur_block_struct = None