You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if I am asking something "obvious"; but neither the Type Mapping page, nor ninety minutes of web searches did yield anything in this regard, so maybe it is best to ask at the source.
I try to JNR-FFI-map a certain library (X11), and the very first function I need to call returns an pointer to a struct.
I checked the C header files, yes, it returns an pointer to this struct.
It is not a case where you supply a buffer or pointer-to-pointer; these I know.
Now I did try to define the struct, and declare the interface entry thus: TheStruct functionName(String parameter).
Kaboom: segfault.
What is the correct approach to map such a function to JNR FFI?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Sorry if I am asking something "obvious"; but neither the Type Mapping page, nor ninety minutes of web searches did yield anything in this regard, so maybe it is best to ask at the source.
I try to JNR-FFI-map a certain library (X11), and the very first function I need to call returns an pointer to a struct.
I checked the C header files, yes, it returns an pointer to this struct.
It is not a case where you supply a buffer or pointer-to-pointer; these I know.
Now I did try to define the struct, and declare the interface entry thus:
TheStruct functionName(String parameter)
.Kaboom: segfault.
What is the correct approach to map such a function to JNR FFI?
Beta Was this translation helpful? Give feedback.
All reactions