public static native void free_heap_ptr(long ptr);
public static native byte[] get_u8_slice_bytes(long slice_ptr);
public static native long bytes_to_u8_vec(byte[] bytes);
- public static native long u8_vec_len(long vec);
+ public static native long vec_slice_len(long vec);
""")
out_c.write("""
(*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
return (long)vec;
}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_u8_1vec_1len (JNIEnv * env, jclass _a, jlong ptr) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) {
+ // Check offsets of a few Vec types are all consistent as we're meant to be generic across types
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically");
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically");
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically");
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically");
LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
return (long)vec->datalen;
}
public static native void free_heap_ptr(long ptr);
public static native byte[] get_u8_slice_bytes(long slice_ptr);
public static native long bytes_to_u8_vec(byte[] bytes);
- public static native long u8_vec_len(long vec);
+ public static native long vec_slice_len(long vec);
public static native long LDKSecretKey_new();
(*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
return (long)vec;
}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_u8_1vec_1len (JNIEnv * env, jclass _a, jlong ptr) {
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) {
+ // Check offsets of a few Vec types are all consistent as we're meant to be generic across types
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically");
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically");
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically");
+ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically");
LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
return (long)vec->datalen;
}
/*
* Class: org_ldk_impl_bindings
- * Method: u8_vec_len
+ * Method: vec_slice_len
* Signature: (J)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_u8_1vec_1len
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len
(JNIEnv *, jclass, jlong);
/*