diff options
author | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2011-04-19 16:33:28 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy.zurcher@heraeus.com> | 2011-04-19 16:33:28 +0200 |
commit | dc7e8bff7e751fe97149f41fecbe5216dbc9c890 (patch) | |
tree | 861691937b51c107e44d6b2f2c32ba3ac634a4bc /lib | |
parent | 04bbea78a76910eec93d7e113e2b3803384db7ff (diff) | |
download | ffi-efl-dc7e8bff7e751fe97149f41fecbe5216dbc9c890.zip ffi-efl-dc7e8bff7e751fe97149f41fecbe5216dbc9c890.tar.gz |
update eet lib and specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/e17/eet.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/e17/eet.rb b/lib/e17/eet.rb index 324afee..753588f 100644 --- a/lib/e17/eet.rb +++ b/lib/e17/eet.rb @@ -1,8 +1,7 @@ #! /usr/bin/env ruby # -*- coding: UTF-8 -*- # -require 'e17/eet/eet-defs' -require 'e17/eet/eet-funcs' +require 'e17/eet/eet-ffi' # module E17 module Eet @@ -11,12 +10,12 @@ module E17 # def open path, mode=FILE_MODE_READ, &blk if blk - f = eet_open path, mode + f = E17::API.eet_open path, mode raise Exception.new "Unable to open file #{path}" if f.nil? yield EetFile.new f - eet_close f + E17::API.eet_close f else - f = eet_open path, mode + f = E17::API.eet_open path, mode return EetFile.new f unless f.nil? end end @@ -30,21 +29,21 @@ module E17 private :initialize # def close - Eet.eet_close @ptr + E17::API.eet_close @ptr @ptr=nil end # def mode_get - Eet.eet_mode_get @ptr + E17::API.eet_mode_get @ptr end # def write key, data, compress=false - Eet.eet_write @ptr, key, FFI::MemoryPointer.from_string(data), data.bytesize, ( compress ? 1 : 0 ) + E17::API.eet_write @ptr, key, FFI::MemoryPointer.from_string(data), data.bytesize, ( compress ? 1 : 0 ) end # def read key ptr = FFI::MemoryPointer.new(:int) - data = Eet.eet_read @ptr, key, ptr + data = E17::API.eet_read @ptr, key, ptr s = ptr.read_int ptr.free return nil if s==0 |