ffi 1.9.0 → 1.9.3
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.
- checksums.yaml +15 -0
- data/COPYING +48 -673
- data/LICENSE +21 -11
- data/README.md +6 -6
- data/ext/ffi_c/AbstractMemory.c +23 -12
- data/ext/ffi_c/AbstractMemory.h +21 -12
- data/ext/ffi_c/ArrayType.c +21 -12
- data/ext/ffi_c/ArrayType.h +21 -12
- data/ext/ffi_c/Buffer.c +22 -12
- data/ext/ffi_c/Call.c +21 -12
- data/ext/ffi_c/Call.h +21 -12
- data/ext/ffi_c/ClosurePool.c +21 -12
- data/ext/ffi_c/ClosurePool.h +21 -12
- data/ext/ffi_c/DynamicLibrary.c +21 -12
- data/ext/ffi_c/DynamicLibrary.h +21 -12
- data/ext/ffi_c/Function.c +21 -12
- data/ext/ffi_c/Function.h +21 -12
- data/ext/ffi_c/FunctionInfo.c +22 -12
- data/ext/ffi_c/LastError.c +22 -12
- data/ext/ffi_c/LastError.h +21 -12
- data/ext/ffi_c/LongDouble.h +21 -12
- data/ext/ffi_c/MappedType.c +21 -12
- data/ext/ffi_c/MappedType.h +21 -12
- data/ext/ffi_c/MemoryPointer.c +22 -13
- data/ext/ffi_c/MemoryPointer.h +21 -12
- data/ext/ffi_c/MethodHandle.c +21 -12
- data/ext/ffi_c/MethodHandle.h +21 -12
- data/ext/ffi_c/Platform.c +21 -12
- data/ext/ffi_c/Platform.h +21 -12
- data/ext/ffi_c/Pointer.c +21 -12
- data/ext/ffi_c/Pointer.h +21 -12
- data/ext/ffi_c/Struct.c +22 -13
- data/ext/ffi_c/Struct.h +21 -12
- data/ext/ffi_c/StructByValue.c +21 -12
- data/ext/ffi_c/StructByValue.h +21 -12
- data/ext/ffi_c/StructLayout.c +21 -12
- data/ext/ffi_c/Thread.c +21 -12
- data/ext/ffi_c/Thread.h +21 -12
- data/ext/ffi_c/Type.c +23 -12
- data/ext/ffi_c/Type.h +24 -9
- data/ext/ffi_c/Types.c +21 -12
- data/ext/ffi_c/Types.h +21 -12
- data/ext/ffi_c/Variadic.c +22 -12
- data/ext/ffi_c/compat.h +21 -12
- data/ext/ffi_c/ffi.c +22 -12
- data/ext/ffi_c/rbffi.h +21 -12
- data/ffi.gemspec +2 -2
- data/lib/ffi/autopointer.rb +21 -11
- data/lib/ffi/enum.rb +22 -11
- data/lib/ffi/errno.rb +21 -11
- data/lib/ffi/ffi.rb +22 -11
- data/lib/ffi/io.rb +21 -11
- data/lib/ffi/library.rb +22 -12
- data/lib/ffi/managedstruct.rb +29 -0
- data/lib/ffi/platform.rb +20 -11
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/pointer.rb +22 -10
- data/lib/ffi/struct.rb +22 -11
- data/lib/ffi/struct_layout_builder.rb +22 -11
- data/lib/ffi/types.rb +23 -10
- data/lib/ffi/union.rb +23 -12
- data/lib/ffi/variadic.rb +24 -11
- data/lib/ffi/version.rb +1 -1
- data/libtest/BoolTest.c +4 -1
- data/libtest/StructTest.c +4 -1
- metadata +72 -101
- data/COPYING.LESSER +0 -165
- data/History.txt +0 -1
- data/ext/ffi_c/cruby-ext.iml +0 -12
- data/gen/log +0 -1
- data/lib/ffi/ffi.iml +0 -11
- data/spec/ffi/spec.iml +0 -12
data/ffi.gemspec
CHANGED
@@ -8,11 +8,11 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.homepage = 'http://wiki.github.com/ffi/ffi'
|
9
9
|
s.summary = 'Ruby FFI'
|
10
10
|
s.description = 'Ruby FFI library'
|
11
|
-
s.files = %w(ffi.gemspec
|
11
|
+
s.files = %w(ffi.gemspec LICENSE COPYING README.md Rakefile) + Dir.glob("{ext,gen,lib,spec,libtest}/**/*").reject { |f| f =~ /(lib\/[12]\.[089]|\.so$|\.bundle$)/ }
|
12
12
|
s.extensions << 'ext/ffi_c/extconf.rb'
|
13
13
|
s.has_rdoc = false
|
14
14
|
s.rdoc_options = %w[--exclude=ext/ffi_c/.*\.o$ --exclude=ffi_c\.(bundle|so)$]
|
15
|
-
s.license = '
|
15
|
+
s.license = 'BSD'
|
16
16
|
s.require_paths << 'ext/ffi_c'
|
17
17
|
s.required_ruby_version = '>= 1.8.7'
|
18
18
|
s.add_development_dependency 'rake'
|
data/lib/ffi/autopointer.rb
CHANGED
@@ -2,22 +2,32 @@
|
|
2
2
|
# Copyright (C) 2008-2010 Wayne Meissner
|
3
3
|
# Copyright (C) 2008 Mike Dalessio
|
4
4
|
#
|
5
|
-
# All rights reserved.
|
6
|
-
#
|
7
5
|
# This file is part of ruby-ffi.
|
8
6
|
#
|
9
|
-
#
|
10
|
-
# the terms of the GNU Lesser General Public License version 3 only, as
|
11
|
-
# published by the Free Software Foundation.
|
7
|
+
# All rights reserved.
|
12
8
|
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
16
|
-
# version 3 for more details.
|
9
|
+
# Redistribution and use in source and binary forms, with or without
|
10
|
+
# modification, are permitted provided that the following conditions are met:
|
17
11
|
#
|
18
|
-
#
|
19
|
-
#
|
12
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
13
|
+
# list of conditions and the following disclaimer.
|
14
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
15
|
+
# this list of conditions and the following disclaimer in the documentation
|
16
|
+
# and/or other materials provided with the distribution.
|
17
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
18
|
+
# may be used to endorse or promote products derived from this software
|
19
|
+
# without specific prior written permission.
|
20
20
|
#
|
21
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
22
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
24
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
25
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
27
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
28
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
29
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
21
31
|
|
22
32
|
module FFI
|
23
33
|
class AutoPointer < Pointer
|
data/lib/ffi/enum.rb
CHANGED
@@ -2,21 +2,32 @@
|
|
2
2
|
# Copyright (C) 2009, 2010 Wayne Meissner
|
3
3
|
# Copyright (C) 2009 Luc Heinrich
|
4
4
|
#
|
5
|
-
# All rights reserved.
|
6
|
-
#
|
7
5
|
# This file is part of ruby-ffi.
|
8
6
|
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
7
|
+
# All rights reserved.
|
8
|
+
#
|
9
|
+
# Redistribution and use in source and binary forms, with or without
|
10
|
+
# modification, are permitted provided that the following conditions are met:
|
12
11
|
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
12
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
13
|
+
# list of conditions and the following disclaimer.
|
14
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
15
|
+
# this list of conditions and the following disclaimer in the documentation
|
16
|
+
# and/or other materials provided with the distribution.
|
17
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
18
|
+
# may be used to endorse or promote products derived from this software
|
19
|
+
# without specific prior written permission.
|
17
20
|
#
|
18
|
-
#
|
19
|
-
#
|
21
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
22
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
24
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
25
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
27
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
28
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
29
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
20
31
|
#
|
21
32
|
|
22
33
|
module FFI
|
data/lib/ffi/errno.rb
CHANGED
@@ -1,22 +1,32 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2008-2010 Wayne Meissner
|
3
3
|
#
|
4
|
-
# All rights reserved.
|
5
|
-
#
|
6
4
|
# This file is part of ruby-ffi.
|
7
5
|
#
|
8
|
-
#
|
9
|
-
# the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
-
# published by the Free Software Foundation.
|
6
|
+
# All rights reserved.
|
11
7
|
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
-
# version 3 for more details.
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
16
10
|
#
|
17
|
-
#
|
18
|
-
#
|
11
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
12
|
+
# list of conditions and the following disclaimer.
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
15
|
+
# and/or other materials provided with the distribution.
|
16
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
|
+
# without specific prior written permission.
|
19
19
|
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
24
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
25
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
27
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
28
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
|
20
30
|
|
21
31
|
module FFI
|
22
32
|
# @return (see FFI::LastError.error)
|
data/lib/ffi/ffi.rb
CHANGED
@@ -1,21 +1,32 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2008-2010 JRuby project
|
3
3
|
#
|
4
|
-
# All rights reserved.
|
5
|
-
#
|
6
4
|
# This file is part of ruby-ffi.
|
7
5
|
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
6
|
+
# All rights reserved.
|
7
|
+
#
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
11
10
|
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
11
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
12
|
+
# list of conditions and the following disclaimer.
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
15
|
+
# and/or other materials provided with the distribution.
|
16
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
|
+
# without specific prior written permission.
|
16
19
|
#
|
17
|
-
#
|
18
|
-
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
24
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
25
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
27
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
28
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
19
30
|
|
20
31
|
require 'ffi/platform'
|
21
32
|
require 'ffi/types'
|
data/lib/ffi/io.rb
CHANGED
@@ -1,22 +1,32 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2008, 2009 Wayne Meissner
|
3
3
|
#
|
4
|
-
# All rights reserved.
|
5
|
-
#
|
6
4
|
# This file is part of ruby-ffi.
|
7
5
|
#
|
8
|
-
#
|
9
|
-
# the terms of the GNU Lesser General Public License version 3 only, as
|
10
|
-
# published by the Free Software Foundation.
|
6
|
+
# All rights reserved.
|
11
7
|
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
15
|
-
# version 3 for more details.
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
16
10
|
#
|
17
|
-
#
|
18
|
-
#
|
11
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
12
|
+
# list of conditions and the following disclaimer.
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
15
|
+
# and/or other materials provided with the distribution.
|
16
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
|
+
# without specific prior written permission.
|
19
19
|
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
24
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
25
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
27
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
28
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
|
20
30
|
|
21
31
|
module FFI
|
22
32
|
|
data/lib/ffi/library.rb
CHANGED
@@ -1,22 +1,32 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2008-2010 Wayne Meissner
|
3
|
-
# Copyright (C) 2008 Luc Heinrich <luc@honk-honk.com>
|
4
|
-
#
|
5
|
-
# All rights reserved.
|
6
3
|
#
|
7
4
|
# This file is part of ruby-ffi.
|
8
5
|
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
6
|
+
# All rights reserved.
|
7
|
+
#
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
12
10
|
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
11
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
12
|
+
# list of conditions and the following disclaimer.
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
15
|
+
# and/or other materials provided with the distribution.
|
16
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
|
+
# without specific prior written permission.
|
17
19
|
#
|
18
|
-
#
|
19
|
-
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
24
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
25
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
27
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
28
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
|
20
30
|
|
21
31
|
module FFI
|
22
32
|
CURRENT_PROCESS = USE_THIS_PROCESS_AS_LIBRARY = Object.new
|
data/lib/ffi/managedstruct.rb
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
+
# Copyright (C) 2008 Mike Dalessio
|
2
|
+
#
|
3
|
+
# This file is part of ruby-ffi.
|
4
|
+
#
|
5
|
+
# All rights reserved.
|
6
|
+
#
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
8
|
+
# modification, are permitted provided that the following conditions are met:
|
9
|
+
#
|
10
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
11
|
+
# list of conditions and the following disclaimer.
|
12
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
13
|
+
# this list of conditions and the following disclaimer in the documentation
|
14
|
+
# and/or other materials provided with the distribution.
|
15
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
16
|
+
# may be used to endorse or promote products derived from this software
|
17
|
+
# without specific prior written permission.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
22
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
23
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
24
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
25
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
26
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
27
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
|
1
30
|
module FFI
|
2
31
|
#
|
3
32
|
# FFI::ManagedStruct allows custom garbage-collection of your FFI::Structs.
|
data/lib/ffi/platform.rb
CHANGED
@@ -1,23 +1,32 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2008, 2009 Wayne Meissner
|
3
|
-
# All rights reserved.
|
4
3
|
#
|
5
4
|
# This file is part of ruby-ffi.
|
6
5
|
#
|
7
6
|
# All rights reserved.
|
8
7
|
#
|
9
|
-
#
|
10
|
-
#
|
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.
|
8
|
+
# Redistribution and use in source and binary forms, with or without
|
9
|
+
# modification, are permitted provided that the following conditions are met:
|
17
10
|
#
|
18
|
-
#
|
19
|
-
#
|
11
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
12
|
+
# list of conditions and the following disclaimer.
|
13
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
14
|
+
# this list of conditions and the following disclaimer in the documentation
|
15
|
+
# and/or other materials provided with the distribution.
|
16
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
17
|
+
# may be used to endorse or promote products derived from this software
|
18
|
+
# without specific prior written permission.
|
20
19
|
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
24
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
25
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
26
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
27
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
28
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.#
|
21
30
|
|
22
31
|
require 'rbconfig'
|
23
32
|
module FFI
|
data/lib/ffi/pointer.rb
CHANGED
@@ -1,21 +1,33 @@
|
|
1
1
|
#
|
2
2
|
# Copyright (C) 2008, 2009 Wayne Meissner
|
3
3
|
# Copyright (c) 2007, 2008 Evan Phoenix
|
4
|
-
# All rights reserved.
|
5
4
|
#
|
6
5
|
# This file is part of ruby-ffi.
|
7
6
|
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
7
|
+
# All rights reserved.
|
8
|
+
#
|
9
|
+
# Redistribution and use in source and binary forms, with or without
|
10
|
+
# modification, are permitted provided that the following conditions are met:
|
11
11
|
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
12
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
13
|
+
# list of conditions and the following disclaimer.
|
14
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
15
|
+
# this list of conditions and the following disclaimer in the documentation
|
16
|
+
# and/or other materials provided with the distribution.
|
17
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
18
|
+
# may be used to endorse or promote products derived from this software
|
19
|
+
# without specific prior written permission.
|
16
20
|
#
|
17
|
-
#
|
18
|
-
#
|
21
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
22
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
24
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
25
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
26
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
27
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
28
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
29
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
19
31
|
#
|
20
32
|
|
21
33
|
require 'ffi/platform'
|
data/lib/ffi/struct.rb
CHANGED
@@ -3,21 +3,32 @@
|
|
3
3
|
# Copyright (C) 2008, 2009 Andrea Fazzi
|
4
4
|
# Copyright (C) 2008, 2009 Luc Heinrich
|
5
5
|
#
|
6
|
-
# All rights reserved.
|
7
|
-
#
|
8
6
|
# This file is part of ruby-ffi.
|
9
7
|
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
8
|
+
# All rights reserved.
|
9
|
+
#
|
10
|
+
# Redistribution and use in source and binary forms, with or without
|
11
|
+
# modification, are permitted provided that the following conditions are met:
|
13
12
|
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
13
|
+
# * Redistributions of source code must retain the above copyright notice, this
|
14
|
+
# list of conditions and the following disclaimer.
|
15
|
+
# * Redistributions in binary form must reproduce the above copyright notice
|
16
|
+
# this list of conditions and the following disclaimer in the documentation
|
17
|
+
# and/or other materials provided with the distribution.
|
18
|
+
# * Neither the name of the Ruby FFI project nor the names of its contributors
|
19
|
+
# may be used to endorse or promote products derived from this software
|
20
|
+
# without specific prior written permission.
|
18
21
|
#
|
19
|
-
#
|
20
|
-
#
|
22
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
25
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
26
|
+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
27
|
+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
28
|
+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
29
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
30
|
+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
31
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
21
32
|
#
|
22
33
|
|
23
34
|
require 'ffi/platform'
|