diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-27 15:48:45 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-02-27 15:48:45 +0100 |
commit | ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3 (patch) | |
tree | c2bb690ccc1be37c03f6dcdcf892fbf3e17f5067 /lib/efl/native/eina_log.rb | |
parent | dbb2c5713e11489dfaeb318a82785017f1794dde (diff) | |
parent | b030c490265bb13ee98a650da419a033495042ed (diff) | |
download | ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.zip ffi-efl-ef44077310b4ebf8d3cb31ccb57d15b96a94c9d3.tar.gz |
Merge branch 'wip'
Conflicts:
tools/genruby.rb
Diffstat (limited to 'lib/efl/native/eina_log.rb')
-rw-r--r-- | lib/efl/native/eina_log.rb | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/lib/efl/native/eina_log.rb b/lib/efl/native/eina_log.rb index 0aab2ec..f200485 100644 --- a/lib/efl/native/eina_log.rb +++ b/lib/efl/native/eina_log.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module EinaLog # - FCT_PREFIX = 'eina_log_' + FCT_PREFIX = 'eina_log_' unless const_defined? :FCT_PREFIX # - def self.method_missing m, *args, &block - sym, args_s = ModuleHelper.find_function m, FCT_PREFIX - self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(#{args_s}); yield r if block_given?; r; end" - self.send m, *args, &block + def self.method_missing meth, *args, &block + sym = Efl::MethodResolver.resolve self, meth, FCT_PREFIX + self.send sym, *args, &block end # end @@ -23,17 +22,16 @@ module Efl # # ENUMS # typedef enum _Eina_Log_Level {...} Eina_Log_Level; - enum :eina_log_level, [ :eina_log_level_critical, :eina_log_level_err, :eina_log_level_warn, :eina_log_level_info, :eina_log_level_dbg, :eina_log_levels, - :eina_log_level_unknown ] + enum :eina_log_level, [ :eina_log_level_critical, 0, :eina_log_level_err, 1, :eina_log_level_warn, 2, :eina_log_level_info, 3, + :eina_log_level_dbg, 4, :eina_log_levels, 5, :eina_log_level_unknown, (-2147483647-1) ] # # TYPEDEFS # typedef struct _Eina_Log_Domain Eina_Log_Domain; typedef :pointer, :eina_log_domain - typedef :pointer, :eina_log_domain_p # # CALLBACKS # typedef void (*Eina_Log_Print_Cb) (const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args); - callback :eina_log_print_cb, [ :eina_log_domain_p, :eina_log_level, :string, :string, :int, :string, :void_p, :pointer ], :void + callback :eina_log_print_cb, [ :eina_log_domain, :eina_log_level, :string, :string, :int, :string, :pointer, :pointer ], :void # # VARIABLES # EAPI extern int EINA_LOG_DOMAIN_GLOBAL; @@ -44,29 +42,29 @@ module Efl # EAPI void eina_log_threads_enable(void); [ :eina_log_threads_enable, [ ], :void ], # EAPI void eina_log_print_cb_set(Eina_Log_Print_Cb cb, void *data); - [ :eina_log_print_cb_set, [ :eina_log_print_cb, :void_p ], :void ], + [ :eina_log_print_cb_set, [ :eina_log_print_cb, :pointer ], :void ], # EAPI void eina_log_level_set(int level); [ :eina_log_level_set, [ :int ], :void ], # EAPI int eina_log_level_get(void); [ :eina_log_level_get, [ ], :int ], # EAPI Eina_Bool eina_log_main_thread_check(void); - [ :eina_log_main_thread_check, [ ], :eina_bool ], + [ :eina_log_main_thread_check, [ ], :bool ], # EAPI void eina_log_color_disable_set(Eina_Bool disabled); - [ :eina_log_color_disable_set, [ :eina_bool ], :void ], + [ :eina_log_color_disable_set, [ :bool ], :void ], # EAPI Eina_Bool eina_log_color_disable_get(void); - [ :eina_log_color_disable_get, [ ], :eina_bool ], + [ :eina_log_color_disable_get, [ ], :bool ], # EAPI void eina_log_file_disable_set(Eina_Bool disabled); - [ :eina_log_file_disable_set, [ :eina_bool ], :void ], + [ :eina_log_file_disable_set, [ :bool ], :void ], # EAPI Eina_Bool eina_log_file_disable_get(void); - [ :eina_log_file_disable_get, [ ], :eina_bool ], + [ :eina_log_file_disable_get, [ ], :bool ], # EAPI void eina_log_function_disable_set(Eina_Bool disabled); - [ :eina_log_function_disable_set, [ :eina_bool ], :void ], + [ :eina_log_function_disable_set, [ :bool ], :void ], # EAPI Eina_Bool eina_log_function_disable_get(void); - [ :eina_log_function_disable_get, [ ], :eina_bool ], + [ :eina_log_function_disable_get, [ ], :bool ], # EAPI void eina_log_abort_on_critical_set(Eina_Bool abort_on_critical); - [ :eina_log_abort_on_critical_set, [ :eina_bool ], :void ], + [ :eina_log_abort_on_critical_set, [ :bool ], :void ], # EAPI Eina_Bool eina_log_abort_on_critical_get(void); - [ :eina_log_abort_on_critical_get, [ ], :eina_bool ], + [ :eina_log_abort_on_critical_get, [ ], :bool ], # EAPI void eina_log_abort_on_critical_level_set(int critical_level); [ :eina_log_abort_on_critical_level_set, [ :int ], :void ], # EAPI int eina_log_abort_on_critical_level_get(void); @@ -86,11 +84,11 @@ module Efl # EAPI void eina_log_vprint(int domain, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, va_list args); [ :eina_log_vprint, [ :int, :eina_log_level, :string, :string, :int, :string, :pointer ], :void ], # EAPI void eina_log_print_cb_stdout(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args); - [ :eina_log_print_cb_stdout, [ :eina_log_domain_p, :eina_log_level, :string, :string, :int, :string, :void_p, :pointer ], :void ], + [ :eina_log_print_cb_stdout, [ :eina_log_domain, :eina_log_level, :string, :string, :int, :string, :pointer, :pointer ], :void ], # EAPI void eina_log_print_cb_stderr(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args); - [ :eina_log_print_cb_stderr, [ :eina_log_domain_p, :eina_log_level, :string, :string, :int, :string, :void_p, :pointer ], :void ], + [ :eina_log_print_cb_stderr, [ :eina_log_domain, :eina_log_level, :string, :string, :int, :string, :pointer, :pointer ], :void ], # EAPI void eina_log_print_cb_file(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args); - [ :eina_log_print_cb_file, [ :eina_log_domain_p, :eina_log_level, :string, :string, :int, :string, :void_p, :pointer ], :void ], + [ :eina_log_print_cb_file, [ :eina_log_domain, :eina_log_level, :string, :string, :int, :string, :pointer, :pointer ], :void ], ] # attach_fcts fcts |