ffi 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

@@ -0,0 +1,64 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. 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
+ *
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ * list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright notice
10
+ * this list of conditions and the following disclaimer in the documentation
11
+ * and/or other materials provided with the distribution.
12
+ * Neither the name of the project nor the names of its contributors
13
+ * may be used to endorse or promote products derived from this software
14
+ * without specific prior written permission.
15
+ *
16
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
20
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
+ */
27
+
28
+ #include <stdio.h>
29
+ #include <stdbool.h>
30
+ #include <stdint.h>
31
+ #include <string.h>
32
+ #include <stdlib.h>
33
+
34
+ typedef char s8;
35
+ typedef short s16;
36
+ typedef int s32;
37
+ typedef long long s64;
38
+ typedef float f32;
39
+ typedef double f64;
40
+
41
+ typedef union union_test {
42
+ char b;
43
+ short s;
44
+ int i;
45
+ long long j;
46
+ long l;
47
+ float f;
48
+ double d;
49
+ s8 a[10];
50
+ } union_test_t;
51
+
52
+ #define T(x, type) \
53
+ type union_align_##type(union_test_t* u) { return u->x; } \
54
+ union_test_t* union_make_union_with_##type(type value) { static union_test_t u; u.x = value; return &u; }
55
+
56
+ T(b, s8);
57
+ T(s, s16);
58
+ T(i, s32);
59
+ T(j, s64);
60
+ T(f, f32);
61
+ T(d, f64);
62
+ T(l, long);
63
+
64
+ unsigned int union_size() { return sizeof(union_test_t); }
@@ -0,0 +1,57 @@
1
+
2
+ #include <sys/types.h>
3
+ #include <stdio.h>
4
+ #include <stdint.h>
5
+ #include <string.h>
6
+ #include <stdarg.h>
7
+
8
+ typedef int8_t s8;
9
+ typedef uint8_t u8;
10
+ typedef int16_t s16;
11
+ typedef uint16_t u16;
12
+ typedef int32_t s32;
13
+ typedef uint32_t u32;
14
+ typedef int64_t s64;
15
+ typedef uint64_t u64;
16
+ typedef signed long sL;
17
+ typedef unsigned long uL;
18
+ typedef float F;
19
+ typedef double D;
20
+
21
+ void pack_varargs(s64* buf, const char* fmt, ...)
22
+ {
23
+ va_list ap;
24
+ int c;
25
+ double d;
26
+ va_start(ap, fmt);
27
+ while ((c = *fmt++)) {
28
+ switch (c) {
29
+ case 'c':
30
+ case 's':
31
+ case 'i':
32
+ *buf++ = va_arg(ap, s32);
33
+ break;
34
+ case 'l':
35
+ *buf++ = va_arg(ap, long);
36
+ break;
37
+ case 'j':
38
+ *buf++ = va_arg(ap, s64);
39
+ break;
40
+ case 'f':
41
+ case 'd':
42
+ d = va_arg(ap, double);
43
+ memcpy(buf++, &d, sizeof(d));
44
+ break;
45
+ case 'C':
46
+ case 'S':
47
+ case 'I':
48
+ *buf++ = va_arg(ap, u32);
49
+ break;
50
+ case 'L':
51
+ *buf++ = va_arg(ap, unsigned long);
52
+ break;
53
+ }
54
+ }
55
+ va_end(ap);
56
+ }
57
+
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
7
+ </content>
8
+ <orderEntry type="inheritedJdk" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ </component>
11
+ </module>
12
+
metadata CHANGED
@@ -1,46 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
- version: !ruby/object:Gem::Version
4
- version: 0.6.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.4
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Wayne Meissner
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2010-03-10 00:00:00 +10:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2013-02-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: rake
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
21
19
  - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 0.8.7
