-
Enhancement
-
Resolution: Fixed
-
P3
-
repo-panama
-
None
-
generic
-
generic
jextract generates one interface per C header file and the user has to bind the interface using Libraries.bind method to get an implementation.
This does not feel natural to access C shared objects from Java code via an interface. jextract should generate a static forwarder class per C header. The static forwarder class will hold a library interface reference as a static private field and call Libraries.bind to initialize it (in <clinit> method).
User can use "import static" to import static forwarder and access C api with more natural way. No bind, no interaceObj.func() calls - just straight func() calls.
This does not feel natural to access C shared objects from Java code via an interface. jextract should generate a static forwarder class per C header. The static forwarder class will hold a library interface reference as a static private field and call Libraries.bind to initialize it (in <clinit> method).
User can use "import static" to import static forwarder and access C api with more natural way. No bind, no interaceObj.func() calls - just straight func() calls.