Package org.jruby.ext.ffi.jffi
Class FFIUtil
java.lang.Object
org.jruby.ext.ffi.jffi.FFIUtil
Some utility functions for FFI <=> jffi conversions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.kenai.jffi.MemoryIOprivate static final Map<NativeType,com.kenai.jffi.Type> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static final Map<NativeType,com.kenai.jffi.Type> private static com.kenai.jffi.TypecacheFFIType(Type type) (package private) static final com.kenai.jffi.TypegetFFIType(NativeType type) (package private) static final com.kenai.jffi.TypegetFFIType(Type type) (package private) static final IRubyObjectReads a nul-terminated string from native memory and boxes it up in a ruby string.(package private) static com.kenai.jffi.ArraynewArray(Type.Array arrayType) Creates a new JFFI type descriptor for an array(package private) static final com.kenai.jffi.AggregatenewStruct(StructLayout layout) Creates a new JFFI Struct descriptor for a StructLayout
-
Field Details
-
IO
private static final com.kenai.jffi.MemoryIO IO -
typeMap
-
-
Constructor Details
-
FFIUtil
private FFIUtil()
-
-
Method Details
-
buildTypeMap
-
getFFIType
-
cacheFFIType
-
getFFIType
-
newStruct
Creates a new JFFI Struct descriptor for a StructLayout- Parameters:
layout- The structure layout- Returns:
- A new Struct descriptor.
-
newArray
Creates a new JFFI type descriptor for an array- Parameters:
arrayType- The structure layout- Returns:
- A new Struct descriptor.
-
getString
Reads a nul-terminated string from native memory and boxes it up in a ruby string.- Parameters:
runtime- The ruby runtime for the resulting string.address- The memory address to read the string from.- Returns:
- A ruby string.
-