summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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