Link to home
Start Free TrialLog in
Avatar of cgray1223
cgray1223

asked on

JNI, Java and C Best Practices

Hello,

I'm using SWIG to generate my JNI layer for a large set of C APIs and I was wondering what is the best practices for the below situations.  The below not only pertain to SWIG but JNI in general.  

When C functions return pointers to Structures, should the SWIG interface file (JNI logic) be heavily used or should C wrapper functions be created to return the data in pieces (i.e. a char array that contains the various data elements)?
When C Functions return void* should the C APIs be modified to return the actual data type, whether it be primitive or structure types?
I'm unsure if I want to add a mass amount of logic and create a middle layer (SWIG interface file/JNI logic). Thoughts?
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial