(no title)
the-alchemist | 1 year ago
I'm sure someone will come along and write annotations to do exactly as you describe there. The Java language folks tend to be very conservative about putting stuff in the official API, cuz they know it'll have to stay there for 30+ years. They prefer to let the community write something like annotations over low-level APIs.
Anyway, the GraalVM folks don't have quite the same limitations as Java, so they have annotations already (https://yyhh.org/blog/2021/02/writing-c-code-in-javaclojure-...):
@CStruct("MDB_val")
public interface MDB_val extends PointerBase {
@CField("mv_size")
long get_mv_size();
@CField("mv_size")
void set_mv_size(long value);
@CField("mv_data")
VoidPointer get_mv_data();
@CField("mv_data")
void set_mv_data(VoidPointer value);
}
pjmlp|1 year ago