require 'fiddle/import'

module FakeImgLib
  extend Fiddle::Importer
  begin
    dlload './fakeimglib.so'
    extern 'int openimage(const char *)'
  rescue Fiddle::DLError
    
    @@handle = -1
    def openimage(path)
      $stderr.puts 
      @@handle += 1
    end
    module_function :openimage
  end
end

handle = FakeImgLib.openimage()
puts