Module: FDB::FDBC

Extended by:
FFI::Library
Defined in:
lib/fdbimpl.rb

Defined Under Namespace

Classes: KeyStruct, KeyValueStruct

Class Method Summary collapse

Class Method Details

.check_error(code) ⇒ Object

Raises:



139
140
141
142
# File 'lib/fdbimpl.rb', line 139

def self.check_error(code)
  raise Error.new(code) if code.nonzero?
  nil
end

.init_c_apiObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/fdbimpl.rb', line 70

def self.init_c_api
  attach_function :fdb_get_error, [ :fdb_error ], :string

  attach_function :fdb_network_set_option, [ :int, :pointer, :int ], :fdb_error
  attach_function :fdb_setup_network, [ ], :fdb_error
  attach_function :fdb_run_network, [ ], :fdb_error, :blocking => true
  attach_function :fdb_stop_network, [ ], :fdb_error

  attach_function :fdb_future_cancel, [ :pointer ], :void
  attach_function :fdb_future_release_memory, [ :pointer ], :void
  attach_function :fdb_future_destroy, [ :pointer ], :void
  attach_function :fdb_future_block_until_ready, [ :pointer ], :fdb_error, :blocking => true
  attach_function :fdb_future_is_ready, [ :pointer ], :fdb_bool

  callback :fdb_future_callback, [ :pointer, :pointer ], :void
  attach_function :fdb_future_set_callback, [ :pointer, :fdb_future_callback, :pointer ], :fdb_error

  attach_function :fdb_future_get_error, [ :pointer ], :fdb_error
  attach_function :fdb_future_get_int64, [ :pointer, :pointer ], :fdb_error
  attach_function :fdb_future_get_key, [ :pointer, :pointer, :pointer ], :fdb_error
  attach_function :fdb_future_get_value, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
  attach_function :fdb_future_get_keyvalue_array, [ :pointer, :pointer, :pointer, :pointer ], :fdb_error
  attach_function :fdb_future_get_string_array, [ :pointer, :pointer, :pointer ], :fdb_error

  attach_function :fdb_create_database, [ :string, :pointer ], :fdb_error

  attach_function :fdb_database_destroy, [ :pointer ], :void
  attach_function :fdb_database_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error

  attach_function :fdb_database_create_transaction, [ :pointer, :pointer ], :fdb_error
  attach_function :fdb_transaction_destroy, [ :pointer ], :void
  attach_function :fdb_transaction_cancel, [ :pointer ], :void
  attach_function :fdb_transaction_atomic_op, [ :pointer, :pointer, :int, :pointer, :int, :int ], :void
  attach_function :fdb_transaction_add_conflict_range, [ :pointer, :pointer, :int, :pointer, :int, :int ], :int
  attach_function :fdb_transaction_get_addresses_for_key, [ :pointer, :pointer, :int ], :pointer
  attach_function :fdb_transaction_set_option, [ :pointer, :int, :pointer, :int ], :fdb_error
  attach_function :fdb_transaction_set_read_version, [ :pointer, :int64 ], :void
  attach_function :fdb_transaction_get_read_version, [ :pointer ], :pointer
  attach_function :fdb_transaction_get, [ :pointer, :pointer, :int, :int ], :pointer
  attach_function :fdb_transaction_get_key, [ :pointer, :pointer, :int, :int, :int, :int ], :pointer
  attach_function :fdb_transaction_get_range, [ :pointer, :pointer, :int, :int, :int, :pointer, :int, :int, :int, :int, :int, :int, :int, :int, :int ], :pointer
  attach_function :fdb_transaction_get_estimated_range_size_bytes, [ :pointer, :pointer, :int, :pointer, :int ], :pointer
  attach_function :fdb_transaction_get_range_split_points, [ :pointer, :pointer, :int, :pointer, :int, :int64 ], :pointer
  attach_function :fdb_transaction_set, [ :pointer, :pointer, :int, :pointer, :int ], :void
  attach_function :fdb_transaction_clear, [ :pointer, :pointer, :int ], :void
  attach_function :fdb_transaction_clear_range, [ :pointer, :pointer, :int, :pointer, :int ], :void
  attach_function :fdb_transaction_watch, [ :pointer, :pointer, :int ], :pointer
  attach_function :fdb_transaction_commit, [ :pointer ], :pointer
  attach_function :fdb_transaction_get_committed_version, [ :pointer, :pointer ], :fdb_error
  attach_function :fdb_transaction_get_approximate_size, [ :pointer ], :pointer
  attach_function :fdb_transaction_get_versionstamp, [ :pointer ], :pointer
  attach_function :fdb_transaction_on_error, [ :pointer, :fdb_error ], :pointer
  attach_function :fdb_transaction_reset, [ :pointer ], :void
end