summaryrefslogtreecommitdiffstats
path: root/lib/efl/native/eina_xattr.rb
blob: f16f0fd1e3297afc2e1fbda23239cfa7bb4704d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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