From e6f1c06f74fee4fb0c82100f61b0edf108abb1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 14 Apr 2011 10:38:19 +0200 Subject: update eina, use FFIHelper --- lib/e17/eina.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/e17/eina.rb b/lib/e17/eina.rb index bdb3522..9309cfe 100644 --- a/lib/e17/eina.rb +++ b/lib/e17/eina.rb @@ -1,29 +1,24 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'ffi' +require 'e17/ffi_helper' # module E17 module EINA # + extend FFIHelper extend FFI::Library # ffi_lib 'eina' - [ + # + fcts = [ [ :eina_init, [], :int], [ :eina_shutdown, [], :int], - ].each do |func| - begin - attach_function *func - rescue Object => e - puts "Could not attach #{func} #{e.message}" - end - end + ] + # + attach_fcts fcts # - class << self - alias init eina_init - alias shutdown eina_shutdown - end + create_aliases 'eina_'.length, fcts # end end -- cgit v1.1-2-g2b99