Class JNRFFISupportFunctions

java.lang.Object
org.metabit.platform.interfacing.jnrffi.JNRFFISupportFunctions

public class JNRFFISupportFunctions extends Object
supplying missing functions to JNR FFI
Version:
$Id: $Id
  • 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 calculation
      inputStrings - the strings to be passed
      inputEncoding - 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.