summaryrefslogtreecommitdiffstats
path: root/lib/efl/eina.rb
blob: 8f6b097c48156e8f8f58d81c1bb52f06dd91f6a1 (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
#! /usr/bin/env ruby
# -*- coding: UTF-8 -*-
#
require 'ffi'
#
module EFL
    module EINA
        #
        MAJOR = 0
        MINOR = 0
        REVISION = 1
        VERSION = [MAJOR,MINOR,REVISION].join '.'
        #
        extend FFI::Library
        #
        ffi_lib 'eina'
        functions = [
            [ :eina_init, [ ], :int ],
            [ :eina_shutdown, [], :int ],
        ].each do |func|
            begin
                attach_function *func
            rescue Object => e
                puts "Could not attach #{func} #{e.message}"
            end
        end
        #
        def self.init
            eina_init
        end
        #
        def self.shutdown
            eina_shutdown
        end
        #
    end
end
#