diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-22 18:02:11 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-22 18:02:11 +0100 |
commit | 7082e7780cfbadac2ef33e1f5ce7ab6be1026314 (patch) | |
tree | ec100f30b71b10b079705118e081e924fe5bdeaf /lib/efl/native | |
parent | bb84047c45fda4c5ac9b92e4feff16054e603e87 (diff) | |
download | ffi-efl-7082e7780cfbadac2ef33e1f5ce7ab6be1026314.zip ffi-efl-7082e7780cfbadac2ef33e1f5ce7ab6be1026314.tar.gz |
update lib/efl/native/eina*
Diffstat (limited to 'lib/efl/native')
-rw-r--r-- | lib/efl/native/eina.rb | 14 | ||||
-rw-r--r-- | lib/efl/native/eina_hash.rb | 82 | ||||
-rw-r--r-- | lib/efl/native/eina_list.rb | 79 | ||||
-rw-r--r-- | lib/efl/native/eina_log.rb | 26 | ||||
-rw-r--r-- | lib/efl/native/eina_types.rb | 20 | ||||
-rw-r--r-- | lib/efl/native/eina_xattr.rb | 29 |
6 files changed, 123 insertions, 127 deletions
diff --git a/lib/efl/native/eina.rb b/lib/efl/native/eina.rb index c28ae3d..a971e34 100644 --- a/lib/efl/native/eina.rb +++ b/lib/efl/native/eina.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module Eina # - FCT_PREFIX = 'eina_' + FCT_PREFIX = 'eina_' 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 @@ -26,13 +25,12 @@ module Efl # TYPEDEFS # typedef struct _Eina_Version Eina_Version; typedef :pointer, :eina_version - typedef :pointer, :eina_version_p # # CALLBACKS # # VARIABLES # EAPI extern Eina_Version *eina_version; - attach_variable :eina_version, :eina_version_p + attach_variable :eina_version, :pointer # # FUNCTIONS fcts = [ diff --git a/lib/efl/native/eina_hash.rb b/lib/efl/native/eina_hash.rb index 383c182..0e216db 100644 --- a/lib/efl/native/eina_hash.rb +++ b/lib/efl/native/eina_hash.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module EinaHash # - FCT_PREFIX = 'eina_hash_' + FCT_PREFIX = 'eina_hash_' 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 @@ -26,86 +25,85 @@ module Efl # TYPEDEFS # typedef struct _Eina_Hash Eina_Hash; typedef :pointer, :eina_hash - typedef :pointer, :eina_hash_p # typedef struct _Eina_Hash_Tuple Eina_Hash_Tuple; typedef :pointer, :eina_hash_tuple # # CALLBACKS # typedef unsigned int (*Eina_Key_Length) (const void *key); - callback :eina_key_length, [ :void_p ], :uint + callback :eina_key_length_cb, [ :pointer ], :uint # typedef int (*Eina_Key_Cmp) (const void *key1, int key1_length, const void *key2, int key2_length); - callback :eina_key_cmp, [ :void_p, :int, :void_p, :int ], :int + callback :eina_key_cmp_cb, [ :pointer, :int, :pointer, :int ], :int # typedef int (*Eina_Key_Hash) (const void *key, int key_length); - callback :eina_key_hash, [ :void_p, :int ], :int + callback :eina_key_hash_cb, [ :pointer, :int ], :int # typedef Eina_Bool (*Eina_Hash_Foreach) (const Eina_Hash *hash, const void *key, void *data, void *fdata); - callback :eina_hash_foreach, [ :eina_hash_p, :void_p, :void_p, :void_p ], :eina_bool + callback :eina_hash_foreach_cb, [ :pointer, :pointer, :pointer, :pointer ], :eina_bool # # VARIABLES # # FUNCTIONS fcts = [ # EAPI Eina_Hash *eina_hash_new(Eina_Key_Length key_length_cb, Eina_Key_Cmp key_cmp_cb, Eina_Key_Hash key_hash_cb, Eina_Free_Cb data_free_cb, int buckets_power_size); - [ :eina_hash_new, [ :eina_key_length, :eina_key_cmp, :eina_key_hash, :eina_free_cb, :int ], :eina_hash_p ], + [ :eina_hash_new, [ :eina_key_length_cb, :eina_key_cmp_cb, :eina_key_hash_cb, :eina_free_cb, :int ], :pointer ], # EAPI void eina_hash_free_cb_set(Eina_Hash *hash, Eina_Free_Cb data_free_cb); - [ :eina_hash_free_cb_set, [ :eina_hash_p, :eina_free_cb ], :void ], + [ :eina_hash_free_cb_set, [ :pointer, :eina_free_cb ], :void ], # EAPI Eina_Hash *eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_string_djb2_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_string_djb2_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_string_superfast_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_string_superfast_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Hash *eina_hash_string_small_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_string_small_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_string_small_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Hash *eina_hash_int32_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_int32_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_int32_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Hash *eina_hash_int64_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_int64_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_int64_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Hash *eina_hash_pointer_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_pointer_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_pointer_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Hash *eina_hash_stringshared_new(Eina_Free_Cb data_free_cb); - [ :eina_hash_stringshared_new, [ :eina_free_cb ], :eina_hash_p ], + [ :eina_hash_stringshared_new, [ :eina_free_cb ], :pointer ], # EAPI Eina_Bool eina_hash_add(Eina_Hash *hash, const void *key, const void *data); - [ :eina_hash_add, [ :eina_hash_p, :void_p, :void_p ], :eina_bool ], + [ :eina_hash_add, [ :pointer, :pointer, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_hash_direct_add(Eina_Hash *hash, const void *key, const void *data); - [ :eina_hash_direct_add, [ :eina_hash_p, :void_p, :void_p ], :eina_bool ], + [ :eina_hash_direct_add, [ :pointer, :pointer, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_hash_del(Eina_Hash *hash, const void *key, const void *data); - [ :eina_hash_del, [ :eina_hash_p, :void_p, :void_p ], :eina_bool ], + [ :eina_hash_del, [ :pointer, :pointer, :pointer ], :eina_bool ], # EAPI void *eina_hash_find(const Eina_Hash *hash, const void *key); - [ :eina_hash_find, [ :eina_hash_p, :void_p ], :void_p ], + [ :eina_hash_find, [ :pointer, :pointer ], :pointer ], # EAPI void *eina_hash_modify(Eina_Hash *hash, const void *key, const void *data); - [ :eina_hash_modify, [ :eina_hash_p, :void_p, :void_p ], :void_p ], + [ :eina_hash_modify, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI void *eina_hash_set(Eina_Hash *hash, const void *key, const void *data); - [ :eina_hash_set, [ :eina_hash_p, :void_p, :void_p ], :void_p ], + [ :eina_hash_set, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI Eina_Bool eina_hash_move(Eina_Hash *hash, const void *old_key, const void *new_key); - [ :eina_hash_move, [ :eina_hash_p, :void_p, :void_p ], :eina_bool ], + [ :eina_hash_move, [ :pointer, :pointer, :pointer ], :eina_bool ], # EAPI void eina_hash_free(Eina_Hash *hash); - [ :eina_hash_free, [ :eina_hash_p ], :void ], + [ :eina_hash_free, [ :pointer ], :void ], # EAPI void eina_hash_free_buckets(Eina_Hash *hash); - [ :eina_hash_free_buckets, [ :eina_hash_p ], :void ], + [ :eina_hash_free_buckets, [ :pointer ], :void ], # EAPI int eina_hash_population(const Eina_Hash *hash); - [ :eina_hash_population, [ :eina_hash_p ], :int ], + [ :eina_hash_population, [ :pointer ], :int ], # EAPI Eina_Bool eina_hash_add_by_hash(Eina_Hash *hash, const void *key, int key_length, int key_hash, const void *data); - [ :eina_hash_add_by_hash, [ :eina_hash_p, :void_p, :int, :int, :void_p ], :eina_bool ], + [ :eina_hash_add_by_hash, [ :pointer, :pointer, :int, :int, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_hash_direct_add_by_hash(Eina_Hash *hash, const void *key, int key_length, int key_hash, const void *data); - [ :eina_hash_direct_add_by_hash, [ :eina_hash_p, :void_p, :int, :int, :void_p ], :eina_bool ], + [ :eina_hash_direct_add_by_hash, [ :pointer, :pointer, :int, :int, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_hash_del_by_key_hash(Eina_Hash *hash, const void *key, int key_length, int key_hash); - [ :eina_hash_del_by_key_hash, [ :eina_hash_p, :void_p, :int, :int ], :eina_bool ], + [ :eina_hash_del_by_key_hash, [ :pointer, :pointer, :int, :int ], :eina_bool ], # EAPI Eina_Bool eina_hash_del_by_key(Eina_Hash *hash, const void *key); - [ :eina_hash_del_by_key, [ :eina_hash_p, :void_p ], :eina_bool ], + [ :eina_hash_del_by_key, [ :pointer, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_hash_del_by_data(Eina_Hash *hash, const void *data); - [ :eina_hash_del_by_data, [ :eina_hash_p, :void_p ], :eina_bool ], + [ :eina_hash_del_by_data, [ :pointer, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_hash_del_by_hash(Eina_Hash *hash, const void *key, int key_length, int key_hash, const void *data); - [ :eina_hash_del_by_hash, [ :eina_hash_p, :void_p, :int, :int, :void_p ], :eina_bool ], + [ :eina_hash_del_by_hash, [ :pointer, :pointer, :int, :int, :pointer ], :eina_bool ], # EAPI void *eina_hash_find_by_hash(const Eina_Hash *hash, const void *key, int key_length, int key_hash); - [ :eina_hash_find_by_hash, [ :eina_hash_p, :void_p, :int, :int ], :void_p ], + [ :eina_hash_find_by_hash, [ :pointer, :pointer, :int, :int ], :pointer ], # EAPI void *eina_hash_modify_by_hash(Eina_Hash *hash, const void *key, int key_length, int key_hash, const void *data); - [ :eina_hash_modify_by_hash, [ :eina_hash_p, :void_p, :int, :int, :void_p ], :void_p ], + [ :eina_hash_modify_by_hash, [ :pointer, :pointer, :int, :int, :pointer ], :pointer ], # EAPI Eina_Iterator *eina_hash_iterator_key_new(const Eina_Hash *hash); - [ :eina_hash_iterator_key_new, [ :eina_hash_p ], :eina_iterator_p ], + [ :eina_hash_iterator_key_new, [ :pointer ], :pointer ], # EAPI Eina_Iterator *eina_hash_iterator_data_new(const Eina_Hash *hash); - [ :eina_hash_iterator_data_new, [ :eina_hash_p ], :eina_iterator_p ], + [ :eina_hash_iterator_data_new, [ :pointer ], :pointer ], # EAPI Eina_Iterator *eina_hash_iterator_tuple_new(const Eina_Hash *hash); - [ :eina_hash_iterator_tuple_new, [ :eina_hash_p ], :eina_iterator_p ], + [ :eina_hash_iterator_tuple_new, [ :pointer ], :pointer ], # EAPI void eina_hash_foreach(const Eina_Hash *hash, Eina_Hash_Foreach func, const void *fdata); - [ :eina_hash_foreach, [ :eina_hash_p, :eina_hash_foreach, :void_p ], :void ], + [ :eina_hash_foreach, [ :pointer, :eina_hash_foreach_cb, :pointer ], :void ], # EAPI int eina_hash_superfast(const char *key, int len); [ :eina_hash_superfast, [ :string, :int ], :int ], ] diff --git a/lib/efl/native/eina_list.rb b/lib/efl/native/eina_list.rb index 35a179a..52d004f 100644 --- a/lib/efl/native/eina_list.rb +++ b/lib/efl/native/eina_list.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module EinaList # - FCT_PREFIX = 'eina_list_' + FCT_PREFIX = 'eina_list_' 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 @@ -26,8 +25,6 @@ module Efl # TYPEDEFS # typedef struct _Eina_List Eina_List; typedef :pointer, :eina_list - typedef :pointer, :eina_list_p - typedef :pointer, :eina_list_pp # typedef struct _Eina_List_Accounting Eina_List_Accounting; typedef :pointer, :eina_list_accounting # @@ -38,71 +35,71 @@ module Efl # FUNCTIONS fcts = [ # EAPI Eina_List *eina_list_append(Eina_List *list, const void *data); - [ :eina_list_append, [ :eina_list_p, :void_p ], :eina_list_p ], + [ :eina_list_append, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_prepend(Eina_List *list, const void *data); - [ :eina_list_prepend, [ :eina_list_p, :void_p ], :eina_list_p ], + [ :eina_list_prepend, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_append_relative(Eina_List *list, const void *data, const void *relative); - [ :eina_list_append_relative, [ :eina_list_p, :void_p, :void_p ], :eina_list_p ], + [ :eina_list_append_relative, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_append_relative_list(Eina_List *list, const void *data, Eina_List *relative); - [ :eina_list_append_relative_list, [ :eina_list_p, :void_p, :eina_list_p ], :eina_list_p ], + [ :eina_list_append_relative_list, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_prepend_relative(Eina_List *list, const void *data, const void *relative); - [ :eina_list_prepend_relative, [ :eina_list_p, :void_p, :void_p ], :eina_list_p ], + [ :eina_list_prepend_relative, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_prepend_relative_list(Eina_List *list, const void *data, Eina_List *relative); - [ :eina_list_prepend_relative_list, [ :eina_list_p, :void_p, :eina_list_p ], :eina_list_p ], + [ :eina_list_prepend_relative_list, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_sorted_insert(Eina_List *list, Eina_Compare_Cb func, const void *data); - [ :eina_list_sorted_insert, [ :eina_list_p, :eina_compare_cb, :void_p ], :eina_list_p ], + [ :eina_list_sorted_insert, [ :pointer, :eina_compare_cb, :pointer ], :pointer ], # EAPI Eina_List *eina_list_remove(Eina_List *list, const void *data); - [ :eina_list_remove, [ :eina_list_p, :void_p ], :eina_list_p ], + [ :eina_list_remove, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_remove_list(Eina_List *list, Eina_List *remove_list); - [ :eina_list_remove_list, [ :eina_list_p, :eina_list_p ], :eina_list_p ], + [ :eina_list_remove_list, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_promote_list(Eina_List *list, Eina_List *move_list); - [ :eina_list_promote_list, [ :eina_list_p, :eina_list_p ], :eina_list_p ], + [ :eina_list_promote_list, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_demote_list(Eina_List *list, Eina_List *move_list); - [ :eina_list_demote_list, [ :eina_list_p, :eina_list_p ], :eina_list_p ], + [ :eina_list_demote_list, [ :pointer, :pointer ], :pointer ], # EAPI void *eina_list_data_find(const Eina_List *list, const void *data); - [ :eina_list_data_find, [ :eina_list_p, :void_p ], :void_p ], + [ :eina_list_data_find, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_data_find_list(const Eina_List *list, const void *data); - [ :eina_list_data_find_list, [ :eina_list_p, :void_p ], :eina_list_p ], + [ :eina_list_data_find_list, [ :pointer, :pointer ], :pointer ], # EAPI Eina_Bool eina_list_move(Eina_List **to, Eina_List **from, void *data); - [ :eina_list_move, [ :eina_list_pp, :eina_list_pp, :void_p ], :eina_bool ], + [ :eina_list_move, [ :pointer, :pointer, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_list_move_list(Eina_List **to, Eina_List **from, Eina_List *data); - [ :eina_list_move_list, [ :eina_list_pp, :eina_list_pp, :eina_list_p ], :eina_bool ], + [ :eina_list_move_list, [ :pointer, :pointer, :pointer ], :eina_bool ], # EAPI Eina_List *eina_list_free(Eina_List *list); - [ :eina_list_free, [ :eina_list_p ], :eina_list_p ], + [ :eina_list_free, [ :pointer ], :pointer ], # EAPI void *eina_list_nth(const Eina_List *list, unsigned int n); - [ :eina_list_nth, [ :eina_list_p, :uint ], :void_p ], + [ :eina_list_nth, [ :pointer, :uint ], :pointer ], # EAPI Eina_List *eina_list_nth_list(const Eina_List *list, unsigned int n); - [ :eina_list_nth_list, [ :eina_list_p, :uint ], :eina_list_p ], + [ :eina_list_nth_list, [ :pointer, :uint ], :pointer ], # EAPI Eina_List *eina_list_reverse(Eina_List *list); - [ :eina_list_reverse, [ :eina_list_p ], :eina_list_p ], + [ :eina_list_reverse, [ :pointer ], :pointer ], # EAPI Eina_List *eina_list_reverse_clone(const Eina_List *list); - [ :eina_list_reverse_clone, [ :eina_list_p ], :eina_list_p ], + [ :eina_list_reverse_clone, [ :pointer ], :pointer ], # EAPI Eina_List *eina_list_clone(const Eina_List *list); - [ :eina_list_clone, [ :eina_list_p ], :eina_list_p ], + [ :eina_list_clone, [ :pointer ], :pointer ], # EAPI Eina_List *eina_list_sort(Eina_List *list, unsigned int size, Eina_Compare_Cb func); - [ :eina_list_sort, [ :eina_list_p, :uint, :eina_compare_cb ], :eina_list_p ], + [ :eina_list_sort, [ :pointer, :uint, :eina_compare_cb ], :pointer ], # EAPI Eina_List *eina_list_merge(Eina_List *left, Eina_List *right); - [ :eina_list_merge, [ :eina_list_p, :eina_list_p ], :eina_list_p ], + [ :eina_list_merge, [ :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_sorted_merge(Eina_List *left, Eina_List *right, Eina_Compare_Cb func); - [ :eina_list_sorted_merge, [ :eina_list_p, :eina_list_p, :eina_compare_cb ], :eina_list_p ], + [ :eina_list_sorted_merge, [ :pointer, :pointer, :eina_compare_cb ], :pointer ], # EAPI Eina_List *eina_list_split_list(Eina_List *list, Eina_List *relative, Eina_List **right); - [ :eina_list_split_list, [ :eina_list_p, :eina_list_p, :eina_list_pp ], :eina_list_p ], + [ :eina_list_split_list, [ :pointer, :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_search_sorted_near_list(const Eina_List *list, Eina_Compare_Cb func, const void *data, int *result_cmp); - [ :eina_list_search_sorted_near_list, [ :eina_list_p, :eina_compare_cb, :void_p, :int_p ], :eina_list_p ], + [ :eina_list_search_sorted_near_list, [ :pointer, :eina_compare_cb, :pointer, :pointer ], :pointer ], # EAPI Eina_List *eina_list_search_sorted_list(const Eina_List *list, Eina_Compare_Cb func, const void *data); - [ :eina_list_search_sorted_list, [ :eina_list_p, :eina_compare_cb, :void_p ], :eina_list_p ], + [ :eina_list_search_sorted_list, [ :pointer, :eina_compare_cb, :pointer ], :pointer ], # EAPI void *eina_list_search_sorted(const Eina_List *list, Eina_Compare_Cb func, const void *data); - [ :eina_list_search_sorted, [ :eina_list_p, :eina_compare_cb, :void_p ], :void_p ], + [ :eina_list_search_sorted, [ :pointer, :eina_compare_cb, :pointer ], :pointer ], # EAPI Eina_List *eina_list_search_unsorted_list(const Eina_List *list, Eina_Compare_Cb func, const void *data); - [ :eina_list_search_unsorted_list, [ :eina_list_p, :eina_compare_cb, :void_p ], :eina_list_p ], + [ :eina_list_search_unsorted_list, [ :pointer, :eina_compare_cb, :pointer ], :pointer ], # EAPI void *eina_list_search_unsorted(const Eina_List *list, Eina_Compare_Cb func, const void *data); - [ :eina_list_search_unsorted, [ :eina_list_p, :eina_compare_cb, :void_p ], :void_p ], + [ :eina_list_search_unsorted, [ :pointer, :eina_compare_cb, :pointer ], :pointer ], # EAPI Eina_Iterator *eina_list_iterator_new(const Eina_List *list); - [ :eina_list_iterator_new, [ :eina_list_p ], :eina_iterator_p ], + [ :eina_list_iterator_new, [ :pointer ], :pointer ], # EAPI Eina_Iterator *eina_list_iterator_reversed_new(const Eina_List *list); - [ :eina_list_iterator_reversed_new, [ :eina_list_p ], :eina_iterator_p ], + [ :eina_list_iterator_reversed_new, [ :pointer ], :pointer ], # EAPI Eina_Accessor *eina_list_accessor_new(const Eina_List *list); - [ :eina_list_accessor_new, [ :eina_list_p ], :eina_accessor_p ], + [ :eina_list_accessor_new, [ :pointer ], :pointer ], ] # attach_fcts fcts diff --git a/lib/efl/native/eina_log.rb b/lib/efl/native/eina_log.rb index 0aab2ec..96abf7b 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, :eina_log_level_err, :eina_log_level_warn, :eina_log_level_info, :eina_log_level_dbg, + :eina_log_levels, :eina_log_level_unknown ] # # 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, [ :pointer, :eina_log_level, :string, :string, :int, :string, :pointer, :pointer ], :void # # VARIABLES # EAPI extern int EINA_LOG_DOMAIN_GLOBAL; @@ -44,7 +42,7 @@ 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); @@ -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, [ :pointer, :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, [ :pointer, :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, [ :pointer, :eina_log_level, :string, :string, :int, :string, :pointer, :pointer ], :void ], ] # attach_fcts fcts diff --git a/lib/efl/native/eina_types.rb b/lib/efl/native/eina_types.rb index 16e3b48..a30a1ba 100644 --- a/lib/efl/native/eina_types.rb +++ b/lib/efl/native/eina_types.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module Eina # - FCT_PREFIX = 'eina_' + FCT_PREFIX = 'eina_' 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 @@ -25,16 +24,15 @@ module Efl # # TYPEDEFS # typedef unsigned char Eina_Bool; - typedef :bool, :eina_bool - typedef :pointer, :eina_bool_p + typedef :eina_bool, :eina_bool # # CALLBACKS # typedef int (*Eina_Compare_Cb) (const void *data1, const void *data2); - callback :eina_compare_cb, [ :void_p, :void_p ], :int + callback :eina_compare_cb, [ :pointer, :pointer ], :int # typedef Eina_Bool (*Eina_Each_Cb) (const void *container, void *data, void *fdata); - callback :eina_each_cb, [ :void_p, :void_p, :void_p ], :eina_bool + callback :eina_each_cb, [ :pointer, :pointer, :pointer ], :eina_bool # typedef void (*Eina_Free_Cb) (void *data); - callback :eina_free_cb, [ :void_p ], :void + callback :eina_free_cb, [ :pointer ], :void # # VARIABLES # diff --git a/lib/efl/native/eina_xattr.rb b/lib/efl/native/eina_xattr.rb index f16f0fd..6cc399d 100644 --- a/lib/efl/native/eina_xattr.rb +++ b/lib/efl/native/eina_xattr.rb @@ -1,18 +1,17 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'efl/ffi' +require 'efl/native' # module Efl # module EinaXattr # - FCT_PREFIX = 'eina_xattr_' + FCT_PREFIX = 'eina_xattr_' 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 @@ -26,6 +25,8 @@ module Efl enum :eina_xattr_flags, [ :eina_xattr_insert, :eina_xattr_replace, :eina_xattr_created ] # # TYPEDEFS + # typedef struct _Eina_Xattr Eina_Xattr; + typedef :pointer, :eina_xattr # # CALLBACKS # @@ -34,11 +35,17 @@ module Efl # FUNCTIONS fcts = [ # EAPI Eina_Iterator *eina_xattr_ls(const char *file); - [ :eina_xattr_ls, [ :string ], :eina_iterator_p ], + [ :eina_xattr_ls, [ :string ], :pointer ], + # EAPI Eina_Iterator *eina_xattr_value_ls(const char *file); + [ :eina_xattr_value_ls, [ :string ], :pointer ], + # EAPI Eina_Iterator *eina_xattr_fd_ls(int fd); + [ :eina_xattr_fd_ls, [ :int ], :pointer ], + # EAPI Eina_Iterator *eina_xattr_value_fd_ls(int fd); + [ :eina_xattr_value_fd_ls, [ :int ], :pointer ], # EAPI void *eina_xattr_get(const char *file, const char *attribute, ssize_t *size); - [ :eina_xattr_get, [ :string, :string, :long_p ], :void_p ], + [ :eina_xattr_get, [ :string, :string, :pointer ], :pointer ], # EAPI Eina_Bool eina_xattr_set(const char *file, const char *attribute, const void *data, ssize_t length, Eina_Xattr_Flags flags); - [ :eina_xattr_set, [ :string, :string, :void_p, :long, :eina_xattr_flags ], :eina_bool ], + [ :eina_xattr_set, [ :string, :string, :pointer, :long, :eina_xattr_flags ], :eina_bool ], # EAPI Eina_Bool eina_xattr_string_set(const char *file, const char *attribute, const char *data, Eina_Xattr_Flags flags); [ :eina_xattr_string_set, [ :string, :string, :string, :eina_xattr_flags ], :eina_bool ], # EAPI char *eina_xattr_string_get(const char *file, const char *attribute); @@ -46,11 +53,11 @@ module Efl # EAPI Eina_Bool eina_xattr_double_set(const char *file, const char *attribute, double value, Eina_Xattr_Flags flags); [ :eina_xattr_double_set, [ :string, :string, :double, :eina_xattr_flags ], :eina_bool ], # EAPI Eina_Bool eina_xattr_double_get(const char *file, const char *attribute, double *value); - [ :eina_xattr_double_get, [ :string, :string, :double_p ], :eina_bool ], + [ :eina_xattr_double_get, [ :string, :string, :pointer ], :eina_bool ], # EAPI Eina_Bool eina_xattr_int_set(const char *file, const char *attribute, int value, Eina_Xattr_Flags flags); [ :eina_xattr_int_set, [ :string, :string, :int, :eina_xattr_flags ], :eina_bool ], # EAPI Eina_Bool eina_xattr_int_get(const char *file, const char *attribute, int *value); - [ :eina_xattr_int_get, [ :string, :string, :int_p ], :eina_bool ], + [ :eina_xattr_int_get, [ :string, :string, :pointer ], :eina_bool ], ] # attach_fcts fcts |