Module | FFI
In: | lib/ffi/pointer.rb lib/ffi/autopointer.rb lib/ffi/struct_layout_builder.rb lib/ffi/io.rb lib/ffi/union.rb lib/ffi/struct.rb lib/ffi/tools/generator.rb lib/ffi/tools/const_generator.rb lib/ffi/tools/struct_generator.rb lib/ffi/tools/types_generator.rb lib/ffi/variadic.rb lib/ffi/enum.rb lib/ffi/types.rb lib/ffi/library.rb lib/ffi/platform.rb lib/ffi/managedstruct.rb lib/ffi/errno.rb

Copyright (C) 2008-2010 Wayne Meissner

All rights reserved.

This file is part of ruby-ffi.

This code is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 only, as published by the Free Software Foundation.

This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License version 3 for more details.

You should have received a copy of the GNU Lesser General Public License version 3 along with this work. If not, see <www.gnu.org/licenses/>.

### Methods

add_typedef errno errno= find_type map_library_name type_size typedef

### Classes and Modules

Module FFI::Generator
Module FFI::IO
Module FFI::Library
Module FFI::Platform
Class FFI::AutoPointer
Class FFI::ConstGenerator
Class FFI::Enum
Class FFI::Enums
Class FFI::Generator
Class FFI::ManagedStruct
Class FFI::NotFoundError
Class FFI::PlatformError
Class FFI::Pointer
Class FFI::StrPtrConverter
Class FFI::Struct
Class FFI::StructGenerator
Class FFI::StructLayout
Class FFI::StructLayoutBuilder
Class FFI::TypesGenerator
Class FFI::Union
Class FFI::VariadicInvoker

### Constants

CURRENT_PROCESS | = | USE_THIS_PROCESS_AS_LIBRARY = Object.new
ARCH | = | case CPU.downcase

### Public Class methods

add_typedef(old, add)

(see FFI.typedef)

errno()

@return (see FFI::LastError.error) @see FFI::LastError.error

errno=(error)

@param error (see FFI::LastError.error=) @return (see FFI::LastError.error=) @see FFI::LastError.error=

find_type(name, type_map = nil)

@param [Type, DataConverter, Symbol] name @param [Hash] type_map if nil, {FFI::TypeDefs} is used @return [Type] Find a type in `type_map` ({FFI::TypeDefs}, by default) from a type objet, a type name (symbol). If `name` is a {DataConverter}, a new {Type::Mapped} is created.

map_library_name(lib)

@param [to_s] lib library name @return [String] library name formatted for current platform Transform a generic library name to a platform library name @example

     # Linux
     FFI.map_library_name 'c'     # -> "libc.so.6"
     FFI.map_library_name 'jpeg'  # -> "libjpeg.so"
     # Windows
     FFI.map_library_name 'c'     # -> "msvcrt.dll"
     FFI.map_library_name 'jpeg'  # -> "jpeg.dll"

type_size(type)

@param type `type` is an instance of class accepted by {FFI.find_type} @return [Numeric] Get `type` size, in bytes.

typedef(old, add)

@param [Type, DataConverter, Symbol] old type definition used by {FFI.find_type} @param [Symbol] add new type definition‘s name to add @return [Type] Add a definition type to type definitions.

[Validate]