summaryrefslogtreecommitdiffstats
path: root/lib/efl/ffi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/efl/ffi.rb')
-rw-r--r--lib/efl/ffi.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/efl/ffi.rb b/lib/efl/ffi.rb
new file mode 100644
index 0000000..8af2042
--- /dev/null
+++ b/lib/efl/ffi.rb
@@ -0,0 +1,44 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'ffi'
+#
+module Efl
+ #
+ module API
+ #
+ extend FFI::Library
+ #
+ def attach_fcts fcts
+ fcts.each do |func|
+ begin
+ attach_function *func
+ rescue Object => e
+ puts "Could not attach #{func} #{e.message}"
+ end
+ end
+ end
+ module_function :attach_fcts
+ #
+ typedef :pointer, :int_p
+ typedef :pointer, :uint_p
+ typedef :pointer, :void_p
+ typedef :pointer, :uchar_p
+ typedef :pointer, :float_p
+ typedef :pointer, :double_p
+ typedef :pointer, :string_array
+ typedef :pointer, :string_array_p
+ #
+ typedef :pointer, :eina_list_p
+ typedef :pointer, :eina_iterator_p
+ typedef :pointer, :eina_accessor_p
+ typedef :pointer, :evas_p
+ typedef :pointer, :evas_object_p
+ #
+ end
+ #
+end
+#
+require 'efl/eina/eina_types-ffi'
+#
+# EOF