Class JNRFFISupportFunctions
java.lang.Object
org.metabit.platform.interfacing.jnrffi.JNRFFISupportFunctions
supplying missing functions to JNR FFI
- Version:
- $Id: $Id
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic jnr.ffi.PointergenerateNullTerminatedStringArray(jnr.ffi.Runtime runtime, List<String> inputStrings, Charset inputEncoding, int targetBufferOffset) encode strings for passing to a function which expects an NULL-terminated array of strings.
-
Constructor Details
-
JNRFFISupportFunctions
public JNRFFISupportFunctions()
-
-
Method Details
-
generateNullTerminatedStringArray
public static jnr.ffi.Pointer generateNullTerminatedStringArray(jnr.ffi.Runtime runtime, List<String> inputStrings, Charset inputEncoding, int targetBufferOffset) encode strings for passing to a function which expects an NULL-terminated array of strings.- Parameters:
runtime- the library runtime handle, used for allocation and size calculationinputStrings- the strings to be passedinputEncoding- the encoding to be used (e.g. Charset.defaultCharset() ).targetBufferOffset- offset to use; keep 0 for most cases.- Returns:
- FFI Pointer for passing. this is the counterpart to the existing function Pointer.getNullTerminatedStringArray(0); Parameter checking is expected to be performed by the calling function.
-