summaryrefslogtreecommitdiffstats
path: root/lib/efl/ecore.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-08 17:59:24 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-08 17:59:24 +0200
commitd62833580889816914eebb61ffcfcb26496ea883 (patch)
treeb638b8d17b9d204a8bbb15eb88089f0b68a29c68 /lib/efl/ecore.rb
downloadffi-efl-d62833580889816914eebb61ffcfcb26496ea883.zip
ffi-efl-d62833580889816914eebb61ffcfcb26496ea883.tar.gz
initial commit
Diffstat (limited to 'lib/efl/ecore.rb')
-rw-r--r--lib/efl/ecore.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/efl/ecore.rb b/lib/efl/ecore.rb
new file mode 100644
index 0000000..192a569
--- /dev/null
+++ b/lib/efl/ecore.rb
@@ -0,0 +1,38 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'ffi'
+#
+module EFL
+ module ECORE
+ #
+ MAJOR = 0
+ MINOR = 0
+ REVISION = 1
+ VERSION = [MAJOR,MINOR,REVISION].join '.'
+ #
+ extend FFI::Library
+ #
+ ffi_lib 'ecore'
+ functions = [
+ [ :ecore_init, [ ], :int ],
+ [ :ecore_shutdown, [], :int ],
+ ].each do |func|
+ begin
+ attach_function *func
+ rescue Object => e
+ puts "Could not attach #{func} #{e.message}"
+ end
+ end
+ #
+ def self.init
+ ecore_init
+ end
+ #
+ def self.shutdown
+ ecore_shutdown
+ end
+ #
+ end
+end
+#