ffi 0.6.3-x86-mingw32 → 1.0.1-x86-mingw32
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.
Potentially problematic release.
This version of ffi might be problematic. Click here for more details.
- data/History.txt +7 -0
- data/LICENSE +10 -21
- data/README.rdoc +1 -0
- data/Rakefile +4 -2
- data/ext/ffi_c/AbstractMemory.c +103 -38
- data/ext/ffi_c/AbstractMemory.h +15 -22
- data/ext/ffi_c/Buffer.c +61 -22
- data/ext/ffi_c/Call.c +52 -540
- data/ext/ffi_c/Call.h +1 -1
- data/ext/ffi_c/DataConverter.c +62 -0
- data/ext/ffi_c/DynamicLibrary.c +21 -1
- data/ext/ffi_c/Function.c +315 -30
- data/ext/ffi_c/MappedType.c +146 -0
- data/ext/ffi_c/MappedType.h +57 -0
- data/ext/ffi_c/MemoryPointer.c +12 -33
- data/ext/ffi_c/Platform.c +2 -0
- data/ext/ffi_c/Pointer.c +66 -28
- data/ext/ffi_c/Struct.c +19 -306
- data/ext/ffi_c/Struct.h +6 -0
- data/ext/ffi_c/StructByReference.c +150 -0
- data/ext/ffi_c/StructByReference.h +50 -0
- data/ext/ffi_c/StructLayout.c +25 -14
- data/ext/ffi_c/Type.c +39 -68
- data/ext/ffi_c/Type.h +12 -22
- data/ext/ffi_c/Types.c +20 -5
- data/ext/ffi_c/Types.h +7 -7
- data/ext/ffi_c/Variadic.c +21 -17
- data/ext/ffi_c/extconf.rb +4 -0
- data/ext/ffi_c/ffi.c +8 -2
- data/ext/ffi_c/rbffi.h +1 -0
- data/lib/ffi/autopointer.rb +23 -22
- data/lib/ffi/enum.rb +36 -21
- data/lib/ffi/errno.rb +20 -0
- data/lib/ffi/ffi.rb +13 -80
- data/lib/ffi/io.rb +12 -20
- data/lib/ffi/library.rb +109 -92
- data/lib/ffi/managedstruct.rb +1 -1
- data/lib/ffi/memorypointer.rb +15 -21
- data/lib/ffi/platform.rb +24 -28
- data/lib/ffi/pointer.rb +14 -21
- data/lib/ffi/struct.rb +98 -49
- data/lib/ffi/struct_layout_builder.rb +158 -0
- data/lib/ffi/types.rb +99 -128
- data/lib/ffi/union.rb +20 -0
- data/lib/ffi/variadic.rb +33 -22
- data/lib/ffi_c.so +0 -0
- data/spec/ffi/async_callback_spec.rb +23 -0
- data/spec/ffi/callback_spec.rb +62 -0
- data/spec/ffi/custom_param_type.rb +31 -0
- data/spec/ffi/custom_type_spec.rb +73 -0
- data/spec/ffi/enum_spec.rb +19 -0
- data/spec/ffi/ffi_spec.rb +24 -0
- data/spec/ffi/pointer_spec.rb +15 -0
- data/spec/ffi/rbx/memory_pointer_spec.rb +7 -1
- data/spec/ffi/strptr_spec.rb +36 -0
- data/spec/ffi/struct_packed_spec.rb +46 -0
- data/spec/ffi/struct_spec.rb +19 -5
- data/spec/ffi/typedef_spec.rb +14 -0
- data/tasks/setup.rb +2 -1
- metadata +15 -6
- data/ext/ffi_c/AutoPointer.c +0 -60
- data/ext/ffi_c/AutoPointer.h +0 -18
- data/lib/1.8/ffi_c.so +0 -0
- data/lib/1.9/ffi_c.so +0 -0
data/ext/ffi_c/AutoPointer.c
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
|
2
|
-
#include <stdbool.h>
|
3
|
-
#include <stdint.h>
|
4
|
-
#include <limits.h>
|
5
|
-
#include <ruby.h>
|
6
|
-
#include "rbffi.h"
|
7
|
-
#include "AbstractMemory.h"
|
8
|
-
#include "Pointer.h"
|
9
|
-
#include "AutoPointer.h"
|
10
|
-
|
11
|
-
typedef struct AutoPointer {
|
12
|
-
AbstractMemory memory;
|
13
|
-
VALUE parent;
|
14
|
-
} AutoPointer;
|
15
|
-
|
16
|
-
static void autoptr_mark(AutoPointer* ptr);
|
17
|
-
static VALUE autoptr_allocate(VALUE klass);
|
18
|
-
static VALUE autoptr_set_parent(VALUE self, VALUE parent);
|
19
|
-
|
20
|
-
VALUE rbffi_AutoPointerClass = Qnil;
|
21
|
-
|
22
|
-
static VALUE
|
23
|
-
autoptr_allocate(VALUE klass)
|
24
|
-
{
|
25
|
-
AutoPointer* p;
|
26
|
-
VALUE obj = Data_Make_Struct(klass, AutoPointer, autoptr_mark, -1, p);
|
27
|
-
p->parent = Qnil;
|
28
|
-
p->memory.access = MEM_RD | MEM_WR;
|
29
|
-
|
30
|
-
return obj;
|
31
|
-
}
|
32
|
-
|
33
|
-
static VALUE
|
34
|
-
autoptr_set_parent(VALUE self, VALUE parent)
|
35
|
-
{
|
36
|
-
AutoPointer* p;
|
37
|
-
AbstractMemory* ptr = rbffi_AbstractMemory_Cast(parent, rbffi_PointerClass);
|
38
|
-
|
39
|
-
Data_Get_Struct(self, AutoPointer, p);
|
40
|
-
p->memory = *ptr;
|
41
|
-
p->parent = parent;
|
42
|
-
|
43
|
-
return self;
|
44
|
-
}
|
45
|
-
|
46
|
-
static void
|
47
|
-
autoptr_mark(AutoPointer* ptr)
|
48
|
-
{
|
49
|
-
rb_gc_mark(ptr->parent);
|
50
|
-
}
|
51
|
-
|
52
|
-
void
|
53
|
-
rbffi_AutoPointer_Init(VALUE moduleFFI)
|
54
|
-
{
|
55
|
-
rbffi_AutoPointerClass = rb_define_class_under(moduleFFI, "AutoPointer", rbffi_PointerClass);
|
56
|
-
rb_global_variable(&rbffi_AutoPointerClass);
|
57
|
-
|
58
|
-
rb_define_alloc_func(rbffi_AutoPointerClass, autoptr_allocate);
|
59
|
-
rb_define_protected_method(rbffi_AutoPointerClass, "parent=", autoptr_set_parent, 1);
|
60
|
-
}
|
data/ext/ffi_c/AutoPointer.h
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
|
2
|
-
#ifndef _AUTOPOINTER_H
|
3
|
-
#define _AUTOPOINTER_H
|
4
|
-
|
5
|
-
#ifdef __cplusplus
|
6
|
-
extern "C" {
|
7
|
-
#endif
|
8
|
-
|
9
|
-
extern void rbffi_AutoPointer_Init(VALUE ffiModule);
|
10
|
-
extern VALUE rbffi_AutoPointerClass;
|
11
|
-
|
12
|
-
|
13
|
-
#ifdef __cplusplus
|
14
|
-
}
|
15
|
-
#endif
|
16
|
-
|
17
|
-
#endif /* _AUTOPOINTER_H */
|
18
|
-
|
data/lib/1.8/ffi_c.so
DELETED
Binary file
|
data/lib/1.9/ffi_c.so
DELETED
Binary file
|