toCharPointer function

Pointer<Char> toCharPointer(
  1. String str
)

Helper function to get a char* pointer from a Dart string to pass it to c function.

Implementation

ffi.Pointer<ffi.Char> toCharPointer(String str) {
  return str.toNativeUtf8().cast<ffi.Char>();
}