blend2d-bindings 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/ChangeLog +26 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +41 -0
  5. data/examples/test.rb +46 -0
  6. data/examples/util/setup_blend2d.rb +46 -0
  7. data/lib/blend2d.rb +95 -0
  8. data/lib/blend2d_api.rb +255 -0
  9. data/lib/blend2d_array.rb +319 -0
  10. data/lib/blend2d_bitarray.rb +275 -0
  11. data/lib/blend2d_bitset.rb +311 -0
  12. data/lib/blend2d_context.rb +1613 -0
  13. data/lib/blend2d_filesystem.rb +211 -0
  14. data/lib/blend2d_font.rb +281 -0
  15. data/lib/blend2d_fontdata.rb +209 -0
  16. data/lib/blend2d_fontdefs.rb +552 -0
  17. data/lib/blend2d_fontface.rb +345 -0
  18. data/lib/blend2d_fontfeaturesettings.rb +210 -0
  19. data/lib/blend2d_fontmanager.rb +187 -0
  20. data/lib/blend2d_fontvariationsettings.rb +210 -0
  21. data/lib/blend2d_format.rb +112 -0
  22. data/lib/blend2d_geometry.rb +424 -0
  23. data/lib/blend2d_glyphbuffer.rb +141 -0
  24. data/lib/blend2d_glyphrun.rb +101 -0
  25. data/lib/blend2d_gradient.rb +429 -0
  26. data/lib/blend2d_image.rb +291 -0
  27. data/lib/blend2d_imagecodec.rb +219 -0
  28. data/lib/blend2d_imagedecoder.rb +168 -0
  29. data/lib/blend2d_imageencoder.rb +159 -0
  30. data/lib/blend2d_matrix.rb +132 -0
  31. data/lib/blend2d_object.rb +326 -0
  32. data/lib/blend2d_path.rb +511 -0
  33. data/lib/blend2d_pattern.rb +202 -0
  34. data/lib/blend2d_pixelconverter.rb +109 -0
  35. data/lib/blend2d_random.rb +77 -0
  36. data/lib/blend2d_rgba.rb +95 -0
  37. data/lib/blend2d_runtime.rb +259 -0
  38. data/lib/blend2d_string.rb +245 -0
  39. data/lib/blend2d_var.rb +294 -0
  40. data/lib/libblend2d.aarch64.so +0 -0
  41. data/lib/libblend2d.arm64.dylib +0 -0
  42. data/lib/libblend2d.dll +0 -0
  43. data/lib/libblend2d.x86_64.dylib +0 -0
  44. data/lib/libblend2d.x86_64.so +0 -0
  45. metadata +99 -0
