lib/sunscraper/library.rb in sunscraper-1.1.0.beta3 vs lib/sunscraper/library.rb in sunscraper-1.2.0.beta1
- old
+ new
@@ -17,25 +17,25 @@
end
ffi_lib File.join(Gem.loaded_specs['sunscraper'].full_gem_path,
'ext', 'embed', "libsunscraper.#{extension}")
- attach_function 'create', :sunscraper_create, [], :pointer
- attach_function 'load_html', :sunscraper_load_html, [:pointer, :string], :void
- attach_function 'load_url', :sunscraper_load_url, [:pointer, :string], :void
- attach_function 'fetch', :sunscraper_fetch, [:pointer], :string
- attach_function 'discard', :sunscraper_discard, [:pointer], :void
+ attach_function 'create', :sunscraper_create, [], :uint
+ attach_function 'load_html', :sunscraper_load_html, [:uint, :string, :string], :void
+ attach_function 'load_url', :sunscraper_load_url, [:uint, :string], :void
+ attach_function 'fetch', :sunscraper_fetch, [:uint], :string
+ attach_function 'finalize', :sunscraper_finalize, [:uint], :void
if RUBY_ENGINE == 'ruby'
# MRI uses ffi gem and has GVL. Hence, it needs a rb_thread_blocking_region call.
- attach_function 'wait', :sunscraper_wait, [:pointer, :uint], :void, :blocking => true
+ attach_function 'wait', :sunscraper_wait, [:uint, :uint], :bool, :blocking => true
else
# Rubinius does not have GVL neither it has options in attach_function.
# Same for JRuby.
- attach_function 'wait', :sunscraper_wait, [:pointer, :uint], :void
+ attach_function 'wait', :sunscraper_wait, [:uint, :uint], :bool
end
- attach_function 'finalize', :sunscraper_finalize, [], :void
+ attach_function 'quit', :sunscraper_quit, [], :void
- at_exit { finalize }
+ at_exit { quit }
end
end
\ No newline at end of file