ffi 1.15.5-x64-mingw-ucrt

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +338 -0
  3. data/COPYING +49 -0
  4. data/Gemfile +14 -0
  5. data/LICENSE +24 -0
  6. data/LICENSE.SPECS +22 -0
  7. data/README.md +136 -0
  8. data/Rakefile +191 -0
  9. data/ffi.gemspec +42 -0
  10. data/lib/3.1/ffi_c.so +0 -0
  11. data/lib/ffi/abstract_memory.rb +44 -0
  12. data/lib/ffi/autopointer.rb +203 -0
  13. data/lib/ffi/buffer.rb +4 -0
  14. data/lib/ffi/callback.rb +4 -0
  15. data/lib/ffi/data_converter.rb +67 -0
  16. data/lib/ffi/enum.rb +296 -0
  17. data/lib/ffi/errno.rb +43 -0
  18. data/lib/ffi/ffi.rb +47 -0
  19. data/lib/ffi/io.rb +62 -0
  20. data/lib/ffi/library.rb +592 -0
  21. data/lib/ffi/managedstruct.rb +84 -0
  22. data/lib/ffi/memorypointer.rb +1 -0
  23. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  24. data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
  25. data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
  26. data/lib/ffi/platform/aarch64-linux/types.conf +104 -0
  27. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  28. data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
  29. data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
  30. data/lib/ffi/platform/arm-linux/types.conf +132 -0
  31. data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  32. data/lib/ffi/platform/i386-darwin/types.conf +100 -0
  33. data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  34. data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
  35. data/lib/ffi/platform/i386-gnu/types.conf +107 -0
  36. data/lib/ffi/platform/i386-linux/types.conf +103 -0
  37. data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
  38. data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
  39. data/lib/ffi/platform/i386-solaris/types.conf +122 -0
  40. data/lib/ffi/platform/i386-windows/types.conf +52 -0
  41. data/lib/ffi/platform/ia64-linux/types.conf +104 -0
  42. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  43. data/lib/ffi/platform/mips64-linux/types.conf +104 -0
  44. data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  45. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  46. data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
  47. data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
  48. data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
  49. data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
  50. data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
  51. data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
  52. data/lib/ffi/platform/powerpc-linux/types.conf +130 -0
  53. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  54. data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  55. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  56. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  57. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  58. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  59. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  60. data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
  61. data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
  62. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  63. data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
  64. data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  65. data/lib/ffi/platform/x86_64-darwin/types.conf +130 -0
  66. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
  67. data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
  68. data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
  69. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  70. data/lib/ffi/platform/x86_64-linux/types.conf +132 -0
  71. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  72. data/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
  73. data/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
  74. data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
  75. data/lib/ffi/platform/x86_64-windows/types.conf +52 -0
  76. data/lib/ffi/platform.rb +185 -0
  77. data/lib/ffi/pointer.rb +167 -0
  78. data/lib/ffi/struct.rb +316 -0
  79. data/lib/ffi/struct_by_reference.rb +72 -0
  80. data/lib/ffi/struct_layout.rb +96 -0
  81. data/lib/ffi/struct_layout_builder.rb +227 -0
  82. data/lib/ffi/tools/const_generator.rb +232 -0
  83. data/lib/ffi/tools/generator.rb +105 -0
  84. data/lib/ffi/tools/generator_task.rb +32 -0
  85. data/lib/ffi/tools/struct_generator.rb +195 -0
  86. data/lib/ffi/tools/types_generator.rb +137 -0
  87. data/lib/ffi/types.rb +194 -0
  88. data/lib/ffi/union.rb +43 -0
  89. data/lib/ffi/variadic.rb +69 -0
  90. data/lib/ffi/version.rb +3 -0
  91. data/lib/ffi.rb +27 -0
  92. data/rakelib/ffi_gem_helper.rb +65 -0
  93. data/samples/getlogin.rb +8 -0
  94. data/samples/getpid.rb +8 -0
  95. data/samples/gettimeofday.rb +18 -0
  96. data/samples/hello.rb +8 -0
  97. data/samples/inotify.rb +60 -0
  98. data/samples/pty.rb +75 -0
  99. data/samples/qsort.rb +20 -0
  100. metadata +207 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 36a218e970f5a550202d0423024605d6253164ea15c3b5abaa75cb998c20579c
