Module: FFI::BitMasks

Defined in:
lib/ffi/bit_masks.rb,
lib/ffi/bit_masks/version.rb,
lib/ffi/bit_masks/bit_mask.rb

Overview

Adds bitmask types to FFI libraries.

Defined Under Namespace

Classes: BitMask

Constant Summary collapse

VERSION =

ffi-bit_masks version

"0.1.1"

Instance Method Summary collapse

Instance Method Details

#bit_mask(name, flags, type = :uint) ⇒ BitMask

Defines a new bitmask.

Parameters:

  • name (Symbol)

    The name of the bitmask.

  • flags (Hash{Symbol => Integer})

    The flags and their masks.

  • type (Symbol) (defaults to: :uint)

    The underlying type.

Returns:



24
25
26
27
28
29
# File 'lib/ffi/bit_masks.rb', line 24

def bit_mask(name,flags,type=:uint)
  bit_mask = BitMask.new(flags,type)

  typedef(bit_mask,name)
  return bit_mask
end