diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-10-21 11:27:14 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-10-21 11:27:14 +0200 |
commit | 2b7eee3d19cbcf743302ec009e0359e90d172533 (patch) | |
tree | 311fb13baef37ffddd47121d7ac32b3600e698e4 /lib/efl/native/eina_xattr.rb | |
parent | 0328567724606036744189edd39ffabb7797bdc7 (diff) | |
download | ffi-efl-2b7eee3d19cbcf743302ec009e0359e90d172533.zip ffi-efl-2b7eee3d19cbcf743302ec009e0359e90d172533.tar.gz |
add lib/efl/native/eina_xattr.rb
Diffstat (limited to 'lib/efl/native/eina_xattr.rb')
-rw-r--r-- | lib/efl/native/eina_xattr.rb | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/lib/efl/native/eina_xattr.rb b/lib/efl/native/eina_xattr.rb new file mode 100644 index 0000000..f16f0fd --- /dev/null +++ b/lib/efl/native/eina_xattr.rb @@ -0,0 +1,61 @@ +#! /usr/bin/env ruby +# -*- coding: UTF-8 -*- +# +require 'efl/ffi' +# +module Efl + # + module EinaXattr + # + FCT_PREFIX = 'eina_xattr_' + # + 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 + end + # + end + # + module Native + # + ffi_lib 'eina' + # + # ENUMS + # typedef enum {...} Eina_Xattr_Flags; + enum :eina_xattr_flags, [ :eina_xattr_insert, :eina_xattr_replace, :eina_xattr_created ] + # + # TYPEDEFS + # + # CALLBACKS + # + # VARIABLES + # + # FUNCTIONS + fcts = [ + # EAPI Eina_Iterator *eina_xattr_ls(const char *file); + [ :eina_xattr_ls, [ :string ], :eina_iterator_p ], + # EAPI void *eina_xattr_get(const char *file, const char *attribute, ssize_t *size); + [ :eina_xattr_get, [ :string, :string, :long_p ], :void_p ], + # 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 ], + # 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); + [ :eina_xattr_string_get, [ :string, :string ], :string ], + # 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 ], + # 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 ], + ] + # + attach_fcts fcts + # + end +end +# +# EOF |