Sha256: 96d9ab88fb02e3b96479b860d3ec0b923656811b78a12f9b52ee5414592c3e2a

Contents?: true

Size: 861 Bytes

Versions: 1

Compression:

Stored size: 861 Bytes

Contents

module UV
  typedef :uint32_t, :in_addr_t
  typedef :uint16, :in_port_t
  typedef :int, :mode_t
  # http://stackoverflow.com/questions/1953639/is-it-safe-to-cast-socket-to-int-under-win64
  typedef :int, :uv_os_sock_t

  module WS2
    extend FFI::Library
    ffi_lib('Ws2_32.dll').first  # this is for ntohs
    attach_function :ntohs, [:ushort], :ushort, :blocking => true
  end
  def_delegators :WS2, :ntohs
  module_function :ntohs

  # win32 has a different uv_buf_t layout to everything else.
  class UvBuf < FFI::Struct
    layout :len, :ulong, :base, :pointer
  end

  # win32 uses _stati64
  class UvFSStat < FFI::Struct
    layout :st_gid, :gid_t, :st_atime, :time_t, :st_ctime, :time_t, :st_dev, :dev_t,
    :st_ino, :ino_t, :st_mode, :mode_t, :st_mtime, :time_t, :st_nlink, :nlink_t,
    :st_rdev, :dev_t, :st_size, :off_t, :st_uid, :uid_t
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uvrb-0.2.0 lib/uv/types/windows.rb