Sha256: 7f1582bf3bd52fd7e6bf721dcebcbb146f9bf3d3d4492ce632b298d0c27b7a0a

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

require 'ffi'

module INotify
  # This module contains the low-level foreign-function interface code
  # for dealing with the inotify C APIs.
  # It's an implementation detail, and not meant for users to deal with.
  #
  # @private
  module Native
    extend FFI::Library

    # The C struct describing an inotify event.
    #
    # @private
    class Event < FFI::Struct
      layout(
        :wd, :int,
        :mask, :uint32,
        :cookie, :uint32,
        :len, :uint32)
    end

    attach_function :inotify_init, [], :int
    attach_function :inotify_add_watch, [:int, :string, :uint32], :int
    attach_function :inotify_rm_watch, [:int, :uint32], :int

    attach_function :read, [:int, :pointer, :size_t], :ssize_t
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rb-inotify-0.6.0 lib/rb-inotify/native.rb
rb-inotify-0.5.1 lib/rb-inotify/native.rb
rb-inotify-0.5.0 lib/rb-inotify/native.rb
rb-inotify-0.4.0 lib/rb-inotify/native.rb
rb-inotify-0.3.0 lib/rb-inotify/native.rb