summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy.zurcher@heraeus.com>2011-04-14 10:38:19 +0200
committerJérémy Zurcher <jeremy.zurcher@heraeus.com>2011-04-14 10:38:19 +0200
commite6f1c06f74fee4fb0c82100f61b0edf108abb1be (patch)
tree378e581aba4b2d5723cb1b79f8a689145794ce2b
parent1e7bb5c2b2358188067e2af256b7b07664a5f732 (diff)
downloadffi-efl-e6f1c06f74fee4fb0c82100f61b0edf108abb1be.zip
ffi-efl-e6f1c06f74fee4fb0c82100f61b0edf108abb1be.tar.gz
update eina, use FFIHelper
-rw-r--r--lib/e17/eina.rb21
1 files 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