24
- version:
25
- description: |-
26
- Ruby-FFI is a ruby extension for programmatically loading dynamic
27
- libraries, binding functions within them, and calling those functions
28
- from Ruby code. Moreover, a Ruby-FFI extension works without changes
29
- on Ruby and JRuby. Discover why should you write your next extension
30
- using Ruby-FFI here[http://wiki.github.com/ffi/ffi/why-use-ffi].
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake-compiler
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: 0.6.0
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.6.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Ruby FFI library
31
63
  email: wmeissner@gmail.com
32
64
  executables: []
33
-
34
- extensions:
65
+ extensions:
35
66
  - ext/ffi_c/extconf.rb
36
- - gen/Rakefile
37
- extra_rdoc_files:
38
- - History.txt
39
- - README.rdoc
40
- files:
67
+ extra_rdoc_files: []
68
+ files:
69
+ - ffi.gemspec
41
70
  - History.txt
42
71
  - LICENSE
43
- - README.rdoc
72
+ - README.md
44
73
  - Rakefile
45
74
  - ext/ffi_c/AbstractMemory.c
46
75
  - ext/ffi_c/AbstractMemory.h
@@ -53,49 +82,24 @@ files:
53
82
  - ext/ffi_c/Call.h
54
83
  - ext/ffi_c/ClosurePool.c
55
84
  - ext/ffi_c/ClosurePool.h
85
+ - ext/ffi_c/compat.h
56
86
  - ext/ffi_c/DynamicLibrary.c
57
87
  - ext/ffi_c/DynamicLibrary.h
88
+ - ext/ffi_c/endian.h
89
+ - ext/ffi_c/extconf.rb
90
+ - ext/ffi_c/ffi.c
91
+ - ext/ffi_c/Ffi_c.iml
58
92
  - ext/ffi_c/Function.c
59
93
  - ext/ffi_c/Function.h
60
94
  - ext/ffi_c/FunctionInfo.c
61
95
  - ext/ffi_c/LastError.c
62
96
  - ext/ffi_c/LastError.h
63
- - ext/ffi_c/MemoryPointer.c
64
- - ext/ffi_c/MemoryPointer.h
65
- - ext/ffi_c/MethodHandle.c
66
- - ext/ffi_c/MethodHandle.h
67
- - ext/ffi_c/Platform.c
68
- - ext/ffi_c/Platform.h
69
- - ext/ffi_c/Pointer.c
70
- - ext/ffi_c/Pointer.h
71
- - ext/ffi_c/Struct.c
72
- - ext/ffi_c/Struct.h
73
- - ext/ffi_c/StructByValue.c
74
- - ext/ffi_c/StructByValue.h
75
- - ext/ffi_c/StructLayout.c
76
- - ext/ffi_c/Type.c
77
- - ext/ffi_c/Type.h
78
- - ext/ffi_c/Types.c
79
- - ext/ffi_c/Types.h
80
- - ext/ffi_c/Variadic.c
81
- - ext/ffi_c/compat.h
82
- - ext/ffi_c/endian.h
83
- - ext/ffi_c/extconf.rb
84
- - ext/ffi_c/ffi.c
85
- - ext/ffi_c/libffi.bsd.mk
86
- - ext/ffi_c/libffi.darwin.mk
87
- - ext/ffi_c/libffi.gnu.mk
88
- - ext/ffi_c/libffi.mk
97
+ - ext/ffi_c/libffi/acinclude.m4
98
+ - ext/ffi_c/libffi/aclocal.m4
89
99
  - ext/ffi_c/libffi/ChangeLog
90
100
  - ext/ffi_c/libffi/ChangeLog.libffi
91
101
  - ext/ffi_c/libffi/ChangeLog.libgcj
92
102
  - ext/ffi_c/libffi/ChangeLog.v1
93
- - ext/ffi_c/libffi/LICENSE
94
- - ext/ffi_c/libffi/Makefile.am
95
- - ext/ffi_c/libffi/Makefile.in
96
- - ext/ffi_c/libffi/README
97
- - ext/ffi_c/libffi/acinclude.m4
98
- - ext/ffi_c/libffi/aclocal.m4
99
103
  - ext/ffi_c/libffi/compile
100
104
  - ext/ffi_c/libffi/config.guess
101
105
  - ext/ffi_c/libffi/config.sub
@@ -108,26 +112,30 @@ files:
108
112
  - ext/ffi_c/libffi/doc/stamp-vti
109
113
  - ext/ffi_c/libffi/doc/version.texi
110
114
  - ext/ffi_c/libffi/fficonfig.h.in
111
- - ext/ffi_c/libffi/include/Makefile.am
112
- - ext/ffi_c/libffi/include/Makefile.in
113
115
  - ext/ffi_c/libffi/include/ffi.h.in
114
116
  - ext/ffi_c/libffi/include/ffi_common.h
117
+ - ext/ffi_c/libffi/include/Makefile.am
118
+ - ext/ffi_c/libffi/include/Makefile.in
115
119
  - ext/ffi_c/libffi/install-sh
116
120
  - ext/ffi_c/libffi/libffi.pc.in
117
121
  - ext/ffi_c/libffi/libtool-version
122
+ - ext/ffi_c/libffi/LICENSE
118
123
  - ext/ffi_c/libffi/ltmain.sh
119
124
  - ext/ffi_c/libffi/m4/libtool.m4
120
125
  - ext/ffi_c/libffi/m4/ltoptions.m4
121
126
  - ext/ffi_c/libffi/m4/ltsugar.m4
122
127
  - ext/ffi_c/libffi/m4/ltversion.m4
123
128
  - ext/ffi_c/libffi/m4/lt~obsolete.m4
124
- - ext/ffi_c/libffi/man/Makefile.am
125
- - ext/ffi_c/libffi/man/Makefile.in
129
+ - ext/ffi_c/libffi/Makefile.am
130
+ - ext/ffi_c/libffi/Makefile.in
126
131
  - ext/ffi_c/libffi/man/ffi.3
127
132
  - ext/ffi_c/libffi/man/ffi_call.3
128
133
  - ext/ffi_c/libffi/man/ffi_prep_cif.3
134
+ - ext/ffi_c/libffi/man/Makefile.am
135
+ - ext/ffi_c/libffi/man/Makefile.in
129
136
  - ext/ffi_c/libffi/mdate-sh
130
137
  - ext/ffi_c/libffi/missing
138
+ - ext/ffi_c/libffi/README
131
139
  - ext/ffi_c/libffi/src/alpha/ffi.c
132
140
  - ext/ffi_c/libffi/src/alpha/ffitarget.h
133
141
  - ext/ffi_c/libffi/src/alpha/osf.S
@@ -203,8 +211,6 @@ files:
203
211
  - ext/ffi_c/libffi/src/x86/unix64.S
204
212
  - ext/ffi_c/libffi/src/x86/win32.S
205
213
  - ext/ffi_c/libffi/src/x86/win64.S
206
- - ext/ffi_c/libffi/testsuite/Makefile.am
207
- - ext/ffi_c/libffi/testsuite/Makefile.in
208
214
  - ext/ffi_c/libffi/testsuite/config/default.exp
209
215
  - ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp
210
216
  - ext/ffi_c/libffi/testsuite/lib/target-libpath.exp
@@ -336,10 +342,34 @@ files:
336
342
  - ext/ffi_c/libffi/testsuite/libffi.special/special.exp
337
343
  - ext/ffi_c/libffi/testsuite/libffi.special/unwindtest.cc
338
344
  - ext/ffi_c/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc
345
+ - ext/ffi_c/libffi/testsuite/Makefile.am
346
+ - ext/ffi_c/libffi/testsuite/Makefile.in
339
347
  - ext/ffi_c/libffi/texinfo.tex
348
+ - ext/ffi_c/libffi.bsd.mk
349
+ - ext/ffi_c/libffi.darwin.mk
350
+ - ext/ffi_c/libffi.gnu.mk
351
+ - ext/ffi_c/libffi.mk
352
+ - ext/ffi_c/MemoryPointer.c
353
+ - ext/ffi_c/MemoryPointer.h
354
+ - ext/ffi_c/MethodHandle.c
355
+ - ext/ffi_c/MethodHandle.h
356
+ - ext/ffi_c/Platform.c
357
+ - ext/ffi_c/Platform.h
358
+ - ext/ffi_c/Pointer.c
359
+ - ext/ffi_c/Pointer.h
340
360
  - ext/ffi_c/rbffi.h
361
+ - ext/ffi_c/Struct.c
362
+ - ext/ffi_c/Struct.h
363
+ - ext/ffi_c/StructByValue.c
364
+ - ext/ffi_c/StructByValue.h
365
+ - ext/ffi_c/StructLayout.c
366
+ - ext/ffi_c/Type.c
367
+ - ext/ffi_c/Type.h
368
+ - ext/ffi_c/Types.c
369
+ - ext/ffi_c/Types.h
370
+ - ext/ffi_c/Variadic.c
371
+ - gen/log
341
372
  - gen/Rakefile
342
- - lib/ffi.rb
343
373
  - lib/ffi/autopointer.rb
344
374
  - lib/ffi/buffer.rb
345
375
  - lib/ffi/callback.rb
@@ -361,11 +391,14 @@ files:
361
391
  - lib/ffi/types.rb
362
392
  - lib/ffi/union.rb
363
393
  - lib/ffi/variadic.rb
394
+ - lib/ffi.rb
395
+ - lib/Lib.iml
364
396
  - spec/ffi/bool_spec.rb
365
397
  - spec/ffi/buffer_spec.rb
366
398
  - spec/ffi/callback_spec.rb
367
399
  - spec/ffi/enum_spec.rb
368
400
  - spec/ffi/errno_spec.rb
401
+ - spec/ffi/Ffi.iml
369
402
  - spec/ffi/function_spec.rb
370
403
  - spec/ffi/library_spec.rb
371
404
  - spec/ffi/managed_struct_spec.rb
@@ -384,49 +417,47 @@ files:
384
417
  - spec/ffi/union_spec.rb
385
418
  - spec/ffi/variadic_spec.rb
386
419
  - spec/spec.opts
387
- - tasks/ann.rake
388
- - tasks/extension.rake
389
- - tasks/gem.rake
390
- - tasks/git.rake
391
- - tasks/notes.rake
392
- - tasks/post_load.rake
393
- - tasks/rdoc.rake
394
- - tasks/rubyforge.rake
395
- - tasks/setup.rb
396
- - tasks/spec.rake
397
- - tasks/svn.rake
398
- - tasks/test.rake
399
- has_rdoc: true
420
+ - libtest/Benchmark.c
421
+ - libtest/BoolTest.c
422
+ - libtest/BufferTest.c
423
+ - libtest/ClosureTest.c
424
+ - libtest/EnumTest.c
425
+ - libtest/FunctionTest.c
426
+ - libtest/GlobalVariable.c
427
+ - libtest/GNUmakefile
428
+ - libtest/LastErrorTest.c
429
+ - libtest/NumberTest.c
430
+ - libtest/PointerTest.c
431
+ - libtest/ReferenceTest.c
432
+ - libtest/StringTest.c
433
+ - libtest/StructTest.c
434
+ - libtest/UnionTest.c
435
+ - libtest/VariadicTest.c
400
436
  homepage: http://wiki.github.com/ffi/ffi
401
- licenses: []
402
-
437
+ licenses:
438
+ - LGPL-3
403
439
  post_install_message:
404
- rdoc_options:
405
- - -x
406
- - ext
407
- - --main
408
- - README.rdoc
409
- require_paths:
440
+ rdoc_options: []
441
+ require_paths:
410
442
  - lib
411
- - ext
412
- required_ruby_version: !ruby/object:Gem::Requirement
413
- requirements:
443
+ - ext/ffi_c
444
+ - lib/ffi
445
+ required_ruby_version: !ruby/object:Gem::Requirement
446
+ none: false
447
+ requirements:
414
448
  - - ">="
415
- - !ruby/object:Gem::Version
416
- version: "0"
417
- version:
418
- required_rubygems_version: !ruby/object:Gem::Requirement
419
- requirements:
449
+ - !ruby/object:Gem::Version
450
+ version: 1.8.7
451
+ required_rubygems_version: !ruby/object:Gem::Requirement
452
+ none: false
453
+ requirements:
420
454
  - - ">="
421
- - !ruby/object:Gem::Version
422
- version: "0"
423
- version:
455
+ - !ruby/object:Gem::Version
456
+ version: '0'
424
457
  requirements: []
425
-
426
- rubyforge_project: ffi
427
- rubygems_version: 1.3.5
458
+ rubyforge_project:
459
+ rubygems_version: 1.8.24
428
460
  signing_key:
429
461
  specification_version: 3
430
- summary: Ruby-FFI is a ruby extension for programmatically loading dynamic libraries, binding functions within them, and calling those functions from Ruby code
462
+ summary: Ruby FFI
431
463
  test_files: []
432
-