@@ -0,0 +1,319 @@
1
+ # Ruby-Blend2D : Yet another Blend2D wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/blend2d-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+ require_relative 'blend2d_object'
9
+
10
+ module Blend2D
11
+ extend FFI::Library
12
+ # Define/Macro
13
+
14
+
15
+ # Enum
16
+
17
+
18
+ # Typedef
19
+
20
+
21
+ # Struct
22
+
23
+ class BLArrayCore < FFI::Struct
24
+ layout(
25
+ :_d, BLObjectDetail,
26
+ )
27
+ def _d = self[:_d]
28
+ def _d=(v) self[:_d] = v end
29
+ def init(arrayType) = blArrayInit(self, arrayType)
30
+ def self.create()
31
+ instance = BLArrayCore.new
32
+ blArrayInit(instance)
33
+ instance
34
+ end
35
+ def initMove(other) = blArrayInitMove(self, other)
36
+ def initWeak(other) = blArrayInitWeak(self, other)
37
+ def destroy() = blArrayDestroy(self)
38
+ def reset() = blArrayReset(self)
39
+ def getSize() = blArrayGetSize(self)
40
+ def getCapacity() = blArrayGetCapacity(self)
41
+ def getItemSize() = blArrayGetItemSize(self)
42
+ def getData() = blArrayGetData(self)
43
+ def clear() = blArrayClear(self)
44
+ def shrink() = blArrayShrink(self)
45
+ def reserve(n) = blArrayReserve(self, n)
46
+ def resize(n, fill) = blArrayResize(self, n, fill)
47
+ def makeMutable(dataOut) = blArrayMakeMutable(self, dataOut)
48
+ def modifyOp(op, n, dataOut) = blArrayModifyOp(self, op, n, dataOut)
49
+ def insertOp(index, n, dataOut) = blArrayInsertOp(self, index, n, dataOut)
50
+ def assignMove(other) = blArrayAssignMove(self, other)
51
+ def assignWeak(other) = blArrayAssignWeak(self, other)
52
+ def assignDeep(other) = blArrayAssignDeep(self, other)
53
+ def assignData(data, n) = blArrayAssignData(self, data, n)
54
+ def assignExternalData(data, size, capacity, dataAccessFlags, destroyFunc, userData) = blArrayAssignExternalData(self, data, size, capacity, dataAccessFlags, destroyFunc, userData)
55
+ def appendU8(value) = blArrayAppendU8(self, value)
56
+ def appendU16(value) = blArrayAppendU16(self, value)
57
+ def appendU32(value) = blArrayAppendU32(self, value)
58
+ def appendU64(value) = blArrayAppendU64(self, value)
59
+ def appendF32(value) = blArrayAppendF32(self, value)
60
+ def appendF64(value) = blArrayAppendF64(self, value)
61
+ def appendItem(item) = blArrayAppendItem(self, item)
62
+ def appendData(data, n) = blArrayAppendData(self, data, n)
63
+ def insertU8(index, value) = blArrayInsertU8(self, index, value)
64
+ def insertU16(index, value) = blArrayInsertU16(self, index, value)
65
+ def insertU32(index, value) = blArrayInsertU32(self, index, value)
66
+ def insertU64(index, value) = blArrayInsertU64(self, index, value)
67
+ def insertF32(index, value) = blArrayInsertF32(self, index, value)
68
+ def insertF64(index, value) = blArrayInsertF64(self, index, value)
69
+ def insertItem(index, item) = blArrayInsertItem(self, index, item)
70
+ def insertData(index, data, n) = blArrayInsertData(self, index, data, n)
71
+ def replaceU8(index, value) = blArrayReplaceU8(self, index, value)
72
+ def replaceU16(index, value) = blArrayReplaceU16(self, index, value)
73
+ def replaceU32(index, value) = blArrayReplaceU32(self, index, value)
74
+ def replaceU64(index, value) = blArrayReplaceU64(self, index, value)
75
+ def replaceF32(index, value) = blArrayReplaceF32(self, index, value)
76
+ def replaceF64(index, value) = blArrayReplaceF64(self, index, value)
77
+ def replaceItem(index, item) = blArrayReplaceItem(self, index, item)
78
+ def replaceData(rStart, rEnd, data, n) = blArrayReplaceData(self, rStart, rEnd, data, n)
79
+ def removeIndex(index) = blArrayRemoveIndex(self, index)
80
+ def removeRange(rStart, rEnd) = blArrayRemoveRange(self, rStart, rEnd)
81
+ def equals(b) = blArrayEquals(a, b)
82
+ end
83
+
84
+ class BLArrayImpl < FFI::Struct
85
+ layout(
86
+ :data, :pointer,
87
+ :size, :ulong_long,
88
+ :capacity, :ulong_long,
89
+ )
90
+ def data = self[:data]
91
+ def data=(v) self[:data] = v end
92
+ def size = self[:size]
93
+ def size=(v) self[:size] = v end
94
+ def capacity = self[:capacity]
95
+ def capacity=(v) self[:capacity] = v end
96
+ def self.create_as(_data_, _size_, _capacity_)
97
+ instance = BLArrayImpl.new
98
+ instance[:data] = _data_
99
+ instance[:size] = _size_
100
+ instance[:capacity] = _capacity_
101
+ instance
102
+ end
103
+ end
104
+
105
+
106
+ # Function
107
+
108
+ def self.setup_array_symbols(output_error = false)
109
+ symbols = [
110
+ :blArrayInit,
111
+ :blArrayInitMove,
112
+ :blArrayInitWeak,
113
+ :blArrayDestroy,
114
+ :blArrayReset,
115
+ :blArrayGetSize,
116
+ :blArrayGetCapacity,
117
+ :blArrayGetItemSize,
118
+ :blArrayGetData,
119
+ :blArrayClear,
120
+ :blArrayShrink,
121
+ :blArrayReserve,
122
+ :blArrayResize,
123
+ :blArrayMakeMutable,
124
+ :blArrayModifyOp,
125
+ :blArrayInsertOp,
126
+ :blArrayAssignMove,
127
+ :blArrayAssignWeak,
128
+ :blArrayAssignDeep,
129
+ :blArrayAssignData,
130
+ :blArrayAssignExternalData,
131
+ :blArrayAppendU8,
132
+ :blArrayAppendU16,
133
+ :blArrayAppendU32,
134
+ :blArrayAppendU64,
135
+ :blArrayAppendF32,
136
+ :blArrayAppendF64,
137
+ :blArrayAppendItem,
138
+ :blArrayAppendData,
139
+ :blArrayInsertU8,
140
+ :blArrayInsertU16,
141
+ :blArrayInsertU32,
142
+ :blArrayInsertU64,
143
+ :blArrayInsertF32,
144
+ :blArrayInsertF64,
145
+ :blArrayInsertItem,
146
+ :blArrayInsertData,
147
+ :blArrayReplaceU8,
148
+ :blArrayReplaceU16,
149
+ :blArrayReplaceU32,
150
+ :blArrayReplaceU64,
151
+ :blArrayReplaceF32,
152
+ :blArrayReplaceF64,
153
+ :blArrayReplaceItem,
154
+ :blArrayReplaceData,
155
+ :blArrayRemoveIndex,
156
+ :blArrayRemoveRange,
157
+ :blArrayEquals,
158
+ ]
159
+ apis = {
160
+ :blArrayInit => :blArrayInit,
161
+ :blArrayInitMove => :blArrayInitMove,
162
+ :blArrayInitWeak => :blArrayInitWeak,
163
+ :blArrayDestroy => :blArrayDestroy,
164
+ :blArrayReset => :blArrayReset,
165
+ :blArrayGetSize => :blArrayGetSize,
166
+ :blArrayGetCapacity => :blArrayGetCapacity,
167
+ :blArrayGetItemSize => :blArrayGetItemSize,
168
+ :blArrayGetData => :blArrayGetData,
169
+ :blArrayClear => :blArrayClear,
170
+ :blArrayShrink => :blArrayShrink,
171
+ :blArrayReserve => :blArrayReserve,
172
+ :blArrayResize => :blArrayResize,
173
+ :blArrayMakeMutable => :blArrayMakeMutable,
174
+ :blArrayModifyOp => :blArrayModifyOp,
175
+ :blArrayInsertOp => :blArrayInsertOp,
176
+ :blArrayAssignMove => :blArrayAssignMove,
177
+ :blArrayAssignWeak => :blArrayAssignWeak,
178
+ :blArrayAssignDeep => :blArrayAssignDeep,
179
+ :blArrayAssignData => :blArrayAssignData,
180
+ :blArrayAssignExternalData => :blArrayAssignExternalData,
181
+ :blArrayAppendU8 => :blArrayAppendU8,
182
+ :blArrayAppendU16 => :blArrayAppendU16,
183
+ :blArrayAppendU32 => :blArrayAppendU32,
184
+ :blArrayAppendU64 => :blArrayAppendU64,
185
+ :blArrayAppendF32 => :blArrayAppendF32,
186
+ :blArrayAppendF64 => :blArrayAppendF64,
187
+ :blArrayAppendItem => :blArrayAppendItem,
188
+ :blArrayAppendData => :blArrayAppendData,
189
+ :blArrayInsertU8 => :blArrayInsertU8,
190
+ :blArrayInsertU16 => :blArrayInsertU16,
191
+ :blArrayInsertU32 => :blArrayInsertU32,
192
+ :blArrayInsertU64 => :blArrayInsertU64,
193
+ :blArrayInsertF32 => :blArrayInsertF32,
194
+ :blArrayInsertF64 => :blArrayInsertF64,
195
+ :blArrayInsertItem => :blArrayInsertItem,
196
+ :blArrayInsertData => :blArrayInsertData,
197
+ :blArrayReplaceU8 => :blArrayReplaceU8,
198
+ :blArrayReplaceU16 => :blArrayReplaceU16,
199
+ :blArrayReplaceU32 => :blArrayReplaceU32,
200
+ :blArrayReplaceU64 => :blArrayReplaceU64,
201
+ :blArrayReplaceF32 => :blArrayReplaceF32,
202
+ :blArrayReplaceF64 => :blArrayReplaceF64,
203
+ :blArrayReplaceItem => :blArrayReplaceItem,
204
+ :blArrayReplaceData => :blArrayReplaceData,
205
+ :blArrayRemoveIndex => :blArrayRemoveIndex,
206
+ :blArrayRemoveRange => :blArrayRemoveRange,
207
+ :blArrayEquals => :blArrayEquals,
208
+ }
209
+ args = {
210
+ :blArrayInit => [:pointer, :int],
211
+ :blArrayInitMove => [:pointer, :pointer],
212
+ :blArrayInitWeak => [:pointer, :pointer],
213
+ :blArrayDestroy => [:pointer],
214
+ :blArrayReset => [:pointer],
215
+ :blArrayGetSize => [:pointer],
216
+ :blArrayGetCapacity => [:pointer],
217
+ :blArrayGetItemSize => [:pointer],
218
+ :blArrayGetData => [:pointer],
219
+ :blArrayClear => [:pointer],
220
+ :blArrayShrink => [:pointer],
221
+ :blArrayReserve => [:pointer, :ulong_long],
222
+ :blArrayResize => [:pointer, :ulong_long, :pointer],
223
+ :blArrayMakeMutable => [:pointer, :pointer],
224
+ :blArrayModifyOp => [:pointer, :int, :ulong_long, :pointer],
225
+ :blArrayInsertOp => [:pointer, :ulong_long, :ulong_long, :pointer],
226
+ :blArrayAssignMove => [:pointer, :pointer],
227
+ :blArrayAssignWeak => [:pointer, :pointer],
228
+ :blArrayAssignDeep => [:pointer, :pointer],
229
+ :blArrayAssignData => [:pointer, :pointer, :ulong_long],
230
+ :blArrayAssignExternalData => [:pointer, :pointer, :ulong_long, :ulong_long, :int, :BLDestroyExternalDataFunc, :pointer],
231
+ :blArrayAppendU8 => [:pointer, :uchar],
232
+ :blArrayAppendU16 => [:pointer, :ushort],
233
+ :blArrayAppendU32 => [:pointer, :uint],
234
+ :blArrayAppendU64 => [:pointer, :ulong_long],
235
+ :blArrayAppendF32 => [:pointer, :float],
236
+ :blArrayAppendF64 => [:pointer, :double],
237
+ :blArrayAppendItem => [:pointer, :pointer],
238
+ :blArrayAppendData => [:pointer, :pointer, :ulong_long],
239
+ :blArrayInsertU8 => [:pointer, :ulong_long, :uchar],
240
+ :blArrayInsertU16 => [:pointer, :ulong_long, :ushort],
241
+ :blArrayInsertU32 => [:pointer, :ulong_long, :uint],
242
+ :blArrayInsertU64 => [:pointer, :ulong_long, :ulong_long],
243
+ :blArrayInsertF32 => [:pointer, :ulong_long, :float],
244
+ :blArrayInsertF64 => [:pointer, :ulong_long, :double],
245
+ :blArrayInsertItem => [:pointer, :ulong_long, :pointer],
246
+ :blArrayInsertData => [:pointer, :ulong_long, :pointer, :ulong_long],
247
+ :blArrayReplaceU8 => [:pointer, :ulong_long, :uchar],
248
+ :blArrayReplaceU16 => [:pointer, :ulong_long, :ushort],
249
+ :blArrayReplaceU32 => [:pointer, :ulong_long, :uint],
250
+ :blArrayReplaceU64 => [:pointer, :ulong_long, :ulong_long],
251
+ :blArrayReplaceF32 => [:pointer, :ulong_long, :float],
252
+ :blArrayReplaceF64 => [:pointer, :ulong_long, :double],
253
+ :blArrayReplaceItem => [:pointer, :ulong_long, :pointer],
254
+ :blArrayReplaceData => [:pointer, :ulong_long, :ulong_long, :pointer, :ulong_long],
255
+ :blArrayRemoveIndex => [:pointer, :ulong_long],
256
+ :blArrayRemoveRange => [:pointer, :ulong_long, :ulong_long],
257
+ :blArrayEquals => [:pointer, :pointer],
258
+ }
259
+ retvals = {
260
+ :blArrayInit => :uint,
261
+ :blArrayInitMove => :uint,
262
+ :blArrayInitWeak => :uint,
263
+ :blArrayDestroy => :uint,
264
+ :blArrayReset => :uint,
265
+ :blArrayGetSize => :ulong_long,
266
+ :blArrayGetCapacity => :ulong_long,
267
+ :blArrayGetItemSize => :ulong_long,
268
+ :blArrayGetData => :pointer,
269
+ :blArrayClear => :uint,
270
+ :blArrayShrink => :uint,
271
+ :blArrayReserve => :uint,
272
+ :blArrayResize => :uint,
273
+ :blArrayMakeMutable => :uint,
274
+ :blArrayModifyOp => :uint,
275
+ :blArrayInsertOp => :uint,
276
+ :blArrayAssignMove => :uint,
277
+ :blArrayAssignWeak => :uint,
278
+ :blArrayAssignDeep => :uint,
279
+ :blArrayAssignData => :uint,
280
+ :blArrayAssignExternalData => :uint,
281
+ :blArrayAppendU8 => :uint,
282
+ :blArrayAppendU16 => :uint,
283
+ :blArrayAppendU32 => :uint,
284
+ :blArrayAppendU64 => :uint,
285
+ :blArrayAppendF32 => :uint,
286
+ :blArrayAppendF64 => :uint,
287
+ :blArrayAppendItem => :uint,
288
+ :blArrayAppendData => :uint,
289
+ :blArrayInsertU8 => :uint,
290
+ :blArrayInsertU16 => :uint,
291
+ :blArrayInsertU32 => :uint,
292
+ :blArrayInsertU64 => :uint,
293
+ :blArrayInsertF32 => :uint,
294
+ :blArrayInsertF64 => :uint,
295
+ :blArrayInsertItem => :uint,
296
+ :blArrayInsertData => :uint,
297
+ :blArrayReplaceU8 => :uint,
298
+ :blArrayReplaceU16 => :uint,
299
+ :blArrayReplaceU32 => :uint,
300
+ :blArrayReplaceU64 => :uint,
301
+ :blArrayReplaceF32 => :uint,
302
+ :blArrayReplaceF64 => :uint,
303
+ :blArrayReplaceItem => :uint,
304
+ :blArrayReplaceData => :uint,
305
+ :blArrayRemoveIndex => :uint,
306
+ :blArrayRemoveRange => :uint,
307
+ :blArrayEquals => :bool,
308
+ }
309
+ symbols.each do |sym|
310
+ begin
311
+ attach_function apis[sym], sym, args[sym], retvals[sym]
312
+ rescue FFI::NotFoundError => error
313
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
314
+ end
315
+ end
316
+ end
317
+
318
+ end
319
+
@@ -0,0 +1,275 @@
1
+ # Ruby-Blend2D : Yet another Blend2D wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/blend2d-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+ require_relative 'blend2d_object'
9
+
10
+ module Blend2D
11
+ extend FFI::Library
12
+ # Define/Macro
13
+
14
+
15
+ # Enum
16
+
17
+
18
+ # Typedef
19
+
20
+
21
+ # Struct
22
+
23
+ class BLBitArrayCore < FFI::Struct
24
+ layout(
25
+ :_d, BLObjectDetail,
26
+ )
27
+ def _d = self[:_d]
28
+ def _d=(v) self[:_d] = v end
29
+ def init() = blBitArrayInit(self)
30
+ def self.create()
31
+ instance = BLBitArrayCore.new
32
+ blBitArrayInit(instance)
33
+ instance
34
+ end
35
+ def initMove(other) = blBitArrayInitMove(self, other)
36
+ def initWeak(other) = blBitArrayInitWeak(self, other)
37
+ def destroy() = blBitArrayDestroy(self)
38
+ def reset() = blBitArrayReset(self)
39
+ def assignMove(other) = blBitArrayAssignMove(self, other)
40
+ def assignWeak(other) = blBitArrayAssignWeak(self, other)
41
+ def assignWords(wordData, wordCount) = blBitArrayAssignWords(self, wordData, wordCount)
42
+ def isEmpty() = blBitArrayIsEmpty(self)
43
+ def getSize() = blBitArrayGetSize(self)
44
+ def getWordCount() = blBitArrayGetWordCount(self)
45
+ def getCapacity() = blBitArrayGetCapacity(self)
46
+ def getData() = blBitArrayGetData(self)
47
+ def getCardinality() = blBitArrayGetCardinality(self)
48
+ def getCardinalityInRange(startBit, endBit) = blBitArrayGetCardinalityInRange(self, startBit, endBit)
49
+ def hasBit(bitIndex) = blBitArrayHasBit(self, bitIndex)
50
+ def hasBitsInRange(startBit, endBit) = blBitArrayHasBitsInRange(self, startBit, endBit)
51
+ def subsumes(b) = blBitArraySubsumes(a, b)
52
+ def intersects(b) = blBitArrayIntersects(a, b)
53
+ def getRange(startOut, endOut) = blBitArrayGetRange(self, startOut, endOut)
54
+ def equals(b) = blBitArrayEquals(a, b)
55
+ def compare(b) = blBitArrayCompare(a, b)
56
+ def clear() = blBitArrayClear(self)
57
+ def resize(nBits) = blBitArrayResize(self, nBits)
58
+ def reserve(nBits) = blBitArrayReserve(self, nBits)
59
+ def shrink() = blBitArrayShrink(self)
60
+ def setBit(bitIndex) = blBitArraySetBit(self, bitIndex)
61
+ def fillRange(startBit, endBit) = blBitArrayFillRange(self, startBit, endBit)
62
+ def fillWords(bitIndex, wordData, wordCount) = blBitArrayFillWords(self, bitIndex, wordData, wordCount)
63
+ def clearBit(bitIndex) = blBitArrayClearBit(self, bitIndex)
64
+ def clearRange(startBit, endBit) = blBitArrayClearRange(self, startBit, endBit)
65
+ def clearWord(bitIndex, wordValue) = blBitArrayClearWord(self, bitIndex, wordValue)
66
+ def clearWords(bitIndex, wordData, wordCount) = blBitArrayClearWords(self, bitIndex, wordData, wordCount)
67
+ def replaceOp(nBits, dataOut) = blBitArrayReplaceOp(self, nBits, dataOut)
68
+ def replaceBit(bitIndex, bitValue) = blBitArrayReplaceBit(self, bitIndex, bitValue)
69
+ def replaceWord(bitIndex, wordValue) = blBitArrayReplaceWord(self, bitIndex, wordValue)
70
+ def replaceWords(bitIndex, wordData, wordCount) = blBitArrayReplaceWords(self, bitIndex, wordData, wordCount)
71
+ def appendBit(bitValue) = blBitArrayAppendBit(self, bitValue)
72
+ def appendWord(wordValue) = blBitArrayAppendWord(self, wordValue)
73
+ def appendWords(wordData, wordCount) = blBitArrayAppendWords(self, wordData, wordCount)
74
+ end
75
+
76
+ class BLBitArrayImpl < FFI::Struct
77
+ layout(
78
+ :size, :uint,
79
+ :capacity, :uint,
80
+ )
81
+ def size = self[:size]
82
+ def size=(v) self[:size] = v end
83
+ def capacity = self[:capacity]
84
+ def capacity=(v) self[:capacity] = v end
85
+ def self.create_as(_size_, _capacity_)
86
+ instance = BLBitArrayImpl.new
87
+ instance[:size] = _size_
88
+ instance[:capacity] = _capacity_
89
+ instance
90
+ end
91
+ end
92
+
93
+
94
+ # Function
95
+
96
+ def self.setup_bitarray_symbols(output_error = false)
97
+ symbols = [
98
+ :blBitArrayInit,
99
+ :blBitArrayInitMove,
100
+ :blBitArrayInitWeak,
101
+ :blBitArrayDestroy,
102
+ :blBitArrayReset,
103
+ :blBitArrayAssignMove,
104
+ :blBitArrayAssignWeak,
105
+ :blBitArrayAssignWords,
106
+ :blBitArrayIsEmpty,
107
+ :blBitArrayGetSize,
108
+ :blBitArrayGetWordCount,
109
+ :blBitArrayGetCapacity,
110
+ :blBitArrayGetData,
111
+ :blBitArrayGetCardinality,
112
+ :blBitArrayGetCardinalityInRange,
113
+ :blBitArrayHasBit,
114
+ :blBitArrayHasBitsInRange,
115
+ :blBitArraySubsumes,
116
+ :blBitArrayIntersects,
117
+ :blBitArrayGetRange,
118
+ :blBitArrayEquals,
119
+ :blBitArrayCompare,
120
+ :blBitArrayClear,
121
+ :blBitArrayResize,
122
+ :blBitArrayReserve,
123
+ :blBitArrayShrink,
124
+ :blBitArraySetBit,
125
+ :blBitArrayFillRange,
126
+ :blBitArrayFillWords,
127
+ :blBitArrayClearBit,
128
+ :blBitArrayClearRange,
129
+ :blBitArrayClearWord,
130
+ :blBitArrayClearWords,
131
+ :blBitArrayReplaceOp,
132
+ :blBitArrayReplaceBit,
133
+ :blBitArrayReplaceWord,
134
+ :blBitArrayReplaceWords,
135
+ :blBitArrayAppendBit,
136
+ :blBitArrayAppendWord,
137
+ :blBitArrayAppendWords,
138
+ ]
139
+ apis = {
140
+ :blBitArrayInit => :blBitArrayInit,
141
+ :blBitArrayInitMove => :blBitArrayInitMove,
142
+ :blBitArrayInitWeak => :blBitArrayInitWeak,
143
+ :blBitArrayDestroy => :blBitArrayDestroy,
144
+ :blBitArrayReset => :blBitArrayReset,
145
+ :blBitArrayAssignMove => :blBitArrayAssignMove,
146
+ :blBitArrayAssignWeak => :blBitArrayAssignWeak,
147
+ :blBitArrayAssignWords => :blBitArrayAssignWords,
148
+ :blBitArrayIsEmpty => :blBitArrayIsEmpty,
149
+ :blBitArrayGetSize => :blBitArrayGetSize,
150
+ :blBitArrayGetWordCount => :blBitArrayGetWordCount,
151
+ :blBitArrayGetCapacity => :blBitArrayGetCapacity,
152
+ :blBitArrayGetData => :blBitArrayGetData,
153
+ :blBitArrayGetCardinality => :blBitArrayGetCardinality,
154
+ :blBitArrayGetCardinalityInRange => :blBitArrayGetCardinalityInRange,
155
+ :blBitArrayHasBit => :blBitArrayHasBit,
156
+ :blBitArrayHasBitsInRange => :blBitArrayHasBitsInRange,
157
+ :blBitArraySubsumes => :blBitArraySubsumes,
158
+ :blBitArrayIntersects => :blBitArrayIntersects,
159
+ :blBitArrayGetRange => :blBitArrayGetRange,
160
+ :blBitArrayEquals => :blBitArrayEquals,
161
+ :blBitArrayCompare => :blBitArrayCompare,
162
+ :blBitArrayClear => :blBitArrayClear,
163
+ :blBitArrayResize => :blBitArrayResize,
164
+ :blBitArrayReserve => :blBitArrayReserve,
165
+ :blBitArrayShrink => :blBitArrayShrink,
166
+ :blBitArraySetBit => :blBitArraySetBit,
167
+ :blBitArrayFillRange => :blBitArrayFillRange,
168
+ :blBitArrayFillWords => :blBitArrayFillWords,
169
+ :blBitArrayClearBit => :blBitArrayClearBit,
170
+ :blBitArrayClearRange => :blBitArrayClearRange,
171
+ :blBitArrayClearWord => :blBitArrayClearWord,
172
+ :blBitArrayClearWords => :blBitArrayClearWords,
173
+ :blBitArrayReplaceOp => :blBitArrayReplaceOp,
174
+ :blBitArrayReplaceBit => :blBitArrayReplaceBit,
175
+ :blBitArrayReplaceWord => :blBitArrayReplaceWord,
176
+ :blBitArrayReplaceWords => :blBitArrayReplaceWords,
177
+ :blBitArrayAppendBit => :blBitArrayAppendBit,
178
+ :blBitArrayAppendWord => :blBitArrayAppendWord,
179
+ :blBitArrayAppendWords => :blBitArrayAppendWords,
180
+ }
181
+ args = {
182
+ :blBitArrayInit => [:pointer],
183
+ :blBitArrayInitMove => [:pointer, :pointer],
184
+ :blBitArrayInitWeak => [:pointer, :pointer],
185
+ :blBitArrayDestroy => [:pointer],
186
+ :blBitArrayReset => [:pointer],
187
+ :blBitArrayAssignMove => [:pointer, :pointer],
188
+ :blBitArrayAssignWeak => [:pointer, :pointer],
189
+ :blBitArrayAssignWords => [:pointer, :pointer, :uint],
190
+ :blBitArrayIsEmpty => [:pointer],
191
+ :blBitArrayGetSize => [:pointer],
192
+ :blBitArrayGetWordCount => [:pointer],
193
+ :blBitArrayGetCapacity => [:pointer],
194
+ :blBitArrayGetData => [:pointer],
195
+ :blBitArrayGetCardinality => [:pointer],
196
+ :blBitArrayGetCardinalityInRange => [:pointer, :uint, :uint],
197
+ :blBitArrayHasBit => [:pointer, :uint],
198
+ :blBitArrayHasBitsInRange => [:pointer, :uint, :uint],
199
+ :blBitArraySubsumes => [:pointer, :pointer],
200
+ :blBitArrayIntersects => [:pointer, :pointer],
201
+ :blBitArrayGetRange => [:pointer, :pointer, :pointer],
202
+ :blBitArrayEquals => [:pointer, :pointer],
203
+ :blBitArrayCompare => [:pointer, :pointer],
204
+ :blBitArrayClear => [:pointer],
205
+ :blBitArrayResize => [:pointer, :uint],
206
+ :blBitArrayReserve => [:pointer, :uint],
207
+ :blBitArrayShrink => [:pointer],
208
+ :blBitArraySetBit => [:pointer, :uint],
209
+ :blBitArrayFillRange => [:pointer, :uint, :uint],
210
+ :blBitArrayFillWords => [:pointer, :uint, :pointer, :uint],
211
+ :blBitArrayClearBit => [:pointer, :uint],
212
+ :blBitArrayClearRange => [:pointer, :uint, :uint],
213
+ :blBitArrayClearWord => [:pointer, :uint, :uint],
214
+ :blBitArrayClearWords => [:pointer, :uint, :pointer, :uint],
215
+ :blBitArrayReplaceOp => [:pointer, :uint, :pointer],
216
+ :blBitArrayReplaceBit => [:pointer, :uint, :bool],
217
+ :blBitArrayReplaceWord => [:pointer, :uint, :uint],
218
+ :blBitArrayReplaceWords => [:pointer, :uint, :pointer, :uint],
219
+ :blBitArrayAppendBit => [:pointer, :bool],
220
+ :blBitArrayAppendWord => [:pointer, :uint],
221
+ :blBitArrayAppendWords => [:pointer, :pointer, :uint],
222
+ }
223
+ retvals = {
224
+ :blBitArrayInit => :uint,
225
+ :blBitArrayInitMove => :uint,
226
+ :blBitArrayInitWeak => :uint,
227
+ :blBitArrayDestroy => :uint,
228
+ :blBitArrayReset => :uint,
229
+ :blBitArrayAssignMove => :uint,
230
+ :blBitArrayAssignWeak => :uint,
231
+ :blBitArrayAssignWords => :uint,
232
+ :blBitArrayIsEmpty => :bool,
233
+ :blBitArrayGetSize => :uint,
234
+ :blBitArrayGetWordCount => :uint,
235
+ :blBitArrayGetCapacity => :uint,
236
+ :blBitArrayGetData => :pointer,
237
+ :blBitArrayGetCardinality => :uint,
238
+ :blBitArrayGetCardinalityInRange => :uint,
239
+ :blBitArrayHasBit => :bool,
240
+ :blBitArrayHasBitsInRange => :bool,
241
+ :blBitArraySubsumes => :bool,
242
+ :blBitArrayIntersects => :bool,
243
+ :blBitArrayGetRange => :bool,
244
+ :blBitArrayEquals => :bool,
245
+ :blBitArrayCompare => :int,
246
+ :blBitArrayClear => :uint,
247
+ :blBitArrayResize => :uint,
248
+ :blBitArrayReserve => :uint,
249
+ :blBitArrayShrink => :uint,
250
+ :blBitArraySetBit => :uint,
251
+ :blBitArrayFillRange => :uint,
252
+ :blBitArrayFillWords => :uint,
253
+ :blBitArrayClearBit => :uint,
254
+ :blBitArrayClearRange => :uint,
255
+ :blBitArrayClearWord => :uint,
256
+ :blBitArrayClearWords => :uint,
257
+ :blBitArrayReplaceOp => :uint,
258
+ :blBitArrayReplaceBit => :uint,
259
+ :blBitArrayReplaceWord => :uint,
260
+ :blBitArrayReplaceWords => :uint,
261
+ :blBitArrayAppendBit => :uint,
262
+ :blBitArrayAppendWord => :uint,
263
+ :blBitArrayAppendWords => :uint,
264
+ }
265
+ symbols.each do |sym|
266
+ begin
267
+ attach_function apis[sym], sym, args[sym], retvals[sym]
268
+ rescue FFI::NotFoundError => error
269
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
270
+ end
271
+ end
272
+ end
273
+
274
+ end
275
+