ffi 1.0.4-x86-mingw32 → 1.0.5-x86-mingw32
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.
- data/Rakefile +2 -2
- data/ext/ffi_c/AbstractMemory.c +1 -1
- data/ext/ffi_c/ArrayType.c +11 -19
- data/ext/ffi_c/ArrayType.h +11 -19
- data/ext/ffi_c/Buffer.c +2 -0
- data/ext/ffi_c/Call.h +12 -19
- data/ext/ffi_c/ClosurePool.h +19 -0
- data/ext/ffi_c/DynamicLibrary.h +18 -0
- data/ext/ffi_c/Function.c +12 -13
- data/ext/ffi_c/Function.h +12 -19
- data/ext/ffi_c/LastError.c +12 -19
- data/ext/ffi_c/LastError.h +20 -0
- data/ext/ffi_c/MappedType.c +12 -19
- data/ext/ffi_c/MappedType.h +12 -19
- data/ext/ffi_c/MemoryPointer.c +1 -0
- data/ext/ffi_c/MemoryPointer.h +23 -3
- data/ext/ffi_c/MethodHandle.h +15 -22
- data/ext/ffi_c/Platform.c +36 -9
- data/ext/ffi_c/Platform.h +23 -3
- data/ext/ffi_c/Pointer.c +2 -0
- data/ext/ffi_c/Pointer.h +11 -19
- data/ext/ffi_c/Struct.c +12 -19
- data/ext/ffi_c/Struct.h +11 -19
- data/ext/ffi_c/StructByValue.c +13 -19
- data/ext/ffi_c/StructByValue.h +12 -19
- data/ext/ffi_c/StructLayout.c +12 -19
- data/ext/ffi_c/Thread.c +36 -10
- data/ext/ffi_c/Thread.h +14 -5
- data/ext/ffi_c/Type.c +1 -0
- data/ext/ffi_c/Types.c +12 -19
- data/ext/ffi_c/Types.h +11 -19
- data/ext/ffi_c/Variadic.c +1 -1
- data/ext/ffi_c/compat.h +13 -19
- data/ext/ffi_c/endian.h +1 -0
- data/ext/ffi_c/extconf.rb +3 -1
- data/ext/ffi_c/ffi.c +12 -19
- data/ext/ffi_c/rbffi.h +23 -3
- data/lib/1.8/ffi_c.so +0 -0
- data/lib/1.9/ffi_c.so +0 -0
- data/lib/ffi/tools/const_generator.rb +1 -1
- data/spec/ffi/async_callback_spec.rb +35 -12
- data/spec/ffi/bool_spec.rb +16 -0
- data/spec/ffi/buffer_spec.rb +34 -21
- data/spec/ffi/callback_spec.rb +16 -0
- data/spec/ffi/custom_param_type.rb +16 -0
- data/spec/ffi/custom_type_spec.rb +16 -0
- data/spec/ffi/enum_spec.rb +16 -0
- data/spec/ffi/errno_spec.rb +16 -0
- data/spec/ffi/ffi_spec.rb +16 -0
- data/spec/ffi/library_spec.rb +16 -0
- data/spec/ffi/managed_struct_spec.rb +16 -0
- data/spec/ffi/number_spec.rb +16 -0
- data/spec/ffi/strptr_spec.rb +16 -0
- data/spec/ffi/struct_callback_spec.rb +16 -0
- data/spec/ffi/struct_initialize_spec.rb +1 -0
- data/spec/ffi/struct_packed_spec.rb +16 -0
- data/spec/ffi/struct_spec.rb +16 -0
- data/spec/ffi/typedef_spec.rb +16 -0
- data/spec/ffi/union_spec.rb +16 -0
- data/spec/ffi/variadic_spec.rb +16 -0
- data/tasks/extension.rake +1 -1
- metadata +11 -24
- data/lib/ffi_c.so +0 -0
data/ext/ffi_c/MemoryPointer.c
CHANGED
data/ext/ffi_c/MemoryPointer.h
CHANGED
@@ -1,6 +1,26 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2008, 2009, Wayne Meissner
|
3
|
+
* Copyright (c) 2008, Luc Heinrich <luc@honk-honk.com>
|
4
|
+
*
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* This file is part of ruby-ffi.
|
8
|
+
*
|
9
|
+
* This code is free software: you can redistribute it and/or modify it under
|
10
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
11
|
+
* published by the Free Software Foundation.
|
12
|
+
*
|
13
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
14
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
16
|
+
* version 3 for more details.
|
17
|
+
*
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
19
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
20
|
+
*/
|
1
21
|
|
2
|
-
#ifndef
|
3
|
-
#define
|
22
|
+
#ifndef RBFFI_MEMORYPOINTER_H
|
23
|
+
#define RBFFI_MEMORYPOINTER_H
|
4
24
|
|
5
25
|
#include <stdbool.h>
|
6
26
|
#include <ruby.h>
|
@@ -16,5 +36,5 @@ extern "C" {
|
|
16
36
|
}
|
17
37
|
#endif
|
18
38
|
|
19
|
-
#endif /*
|
39
|
+
#endif /* RBFFI_MEMORYPOINTER_H */
|
20
40
|
|
data/ext/ffi_c/MethodHandle.h
CHANGED
@@ -1,32 +1,25 @@
|
|
1
1
|
/*
|
2
2
|
* Copyright (c) 2009, Wayne Meissner
|
3
|
+
*
|
3
4
|
* All rights reserved.
|
4
5
|
*
|
5
|
-
*
|
6
|
-
*
|
6
|
+
* This file is part of ruby-ffi.
|
7
|
+
*
|
8
|
+
* This code is free software: you can redistribute it and/or modify it under
|
9
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
+
* published by the Free Software Foundation.
|
7
11
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
* and/or other materials provided with the distribution.
|
13
|
-
* * The name of the author or authors may not be used to endorse or promote
|
14
|
-
* products derived from this software without specific prior written permission.
|
12
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
+
* version 3 for more details.
|
15
16
|
*
|
16
|
-
*
|
17
|
-
*
|
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.
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
26
19
|
*/
|
27
20
|
|
28
|
-
#ifndef
|
29
|
-
#define
|
21
|
+
#ifndef RBFFI_METHODHANDLE_H
|
22
|
+
#define RBFFI_METHODHANDLE_H
|
30
23
|
|
31
24
|
#ifdef __cplusplus
|
32
25
|
extern "C" {
|
@@ -49,5 +42,5 @@ void rbffi_MethodHandle_Init(VALUE module);
|
|
49
42
|
}
|
50
43
|
#endif
|
51
44
|
|
52
|
-
#endif /*
|
45
|
+
#endif /* RBFFI_METHODHANDLE_H */
|
53
46
|
|
data/ext/ffi_c/Platform.c
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2008-2010 Wayne Meissner
|
3
|
+
*
|
4
|
+
* All rights reserved.
|
5
|
+
*
|
6
|
+
* This file is part of ruby-ffi.
|
7
|
+
*
|
8
|
+
* This code is free software: you can redistribute it and/or modify it under
|
9
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
+
* published by the Free Software Foundation.
|
11
|
+
*
|
12
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
+
* version 3 for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
*/
|
20
|
+
|
1
21
|
#include <sys/param.h>
|
2
22
|
#include <sys/types.h>
|
3
23
|
#include <stdint.h>
|
@@ -15,19 +35,25 @@ static VALUE PlatformModule = Qnil;
|
|
15
35
|
* on intel.
|
16
36
|
*/
|
17
37
|
#ifdef __i386__
|
18
|
-
#define CPU "i386"
|
38
|
+
# define CPU "i386"
|
39
|
+
|
19
40
|
#elif defined(__ppc__) || defined(__powerpc__)
|
20
|
-
#define CPU "powerpc"
|
41
|
+
# define CPU "powerpc"
|
42
|
+
|
21
43
|
#elif defined(__x86_64__)
|
22
|
-
#define CPU "x86_64"
|
23
|
-
|
24
|
-
|
25
|
-
#elif defined(__sparcv9__)
|
26
|
-
#define CPU "sparcv9"
|
44
|
+
# define CPU "x86_64"
|
45
|
+
|
46
|
+
/* Need to check for __sparcv9 first, because __sparc will be defined either way. */
|
47
|
+
#elif defined(__sparcv9__) || defined(__sparcv9)
|
48
|
+
# define CPU "sparcv9"
|
49
|
+
|
50
|
+
#elif defined(__sparc__) || defined(__sparc)
|
51
|
+
# define CPU "sparc"
|
52
|
+
|
27
53
|
#elif defined(__arm__)
|
28
|
-
#define CPU "arm"
|
54
|
+
# define CPU "arm"
|
29
55
|
#else
|
30
|
-
#error "Unknown cpu type"
|
56
|
+
# error "Unknown cpu type"
|
31
57
|
#endif
|
32
58
|
|
33
59
|
static void
|
@@ -59,3 +85,4 @@ rbffi_Platform_Init(VALUE moduleFFI)
|
|
59
85
|
rb_define_const(PlatformModule, "CPU", rb_str_new2(CPU));
|
60
86
|
export_primitive_types(PlatformModule);
|
61
87
|
}
|
88
|
+
|
data/ext/ffi_c/Platform.h
CHANGED
@@ -1,5 +1,25 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2008-2010 Wayne Meissner
|
3
|
+
*
|
4
|
+
* All rights reserved.
|
5
|
+
*
|
6
|
+
* This file is part of ruby-ffi.
|
7
|
+
*
|
8
|
+
* This code is free software: you can redistribute it and/or modify it under
|
9
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
+
* published by the Free Software Foundation.
|
11
|
+
*
|
12
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
+
* version 3 for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef RBFFI_PLATFORM_H
|
22
|
+
#define RBFFI_PLATFORM_H
|
3
23
|
|
4
24
|
#ifdef __cplusplus
|
5
25
|
extern "C" {
|
@@ -12,5 +32,5 @@ extern "C" {
|
|
12
32
|
}
|
13
33
|
#endif
|
14
34
|
|
15
|
-
#endif /*
|
35
|
+
#endif /* RBFFI_PLATFORM_H */
|
16
36
|
|
data/ext/ffi_c/Pointer.c
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
#include <limits.h>
|
24
24
|
#include <ruby.h>
|
25
25
|
#include "rbffi.h"
|
26
|
+
#include "endian.h"
|
26
27
|
#include "AbstractMemory.h"
|
27
28
|
#include "Pointer.h"
|
28
29
|
|
@@ -280,3 +281,4 @@ rbffi_Pointer_Init(VALUE moduleFFI)
|
|
280
281
|
rbffi_NullPointerSingleton = rb_class_new_instance(1, &rbNullAddress, rbffi_PointerClass);
|
281
282
|
rb_define_const(rbffi_PointerClass, "NULL", rbffi_NullPointerSingleton);
|
282
283
|
}
|
284
|
+
|
data/ext/ffi_c/Pointer.h
CHANGED
@@ -3,27 +3,19 @@
|
|
3
3
|
*
|
4
4
|
* All rights reserved.
|
5
5
|
*
|
6
|
-
*
|
7
|
-
* modification, are permitted provided that the following conditions are met:
|
6
|
+
* This file is part of ruby-ffi.
|
8
7
|
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
* this list of conditions and the following disclaimer in the documentation
|
13
|
-
* and/or other materials provided with the distribution.
|
14
|
-
* * The name of the author or authors may not be used to endorse or promote
|
15
|
-
* products derived from this software without specific prior written permission.
|
8
|
+
* This code is free software: you can redistribute it and/or modify it under
|
9
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
+
* published by the Free Software Foundation.
|
16
11
|
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
25
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
12
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
+
* version 3 for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
27
19
|
*/
|
28
20
|
|
29
21
|
#ifndef RBFFI_POINTER_H
|
data/ext/ffi_c/Struct.c
CHANGED
@@ -4,27 +4,19 @@
|
|
4
4
|
*
|
5
5
|
* All rights reserved.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
7
|
+
* This file is part of ruby-ffi.
|
9
8
|
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
* this list of conditions and the following disclaimer in the documentation
|
14
|
-
* and/or other materials provided with the distribution.
|
15
|
-
* * The name of the author or authors may not be used to endorse or promote
|
16
|
-
* products derived from this software without specific prior written permission.
|
9
|
+
* This code is free software: you can redistribute it and/or modify it under
|
10
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
11
|
+
* published by the Free Software Foundation.
|
17
12
|
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
26
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
14
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
16
|
+
* version 3 for more details.
|
17
|
+
*
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
19
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
28
20
|
*/
|
29
21
|
|
30
22
|
#include <sys/types.h>
|
@@ -629,3 +621,4 @@ rbffi_Struct_Init(VALUE moduleFFI)
|
|
629
621
|
id_to_ptr = rb_intern("to_ptr");
|
630
622
|
id_to_s = rb_intern("to_s");
|
631
623
|
}
|
624
|
+
|
data/ext/ffi_c/Struct.h
CHANGED
@@ -4,27 +4,19 @@
|
|
4
4
|
*
|
5
5
|
* All rights reserved.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
7
|
+
* This file is part of ruby-ffi.
|
9
8
|
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
* this list of conditions and the following disclaimer in the documentation
|
14
|
-
* and/or other materials provided with the distribution.
|
15
|
-
* * The name of the author or authors may not be used to endorse or promote
|
16
|
-
* products derived from this software without specific prior written permission.
|
9
|
+
* This code is free software: you can redistribute it and/or modify it under
|
10
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
11
|
+
* published by the Free Software Foundation.
|
17
12
|
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
26
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
14
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
16
|
+
* version 3 for more details.
|
17
|
+
*
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
19
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
28
20
|
*/
|
29
21
|
|
30
22
|
#ifndef RBFFI_STRUCT_H
|
data/ext/ffi_c/StructByValue.c
CHANGED
@@ -1,28 +1,21 @@
|
|
1
1
|
/*
|
2
2
|
* Copyright (c) 2009, Wayne Meissner
|
3
|
+
*
|
3
4
|
* All rights reserved.
|
4
5
|
*
|
5
|
-
*
|
6
|
-
*
|
6
|
+
* This file is part of ruby-ffi.
|
7
|
+
*
|
8
|
+
* This code is free software: you can redistribute it and/or modify it under
|
9
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
+
* published by the Free Software Foundation.
|
7
11
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
* and/or other materials provided with the distribution.
|
13
|
-
* * The name of the author or authors may not be used to endorse or promote
|
14
|
-
* products derived from this software without specific prior written permission.
|
12
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
+
* version 3 for more details.
|
15
16
|
*
|
16
|
-
*
|
17
|
-
*
|
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.
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
26
19
|
*/
|
27
20
|
|
28
21
|
#include <sys/param.h>
|
@@ -138,3 +131,4 @@ rbffi_StructByValue_Init(VALUE moduleFFI)
|
|
138
131
|
rb_define_method(rbffi_StructByValueClass, "layout", sbv_layout, 0);
|
139
132
|
rb_define_method(rbffi_StructByValueClass, "struct_class", sbv_struct_class, 0);
|
140
133
|
}
|
134
|
+
|
data/ext/ffi_c/StructByValue.h
CHANGED
@@ -1,28 +1,21 @@
|
|
1
1
|
/*
|
2
2
|
* Copyright (c) 2009, Wayne Meissner
|
3
|
+
*
|
3
4
|
* All rights reserved.
|
4
5
|
*
|
5
|
-
*
|
6
|
-
*
|
6
|
+
* This file is part of ruby-ffi.
|
7
|
+
*
|
8
|
+
* This code is free software: you can redistribute it and/or modify it under
|
9
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
+
* published by the Free Software Foundation.
|
7
11
|
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
* and/or other materials provided with the distribution.
|
13
|
-
* * The name of the author or authors may not be used to endorse or promote
|
14
|
-
* products derived from this software without specific prior written permission.
|
12
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
+
* version 3 for more details.
|
15
16
|
*
|
16
|
-
*
|
17
|
-
*
|
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.
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
18
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
26
19
|
*/
|
27
20
|
|
28
21
|
#ifndef RBFFI_STRUCTBYVALUE_H
|
data/ext/ffi_c/StructLayout.c
CHANGED
@@ -4,27 +4,19 @@
|
|
4
4
|
*
|
5
5
|
* All rights reserved.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
* modification, are permitted provided that the following conditions are met:
|
7
|
+
* This file is part of ruby-ffi.
|
9
8
|
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
* this list of conditions and the following disclaimer in the documentation
|
14
|
-
* and/or other materials provided with the distribution.
|
15
|
-
* * The name of the author or authors may not be used to endorse or promote
|
16
|
-
* products derived from this software without specific prior written permission.
|
9
|
+
* This code is free software: you can redistribute it and/or modify it under
|
10
|
+
* the terms of the GNU Lesser General Public License version 3 only, as
|
11
|
+
* published by the Free Software Foundation.
|
17
12
|
*
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
26
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
27
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
|
+
* This code is distributed in the hope that it will be useful, but WITHOUT
|
14
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
16
|
+
* version 3 for more details.
|
17
|
+
*
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
19
|
+
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
|
28
20
|
*/
|
29
21
|
|
30
22
|
#include <sys/types.h>
|
@@ -496,3 +488,4 @@ rbffi_StructLayout_Init(VALUE moduleFFI)
|
|
496
488
|
rb_define_method(rbffi_StructLayoutClass, "to_a", struct_layout_to_a, 0);
|
497
489
|
|
498
490
|
}
|
491
|
+
|