Sha256: 938fb7ab33807f6dcc990fd24a02dd4b11b800f08bd20510e7c9998bd3549196

Contents?: true

Size: 773 Bytes

Versions: 28

Compression:

Stored size: 773 Bytes

Contents

# -*- coding: utf-8 -*-
#
# Copyright 2013 whiteleaf. All rights reserved.
#

module WinAPI
  begin
    require "fiddle/import"
    extend Fiddle::Importer
  rescue LoadError
    # Fiddle がない環境用(http://www.artonx.org/data/asr/ の1.9.3とか)
    require "dl/import"
    extend DL::Importer
  end

  class InvalidOS < StandardError; end

  begin
    dlload "kernel32"
    extern "long GetLogicalDriveStrings(long, void*)"
    extern "unsigned long SetConsoleTextAttribute(unsigned long, unsigned long)"
    extern "unsigned long GetConsoleScreenBufferInfo(unsigned long, void*)"
    extern "unsigned long GetStdHandle(unsigned long)"
    extern "long GetLastError()"
  rescue DL::DLError
    raise InvalidOS, "not Windows"
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
narou-1.5.11 lib/extensions/windows.rb
narou-1.5.10.1 lib/extensions/windows.rb
narou-1.5.10 lib/extensions/windows.rb
narou-1.5.9 lib/extensions/windows.rb
narou-1.5.8 lib/extensions/windows.rb
narou-1.5.7.1 lib/extensions/windows.rb
narou-1.5.7 lib/extensions/windows.rb
narou-1.5.6.1 lib/extensions/windows.rb
narou-1.5.6 lib/extensions/windows.rb
narou-1.5.5.1 lib/extensions/windows.rb
narou-1.5.5 lib/extensions/windows.rb
narou-1.5.4 lib/extensions/windows.rb
narou-1.5.3 lib/extensions/windows.rb
narou-1.5.2.1 lib/extensions/windows.rb
narou-1.5.2 lib/extensions/windows.rb
narou-1.5.1 lib/extensions/windows.rb
narou-1.5.0.2 lib/extensions/windows.rb
narou-1.5.0.1 lib/extensions/windows.rb
narou-1.5.0 lib/extensions/windows.rb
narou-1.4.6 lib/extensions/windows.rb