jnr / jnr-ffi

Java Abstracted Foreign Function Layer
Other
1.23k stars 154 forks source link

Cannot pass a struct to 'c' function by value #321

Open mcsherrylabs opened 1 year ago

mcsherrylabs commented 1 year ago

I can't find a way to have the c function interpret the struct by value ...

I can do this

long struct_num_al_test(SomeStruct *s) { return s -> count; }

using something in java like

public long struct_num_al_test(SomeStruct s);

But I cannot do this

long struct_num_al_test(SomeStruct s) { return s.count; }

Expected outcome: Be able to create a java api call param list that satisifies a c function expecting a struct by value

Test Case