summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-04-27 16:02:06 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-04-27 16:02:06 +0200
commit2806b37dc8f9721ac5e84755654b6b6d4ebad5a9 (patch)
tree1cb852f1df396cd13a52af43113ff1809fedf96f
parent1b74b7c89c394b4c6d6c73e3ccf9e75cac5d4fcb (diff)
downloadffi-efl-2806b37dc8f9721ac5e84755654b6b6d4ebad5a9.zip
ffi-efl-2806b37dc8f9721ac5e84755654b6b6d4ebad5a9.tar.gz
add eina_main and specs
-rw-r--r--lib/efl/eina.rb6
-rw-r--r--lib/efl/ffi/eina_main.rb45
-rw-r--r--spec/eina_spec.rb20
-rwxr-xr-xtools/extract-api.sh1
-rwxr-xr-xtools/genruby.rb3
5 files changed, 74 insertions, 1 deletions
diff --git a/lib/efl/eina.rb b/lib/efl/eina.rb
new file mode 100644
index 0000000..5141853
--- /dev/null
+++ b/lib/efl/eina.rb
@@ -0,0 +1,6 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/ffi/eina_main'
+#
+# EOF
diff --git a/lib/efl/ffi/eina_main.rb b/lib/efl/ffi/eina_main.rb
new file mode 100644
index 0000000..6d09164
--- /dev/null
+++ b/lib/efl/ffi/eina_main.rb
@@ -0,0 +1,45 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/ffi'
+#
+module Efl
+ #
+ module Eina
+ def self.method_missing m, *args, &block
+ return Efl::FFI.send 'eina_'+m.to_s, *args, &block
+ end
+ end
+ #
+ module FFI
+ #
+ #
+ ffi_lib 'eina'
+ #
+ # ENUMS
+ #
+ # TYPEDEFS
+ # typedef struct _Eina_Version Eina_Version;
+ typedef :pointer, :eina_version
+ #
+ # CALLBACKS
+ #
+ # FUNCTIONS
+ fcts = [
+ # EAPI extern Eina_Version *eina_version;
+ # FIXME
+ # EAPI int eina_init(void);
+ [ :eina_init, [ ], :int ],
+ # EAPI int eina_shutdown(void);
+ [ :eina_shutdown, [ ], :int ],
+ # EAPI int eina_threads_init(void);
+ [ :eina_threads_init, [ ], :int ],
+ # EAPI int eina_threads_shutdown(void);
+ [ :eina_threads_shutdown, [ ], :int ],
+ ]
+ #
+ attach_fcts fcts
+ end
+end
+#
+# EOF
diff --git a/spec/eina_spec.rb b/spec/eina_spec.rb
new file mode 100644
index 0000000..e76129a
--- /dev/null
+++ b/spec/eina_spec.rb
@@ -0,0 +1,20 @@
+#! /usr/bin/env ruby
+# -*- coding: UTF-8 -*-
+#
+require 'efl/eina'
+#
+describe Efl::Eina do
+ #
+ it "should init" do
+ Efl::Eina.init.should eql 1
+ Efl::Eina.init.should eql 2
+ Efl::Eina.init.should eql 3
+ end
+ #
+ it "should shutdown" do
+ Efl::Eina.shutdown.should eql 2
+ Efl::Eina.shutdown.should eql 1
+ Efl::Eina.shutdown.should eql 0
+ end
+ #
+end
diff --git a/tools/extract-api.sh b/tools/extract-api.sh
index 2fecec0..b5a4bc1 100755
--- a/tools/extract-api.sh
+++ b/tools/extract-api.sh
@@ -20,6 +20,7 @@ fi
#
for header in \
"${INCLUDE}/eina-1/eina/eina_types.h" \
+ "${INCLUDE}/eina-1/eina/eina_main.h" \
"${INCLUDE}/eet-1/Eet.h" \
"${INCLUDE}/edje-1/Edje.h" \
"${INCLUDE}/evas-1/Evas.h" \
diff --git a/tools/genruby.rb b/tools/genruby.rb
index c77cc28..c64ee59 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -4,9 +4,10 @@
path = File.dirname __FILE__
lib_path = File.join path, '..', 'lib', 'efl', 'ffi'
#
-# header, module name, lfct prefix, lib
+# header, module name, fct prefix, lib
libraries = [
[ 'eina_types.h', 'Eina', 'eina', 'eina'],
+ [ 'eina_main.h', 'Eina', 'eina', 'eina'],
[ 'Eet.h', 'Eet', 'eet', 'eet'],
[ 'Evas.h', 'Evas', 'evas', 'evas'],
# [ 'Evas_GL.h', 'EvasGl', 'evas_gl', 'evas'],