4
+ data.tar.gz: 858d0ef9099b6d311dde34bf49968840f53e3b8b04cc9d89d1a0fd3c696a7267
5
+ SHA512:
6
+ metadata.gz: 547e6f97d52e5a0d6b9581fa43d0cb0947f95a22758e041dc622baddbda7ac8f9d27c4e9eb16722a2d6eea6ac99996565385ad1fb6899a16262cfc9a9fedff8e
7
+ data.tar.gz: 2e3a028c0d658c86889e18f4a081354a98b42cc2cebd2db82deea2cd6eb01fe69551bd3e1abd2480866225114c2bf77754bc6dd7320e7d1e3b64bc60ff16650e
data/CHANGELOG.md ADDED
@@ -0,0 +1,338 @@
1
+ 1.15.5 / 2022-01-10
2
+ -------------------
3
+
4
+ Fixed:
5
+ * Fix long double argument or return values on 32bit i686. #849
6
+ * FFI::ConstGenerator: avoid usage of the same binary file simultaneously. #929
7
+
8
+ Added:
9
+ * Add Windows fat binary gem for Ruby-3.1
10
+
11
+ Removed:
12
+ * Remove Windows fat binary gem for Ruby < 2.4
13
+
14
+
15
+ 1.15.4 / 2021-09-01
16
+ -------------------
17
+
18
+ Fixed:
19
+ * Fix build for uClibc. #913
20
+ * Correct module lookup when including `ffi-module` gem. #912
21
+
22
+ Changed:
23
+ * Use ruby code of the ffi gem in JRuby-9.2.20+. #915
24
+
25
+
26
+ 1.15.3 / 2021-06-16
27
+ -------------------
28
+
29
+ Fixed:
30
+ * Fix temporary packaging issue with libffi. #904
31
+
32
+
33
+ 1.15.2 / 2021-06-16
34
+ -------------------
35
+
36
+ Added:
37
+ * Add support for Windows MINGW-UCRT build. #903
38
+ * Add `/opt/homebrew/lib/` to fallback search paths to improve homebrew support. #880 #882
39
+
40
+ Changed:
41
+ * Regenerate `types.conf` for FreeBSD12 aarch64. #902
42
+
43
+
44
+ 1.15.1 / 2021-05-22
45
+ -------------------
46
+
47
+ Fixed:
48
+ * Append -pthread to linker options. #893
49
+ * Use arm or aarch64 to identify Apple ARM CPU arch. #899
50
+ * Allow overriding `gcc` with the `CC` env var in `const_generator.rb` and `struct_generator.rb`. #897
51
+
52
+
53
+ 1.15.0 / 2021-03-05
54
+ -------------------
55
+
56
+ Fixed:
57
+ * Fix MSVC build
58
+ * Fix async callbacks in conjunction with fork(). #884
59
+
60
+ Added:
61
+ * Allow to pass callbacks in varargs. #885
62
+ * Name the threads for FFI callback dispatcher and async thread calls for easier debugging. #883
63
+ The name can be retrieved by Thread.name and is shown by Thread.list.inspect etc.
64
+ Even gdb shows the thread name on supported operating systems.
65
+ * Add types.conf for powerpc64le-linux
66
+ * Add types.conf for riscv64-linux
67
+ * More release automation of ffi gems
68
+
69
+ Changed:
70
+ * Switch from rubygems-tasks to bundler/gem_helper
71
+
72
+ Removed:
73
+ * Remove unused VariadicInvoker#init
74
+
75
+
76
+ 1.14.2 / 2020-12-21
77
+ -------------------
78
+
79
+ Fixed:
80
+ * Fix builtin libffi on newer Ubuntu caused by an outdated Makefile.in . #863
81
+
82
+
83
+ 1.14.1 / 2020-12-19
84
+ -------------------
85
+
86
+ Changed:
87
+ * Revert changes to FFI::Pointer#write_string made in ffi-1.14.0.
88
+ It breaks compatibilty in a way that can cause hard to find errors. #857
89
+
90
+
91
+ 1.14.0 / 2020-12-18
92
+ -------------------
93
+
94
+ Added:
95
+ * Add types.conf for x86_64-msys, x86_64-haiku, aarch64-openbsd and aarch64-darwin (alias arm64-darwin)
96
+ * Add method AbstractMemory#size_limit? . #829
97
+ * Add new extconf option --enable-libffi-alloc which is enabled per default on Apple M1 (arm64-darwin).
98
+
99
+ Changed:
100
+ * Do NULL pointer check only when array length > 0 . #305
101
+ * Raise an error on an unknown order argument. #830
102
+ * Change FFI::Pointer#write_string to terminate with a NUL byte like other string methods. #805
103
+ * Update bundled libffi to latest master.
104
+
105
+ Removed:
106
+ * Remove win32/stdint.h and stdbool.h because of copyright issue. #693
107
+
108
+ Fixed:
109
+ * Fix possible UTF-8 load error in loader script interpretation. #792
110
+ * Fix segfault on non-array argument to #write_array_of_*
111
+ * Fix memory leak in MethodHandle . #815
112
+ * Fix possible segfault in combination with fiddle or other libffi using gems . #835
113
+ * Fix possibility to use ffi ruby gem with JRuby-9.3 . #763
114
+ * Fix a GC issue, when a callback Proc is used on more than 2 callback signatures. #820
115
+
116
+
117
+ 1.13.1 / 2020-06-09
118
+ -------------------
119
+
120
+ Changed:
121
+ * Revert use of `ucrtbase.dll` as default C library on Windows-MINGW.
122
+ `ucrtbase.dll` is still used on MSWIN target. #790
123
+ * Test for `ffi_prep_closure_loc()` to make sure we can use this function.
124
+ This fixes incorrect use of system libffi on MacOS Mojave (10.14). #787
125
+ * Update types.conf on x86_64-dragonflybsd
126
+
127
+
128
+ 1.13.0 / 2020-06-01
129
+ -------------------
130
+
131
+ Added:
132
+ * Add TruffleRuby support. Almost all specs are running on TruffleRuby and succeed. #768
133
+ * Add ruby source files to the java gem. This allows to ship the Ruby library code per platform java gem and add it as a default gem to JRuby. #763
134
+ * Add FFI::Platform::LONG_DOUBLE_SIZE
135
+ * Add bounds checks for writing to an inline char[] . #756
136
+ * Add long double as callback return value. #771
137
+ * Update type definitions and add types from stdint.h and stddef.h on i386-windows, x86_64-windows, x86_64-darwin, x86_64-linux, arm-linux, powerpc-linux. #749
138
+ * Add new type definitions for powerpc-openbsd and sparcv9-openbsd. #775, #778
139
+
140
+ Changed:
141
+ * Raise required ruby version to >= 2.3.
142
+ * Lots of cleanups and improvements in library, specs and benchmarks.
143
+ * Fix a lot of compiler warnings at the C-extension
144
+ * Fix several install issues on MacOS:
145
+ * Look for libffi in SDK paths, since recent versions of macOS removed it from `/usr/include` . #757
146
+ * Fix error `ld: library not found for -lgcc_s.10.4`
147
+ * Don't built for i386 architecture as it is deprecated
148
+ * Several fixes for MSVC build on Windows. #779
149
+ * Use `ucrtbase.dll` as default C library on Windows instead of old `msvcrt.dll`. #779
150
+ * Update builtin libffi to fix a Powerpc issue with parameters of type long
151
+ * Allow unmodified sourcing of (the ruby code of) this gem in JRuby and TruffleRuby as a default gem. #747
152
+ * Improve check to detect if a module has a #find_type method suitable for FFI. This fixes compatibility with stdlib `mkmf` . #776
153
+
154
+ Removed:
155
+ * Reject callback with `:string` return type at definition, because it didn't work so far and is not save to use. #751, #782
156
+
157
+
158
+ 1.12.2 / 2020-02-01
159
+ -------------------
160
+
161
+ * Fix possible segfault at FFI::Struct#[] and []= after GC.compact . #742
162
+
163
+
164
+ 1.12.1 / 2020-01-14
165
+ -------------------
166
+
167
+ Added:
168
+ * Add binary gem support for ruby-2.7 on Windows
169
+
170
+
171
+ 1.12.0 / 2020-01-14
172
+ -------------------
173
+
174
+ Added:
175
+ * FFI::VERSION is defined as part of `require 'ffi'` now.
176
+ It is no longer necessary to `require 'ffi/version'` .
177
+
178
+ Changed:
179
+ * Update libffi to latest master.
180
+
181
+ Deprecated:
182
+ * Overwriting struct layouts is now warned and will be disallowed in ffi-2.0. #734, #735
183
+
184
+
185
+ 1.11.3 / 2019-11-25
186
+ -------------------
187
+
188
+ Removed:
189
+ * Remove support for tainted objects which cause deprecation warnings in ruby-2.7. #730
190
+
191
+
192
+ 1.11.2 / 2019-11-11
193
+ -------------------
194
+
195
+ Added:
196
+ * Add DragonFlyBSD as a platform. #724
197
+
198
+ Changed:
199
+ * Sort all types.conf files, so that files and changes are easier to compare.
200
+ * Regenerated type conf for freebsd12 and x86_64-linux targets. #722
201
+ * Remove MACOSX_DEPLOYMENT_TARGET that was targeting very old version 10.4. #647
202
+ * Fix library name mangling for non glibc Linux/UNIX. #727
203
+ * Fix compiler warnings raised by ruby-2.7
204
+ * Update libffi to latest master.
205
+
206
+
207
+ 1.11.1 / 2019-05-20
208
+ -------------------
209
+
210
+ Changed:
211
+ * Raise required ruby version to >=2.0. #699, #700
212
+ * Fix a possible linker error on ruby < 2.3 on Linux.
213
+
214
+
215
+ 1.11.0 / 2019-05-17
216
+ -------------------
217
+ This version was yanked on 2019-05-20 to fix an install issue on ruby-1.9.3. #700
218
+
219
+ Added:
220
+ * Add ability to disable or force use of system libffi. #669
221
+ Use like `gem inst ffi -- --enable-system-libffi` .
222
+ * Add ability to call FFI callbacks from outside of FFI call frame. #584
223
+ * Add proper documentation to FFI::Generator and ::Task
224
+ * Add gemspec metadata. #696, #698
225
+
226
+ Changed:
227
+ * Fix stdcall on Win32. #649, #669
228
+ * Fix load paths for FFI::Generator::Task
229
+ * Fix FFI::Pointer#read_string(0) to return a binary String. #692
230
+ * Fix benchmark suite so that it runs on ruby-2.x
231
+ * Move FFI::Platform::CPU from C to Ruby. #663
232
+ * Move FFI::StructByReference to Ruby. #681
233
+ * Move FFI::DataConverter to Ruby (#661)
234
+ * Various cleanups and improvements of specs and benchmarks
235
+
236
+ Removed:
237
+ * Remove ruby-1.8 and 1.9 compatibility code. #683
238
+ * Remove unused spec files. #684
239
+
240
+
241
+ 1.10.0 / 2019-01-06
242
+ -------------------
243
+
244
+ Added:
245
+ * Add /opt/local/lib/ to ffi's fallback library search path. #638
246
+ * Add binary gem support for ruby-2.6 on Windows
247
+ * Add FreeBSD on AArch64 and ARM support. #644
248
+ * Add FFI::LastError.winapi_error on Windows native or Cygwin. #633
249
+
250
+ Changed:
251
+ * Update to rake-compiler-dock-0.7.0
252
+ * Use 64-bit inodes on FreeBSD >= 12. #644
253
+ * Switch time_t and suseconds_t types to long on FreeBSD. #627
254
+ * Make register_t long_long on 64-bit FreeBSD. #644
255
+ * Fix Pointer#write_array_of_type #637
256
+
257
+ Removed:
258
+ * Drop binary gem support for ruby-2.0 and 2.1 on Windows
259
+
260
+
261
+ 1.9.25 / 2018-06-03
262
+ -------------------
263
+
264
+ Changed:
265
+ * Revert closures via libffi.
266
+ This re-adds ClosurePool and fixes compat with SELinux enabled systems. #621
267
+
268
+
269
+ 1.9.24 / 2018-06-02
270
+ -------------------
271
+
272
+ Security Note:
273
+
274
+ This update addresses vulnerability CVE-2018-1000201: DLL loading issue which can be hijacked on Windows OS, when a Symbol is used as DLL name instead of a String. Found by Matthew Bush.
275
+
276
+ Added:
277
+ * Added a CHANGELOG file
278
+ * Add mips64(eb) support, and mips r6 support. (#601)
279
+
280
+ Changed:
281
+ * Update libffi to latest changes on master.
282
+ * Don't search in hardcoded /usr paths on Windows.
283
+ * Don't treat Symbol args different to Strings in ffi_lib.
284
+ * Make sure size_t is defined in Thread.c. Fixes #609
285
+
286
+
287
+ 1.9.23 / 2018-02-25
288
+ -------------------
289
+
290
+ Changed:
291
+ * Fix unnecessary rebuild of configure in darwin multi arch. Fixes #605
292
+
293
+
294
+ 1.9.22 / 2018-02-22
295
+ -------------------
296
+
297
+ Changed:
298
+ * Update libffi to latest changes on master.
299
+ * Update detection of system libffi to match new requirements. Fixes #617
300
+ * Prefer bundled libffi over system libffi on Mac OS.
301
+ * Do closures via libffi. This removes ClosurePool and fixes compat with PaX. #540
302
+ * Use a more deterministic gem packaging.
303
+ * Fix unnecessary update of autoconf files at gem install.
304
+
305
+
306
+ 1.9.21 / 2018-02-06
307
+ -------------------
308
+
309
+ Added:
310
+ * Ruby-2.5 support by Windows binary gems. Fixes #598
311
+ * Add missing win64 types.
312
+ * Added support for Bitmask. (#573)
313
+ * Add support for MSYS2 (#572) and Sparc64 Linux. (#574)
314
+
315
+ Changed:
316
+ * Fix read_string to not throw an error on length 0.
317
+ * Don't use absolute paths for sh and env. Fixes usage on Adroid #528
318
+ * Use Ruby implementation for `which` for better compat with Windows. Fixes #315
319
+ * Fix compatibility with PPC64LE platform. (#577)
320
+ * Normalize sparc64 to sparcv9. (#575)
321
+
322
+ Removed:
323
+ * Drop Ruby 1.8.7 support (#480)
324
+
325
+
326
+ 1.9.18 / 2017-03-03
327
+ -------------------
328
+
329
+ Added:
330
+ * Add compatibility with Ruby-2.4.
331
+
332
+ Changed:
333
+ * Add missing shlwapi.h include to fix Windows build.
334
+ * Avoid undefined behaviour of LoadLibrary() on Windows. #553
335
+
336
+
337
+ 1.9.17 / 2017-01-13
338
+ -------------------
data/COPYING ADDED
@@ -0,0 +1,49 @@
1
+ Copyright (c) 2008-2013, Ruby FFI project contributors
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+ * Neither the name of the Ruby FFI project nor the
12
+ names of its contributors may be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ libffi, used by this project, is licensed under the MIT license:
27
+
28
+ libffi - Copyright (c) 1996-2011 Anthony Green, Red Hat, Inc and others.
29
+ See source files for details.
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ ``Software''), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49
+
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem 'rake', '~> 13.0'
5
+ gem 'rake-compiler', '~> 1.0.3'
6
+ gem 'rake-compiler-dock', '~> 1.0'
7
+ gem 'rspec', '~> 3.0'
8
+ gem 'bundler', '>= 1.16', '< 3'
9
+ end
10
+
11
+ group :doc do
12
+ gem 'kramdown'
13
+ gem 'yard', '~> 0.9'
14
+ end
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ Copyright (c) 2008-2016, Ruby FFI project contributors
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+ * Neither the name of the Ruby FFI project nor the
12
+ names of its contributors may be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/LICENSE.SPECS ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2008-2012 Ruby-FFI contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # Ruby-FFI https://github.com/ffi/ffi/wiki [![Build Status](https://travis-ci.com/ffi/ffi.svg?branch=master)](https://travis-ci.com/ffi/ffi) [![Build status Windows](https://ci.appveyor.com/api/projects/status/r8wxn1sd4s794gg1/branch/master?svg=true)](https://ci.appveyor.com/project/larskanis/ffi-aofqa/branch/master)
2
+
3
+ ## Description
4
+
5
+ Ruby-FFI is a gem for programmatically loading dynamically-linked native
6
+ libraries, binding functions within them, and calling those functions
7
+ from Ruby code. Moreover, a Ruby-FFI extension works without changes
8
+ on CRuby (MRI), JRuby, Rubinius and TruffleRuby. [Discover why you should write your next extension
9
+ using Ruby-FFI](https://github.com/ffi/ffi/wiki/why-use-ffi).
10
+
11
+ ## Features
12
+
13
+ * Intuitive DSL
14
+ * Supports all C native types
15
+ * C structs (also nested), enums and global variables
16
+ * Callbacks from C to Ruby
17
+ * Automatic garbage collection of native memory
18
+
19
+ ## Synopsis
20
+
21
+ ```ruby
22
+ require 'ffi'
23
+
24
+ module MyLib
25
+ extend FFI::Library
26
+ ffi_lib 'c'
27
+ attach_function :puts, [ :string ], :int
28
+ end
29
+
30
+ MyLib.puts 'Hello, World using libc!'
31
+ ```
32
+
33
+ For less minimalistic and more examples you may look at:
34
+
35
+ * the `samples/` folder
36
+ * the examples on the [wiki](https://github.com/ffi/ffi/wiki)
37
+ * the projects using FFI listed on the wiki: https://github.com/ffi/ffi/wiki/projects-using-ffi
38
+
39
+ ## Requirements
40
+
41
+ When installing the gem on CRuby (MRI), you will need:
42
+ * A C compiler (e.g., Xcode on macOS, `gcc` or `clang` on everything else)
43
+ Optionally (speeds up installation):
44
+ * The `libffi` library and development headers - this is commonly in the `libffi-dev` or `libffi-devel` packages
45
+
46
+ The ffi gem comes with a builtin libffi version, which is used, when the system libffi library is not available or too old.
47
+ Use of the system libffi can be enforced by:
48
+ ```
49
+ gem install ffi -- --enable-system-libffi # to install the gem manually
50
+ bundle config build.ffi --enable-system-libffi # for bundle install
51
+ ```
52
+ or prevented by `--disable-system-libffi`.
53
+
54
+ On Linux systems running with [PaX](https://en.wikipedia.org/wiki/PaX) (Gentoo, Alpine, etc.), FFI may trigger `mprotect` errors. You may need to disable [mprotect](https://en.wikibooks.org/wiki/Grsecurity/Appendix/Grsecurity_and_PaX_Configuration_Options#Restrict_mprotect.28.29) for ruby (`paxctl -m [/path/to/ruby]`) for the time being until a solution is found.
55
+
56
+ On FreeBSD systems pkgconf must be installed for the gem to be able to compile using clang. Install either via packages `pkg install pkgconf` or from ports via `devel/pkgconf`.
57
+
58
+ On JRuby and TruffleRuby, there are no requirements to install the FFI gem, and `require 'ffi'` works even without installing the gem (i.e., the gem is preinstalled on these implementations).
59
+
60
+ ## Installation
61
+
62
+ From rubygems:
63
+
64
+ [sudo] gem install ffi
65
+
66
+ From a Gemfile using git or GitHub
67
+
68
+ gem 'ffi', github: 'ffi/ffi', submodules: true
69
+
70
+ or from the git repository on github:
71
+
72
+ git clone git://github.com/ffi/ffi.git
73
+ cd ffi
74
+ git submodule update --init --recursive
75
+ bundle install
76
+ rake install
77
+
78
+ ### Install options:
79
+
80
+ * `--enable-system-libffi` : Force usage of system libffi
81
+ * `--disable-system-libffi` : Force usage of builtin libffi
82
+ * `--enable-libffi-alloc` : Force closure allocation by libffi
83
+ * `--disable-libffi-alloc` : Force closure allocation by builtin method
84
+
85
+ ## License
86
+
87
+ The ffi library is covered by the BSD license, also see the LICENSE file.
88
+ The specs are covered by the same license as [ruby/spec](https://github.com/ruby/spec), the MIT license.
89
+
90
+ ## Credits
91
+
92
+ The following people have submitted code, bug reports, or otherwise contributed to the success of this project:
93
+
94
+ * Alban Peignier <alban.peignier@free.fr>
95
+ * Aman Gupta <aman@tmm1.net>
96
+ * Andrea Fazzi <andrea.fazzi@alcacoop.it>
97
+ * Andreas Niederl <rico32@gmx.net>
98
+ * Andrew Cholakian <andrew@andrewvc.com>
99
+ * Antonio Terceiro <terceiro@softwarelivre.org>
100
+ * Benoit Daloze <eregontp@gmail.com>
101
+ * Brian Candler <B.Candler@pobox.com>
102
+ * Brian D. Burns <burns180@gmail.com>
103
+ * Bryan Kearney <bkearney@redhat.com>
104
+ * Charlie Savage <cfis@zerista.com>
105
+ * Chikanaga Tomoyuki <nagachika00@gmail.com>
106
+ * Hongli Lai <hongli@phusion.nl>
107
+ * Ian MacLeod <ian@nevir.net>
108
+ * Jake Douglas <jake@shiftedlabs.com>
109
+ * Jean-Dominique Morani <jdmorani@mac.com>
110
+ * Jeremy Hinegardner <jeremy@hinegardner.org>
111
+ * Jesús García Sáez <blaxter@gmail.com>
112
+ * Joe Khoobyar <joe@ankhcraft.com>
113
+ * Jurij Smakov <jurij@wooyd.org>
114
+ * KISHIMOTO, Makoto <ksmakoto@dd.iij4u.or.jp>
115
+ * Kim Burgestrand <kim@burgestrand.se>
116
+ * Lars Kanis <kanis@comcard.de>
117
+ * Luc Heinrich <luc@honk-honk.com>
118
+ * Luis Lavena <luislavena@gmail.com>
119
+ * Matijs van Zuijlen <matijs@matijs.net>
120
+ * Matthew King <automatthew@gmail.com>
121
+ * Mike Dalessio <mike.dalessio@gmail.com>
122
+ * NARUSE, Yui <naruse@airemix.jp>
123
+ * Park Heesob <phasis@gmail.com>
124
+ * Shin Yee <shinyee@speedgocomputing.com>
125
+ * Stephen Bannasch <stephen.bannasch@gmail.com>
126
+ * Suraj N. Kurapati <sunaku@gmail.com>
127
+ * Sylvain Daubert <sylvain.daubert@laposte.net>
128
+ * Victor Costan
129
+ * beoran@gmail.com
130
+ * ctide <christide@christide.com>
131
+ * emboss <Martin.Bosslet@googlemail.com>
132
+ * hobophobe <unusualtears@gmail.com>
133
+ * meh <meh@paranoici.org>
134
+ * postmodern <postmodern.mod3@gmail.com>
135
+ * wycats@gmail.com <wycats@gmail.com>
136
+ * Wayne Meissner <wmeissner@gmail.com>