Skip to content

Instantly share code, notes, and snippets.

@maebashi
maebashi / hellogluster.rb
Created November 29, 2013 06:14
The simplest libgfapi example Ruby FFI version.
require 'ffi'
module GLFS
extend FFI::Library
ffi_lib 'gfapi'
attach_function :new, :glfs_new, [:string], :pointer
attach_function :set_volfile_server, :glfs_set_volfile_server,
[:pointer, :string, :string, :int], :int
attach_function :init, :glfs_init, [:pointer], :int
attach_function :creat, :glfs_creat, [:pointer, :string, :int, :int], :pointer