yakg 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/.gitignore +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +27 -19
- data/VERSION +1 -1
- data/lib/yakg.rb +6 -6
- data/spec/spec_helper.rb +1 -3
- data/spec/yakg_spec.rb +13 -13
- data/vendor/gems/README.md +26 -20
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/COPYING +49 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/LICENSE +24 -0
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/README.md +7 -7
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/Rakefile +31 -41
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/ffi.gemspec +7 -6
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/autopointer.rb +24 -14
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/enum.rb +34 -22
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/errno.rb +43 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/ffi.rb +44 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/io.rb +62 -0
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/library.rb +79 -44
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/managedstruct.rb +29 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/aarch64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform.rb +35 -15
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/pointer.rb +22 -10
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/struct.rb +31 -14
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/struct_layout_builder.rb +46 -30
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/types.rb +24 -11
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/union.rb +43 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/variadic.rb +78 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/version.rb +4 -0
- data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi.rb +1 -9
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi_c.bundle +0 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/Benchmark.c +52 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/BoolTest.c +34 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/BufferTest.c +31 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/ClosureTest.c +205 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/EnumTest.c +51 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/FunctionTest.c +70 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/GNUmakefile +149 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/GlobalVariable.c +62 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/LastErrorTest.c +21 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/NumberTest.c +132 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/PointerTest.c +63 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/ReferenceTest.c +23 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/StringTest.c +34 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/StructTest.c +243 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/UnionTest.c +43 -0
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/VariadicTest.c +62 -0
- data/vendor/gems/ruby/2.0.0/specifications/ffi-1.9.10.gemspec +45 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/CHANGELOG +12 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/LICENSE +8 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/README.md +40 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/array.rb +123 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/base.rb +197 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb +25 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/data.rb +42 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/date.rb +32 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/dictionary.rb +114 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/extensions.rb +158 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/null.rb +11 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/number.rb +98 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/string.rb +91 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/version.rb +4 -0
- data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation.rb +13 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/COPYING +49 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/LICENSE +24 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/README.md +109 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/Rakefile +210 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/ffi.gemspec +23 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/gen/Rakefile +30 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/autopointer.rb +194 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/buffer.rb +4 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/callback.rb +4 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/enum.rb +174 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/errno.rb +43 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/ffi.rb +44 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/io.rb +62 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/library.rb +524 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/managedstruct.rb +84 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/memorypointer.rb +1 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/aarch64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/arm-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/vendor/gems/ruby/{2.0.0/gems/ffi-1.9.0/lib/ffi/platform/x86_64-darwin → 2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-darwin}/types.conf +2 -2
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-windows/types.conf +105 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/ia64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-aix/types.conf +180 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-linux/types.conf +100 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-solaris/types.conf +128 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-windows/types.conf +27 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform.rb +159 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/pointer.rb +134 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/struct.rb +373 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/struct_layout_builder.rb +227 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/const_generator.rb +229 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/generator.rb +60 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/generator_task.rb +36 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/struct_generator.rb +194 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/types_generator.rb +135 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/types.rb +190 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/union.rb +43 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/variadic.rb +78 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/version.rb +4 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi.rb +20 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi_c.bundle +0 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/Benchmark.c +52 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/BoolTest.c +34 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/BufferTest.c +31 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/ClosureTest.c +205 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/EnumTest.c +51 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/FunctionTest.c +70 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/GNUmakefile +149 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/GlobalVariable.c +62 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/LastErrorTest.c +21 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/NumberTest.c +132 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/PointerTest.c +63 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/ReferenceTest.c +23 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/StringTest.c +34 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/StructTest.c +243 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/UnionTest.c +43 -0
- data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/VariadicTest.c +62 -0
- data/vendor/gems/ruby/2.1.0/specifications/corefoundation-0.2.0.gemspec +45 -0
- data/vendor/gems/ruby/2.1.0/specifications/ffi-1.9.10.gemspec +49 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/CHANGELOG +12 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/LICENSE +8 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/README.md +40 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/array.rb +123 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/base.rb +197 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb +25 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/data.rb +42 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/date.rb +32 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/dictionary.rb +114 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/extensions.rb +158 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/null.rb +11 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/number.rb +98 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/string.rb +91 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/version.rb +4 -0
- data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation.rb +13 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/COPYING +49 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/LICENSE +24 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/README.md +109 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/Rakefile +210 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/ffi.gemspec +23 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/gen/Rakefile +30 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/autopointer.rb +194 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/buffer.rb +4 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/callback.rb +4 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/enum.rb +174 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/errno.rb +43 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/ffi.rb +44 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/io.rb +62 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/library.rb +524 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/managedstruct.rb +84 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/memorypointer.rb +1 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/aarch64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/arm-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-darwin/types.conf +100 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-netbsd/types.conf +126 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-windows/types.conf +105 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/ia64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-aix/types.conf +180 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-linux/types.conf +100 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-solaris/types.conf +128 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-linux/types.conf +102 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-windows/types.conf +27 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform.rb +159 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/pointer.rb +134 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/struct.rb +373 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/struct_layout_builder.rb +227 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/const_generator.rb +229 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/generator.rb +60 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/generator_task.rb +36 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/struct_generator.rb +194 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/types_generator.rb +135 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/types.rb +190 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/union.rb +43 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/variadic.rb +78 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/version.rb +4 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi.rb +20 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi_c.bundle +0 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/Benchmark.c +52 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/BoolTest.c +34 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/BufferTest.c +31 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/ClosureTest.c +205 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/EnumTest.c +51 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/FunctionTest.c +70 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/GNUmakefile +149 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/GlobalVariable.c +62 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/LastErrorTest.c +21 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/NumberTest.c +132 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/PointerTest.c +63 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/ReferenceTest.c +23 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/StringTest.c +34 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/StructTest.c +243 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/UnionTest.c +43 -0
- data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/VariadicTest.c +62 -0
- data/vendor/gems/ruby/2.2.0/specifications/corefoundation-0.2.0.gemspec +45 -0
- data/vendor/gems/ruby/2.2.0/specifications/ffi-1.9.10.gemspec +49 -0
- data/yakg.gemspec +3 -3
- metadata +288 -83
- data/vendor/gems/Gemfile +0 -4
- data/vendor/gems/Gemfile.lock +0 -13
- data/vendor/gems/installit.sh +0 -65
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/COPYING +0 -674
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/COPYING.LESSER +0 -165
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/History.txt +0 -1
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/LICENSE +0 -14
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/gen/log +0 -1
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/errno.rb +0 -33
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/ffi.iml +0 -11
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/ffi.rb +0 -33
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/io.rb +0 -52
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/union.rb +0 -32
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/variadic.rb +0 -65
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/version.rb +0 -4
- data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi_c.bundle +0 -0
- data/vendor/gems/ruby/2.0.0/specifications/ffi-1.9.0.gemspec +0 -42
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/gen/Rakefile +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/buffer.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/callback.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/memorypointer.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/arm-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-cygwin/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-darwin/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-freebsd/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-gnu/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-netbsd/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-openbsd/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-solaris/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/i386-windows/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/ia64-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/mips-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/mipsel-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/powerpc-aix/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/powerpc-darwin/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/powerpc-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/s390-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/s390x-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/sparc-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/sparc-solaris/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/sparcv9-solaris/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/x86_64-freebsd/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/x86_64-linux/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0/lib/ffi/platform/x86_64-openbsd → ffi-1.9.10/lib/ffi/platform/x86_64-netbsd}/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/x86_64-solaris/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform/x86_64-windows/types.conf +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/const_generator.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/generator.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/generator_task.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/struct_generator.rb +0 -0
- /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/types_generator.rb +0 -0
- /data/vendor/gems/ruby/{2.0.0/gems/ffi-1.9.0/lib/ffi/platform/x86_64-netbsd → 2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-netbsd}/types.conf +0 -0
@@ -0,0 +1,243 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2007 Wayne Meissner.
|
3
|
+
* Copyright (c) 2009 Andrea Fazzi <andrea.fazzi@alcacoop.it>.
|
4
|
+
*
|
5
|
+
* All rights reserved.
|
6
|
+
*
|
7
|
+
* For licensing, see LICENSE.SPECS
|
8
|
+
*/
|
9
|
+
|
10
|
+
#include <stdio.h>
|
11
|
+
#include <stdlib.h>
|
12
|
+
#include <stdbool.h>
|
13
|
+
#include <stdint.h>
|
14
|
+
#include <string.h>
|
15
|
+
#include <stdarg.h>
|
16
|
+
|
17
|
+
typedef char s8;
|
18
|
+
typedef short s16;
|
19
|
+
typedef int s32;
|
20
|
+
typedef long long s64;
|
21
|
+
typedef float f32;
|
22
|
+
typedef double f64;
|
23
|
+
|
24
|
+
typedef struct bugged_struct {
|
25
|
+
unsigned char visible;
|
26
|
+
unsigned int x;
|
27
|
+
unsigned int y;
|
28
|
+
short rx;
|
29
|
+
short ry;
|
30
|
+
unsigned char order;
|
31
|
+
unsigned char size;
|
32
|
+
} bugged_struct_t;
|
33
|
+
|
34
|
+
unsigned int
|
35
|
+
bugged_struct_size() {
|
36
|
+
return sizeof(bugged_struct_t);
|
37
|
+
}
|
38
|
+
|
39
|
+
struct test1 {
|
40
|
+
char b;
|
41
|
+
short s;
|
42
|
+
int i;
|
43
|
+
long long j;
|
44
|
+
long l;
|
45
|
+
float f;
|
46
|
+
double d;
|
47
|
+
char string[32];
|
48
|
+
};
|
49
|
+
|
50
|
+
struct struct_with_array {
|
51
|
+
char c;
|
52
|
+
int a[5];
|
53
|
+
};
|
54
|
+
|
55
|
+
struct nested {
|
56
|
+
int i;
|
57
|
+
};
|
58
|
+
|
59
|
+
struct container {
|
60
|
+
char first;
|
61
|
+
struct nested s;
|
62
|
+
};
|
63
|
+
|
64
|
+
int
|
65
|
+
struct_align_nested_struct(struct container* a) { return a->s.i; }
|
66
|
+
|
67
|
+
void*
|
68
|
+
struct_field_array(struct struct_with_array* s) { return &s->a; }
|
69
|
+
|
70
|
+
struct container*
|
71
|
+
struct_make_container_struct(int i)
|
72
|
+
{
|
73
|
+
static struct container cs;
|
74
|
+
memset(&cs, 0, sizeof(cs));
|
75
|
+
cs.first = 1;
|
76
|
+
cs.s.i = i;
|
77
|
+
return &cs;
|
78
|
+
}
|
79
|
+
|
80
|
+
#define T(x, type) \
|
81
|
+
type struct_field_##type(struct test1* t) { return t->x; } \
|
82
|
+
struct type##_align { char first; type value; }; \
|
83
|
+
type struct_align_##type(struct type##_align* a) { return a->value; }
|
84
|
+
|
85
|
+
T(b, s8);
|
86
|
+
T(s, s16);
|
87
|
+
T(i, s32);
|
88
|
+
T(j, s64);
|
89
|
+
T(f, f32);
|
90
|
+
T(d, f64);
|
91
|
+
T(l, long);
|
92
|
+
|
93
|
+
void
|
94
|
+
struct_set_string(struct test1* t, char* s)
|
95
|
+
{
|
96
|
+
strcpy(t->string, s);
|
97
|
+
}
|
98
|
+
|
99
|
+
struct test1*
|
100
|
+
struct_make_struct(char b, short s, int i, long long ll, float f, double d)
|
101
|
+
{
|
102
|
+
static struct test1 t;
|
103
|
+
memset(&t, 0, sizeof(t));
|
104
|
+
t.b = b;
|
105
|
+
t.s = s;
|
106
|
+
t.i = i;
|
107
|
+
t.j = ll;
|
108
|
+
t.f = f;
|
109
|
+
t.d = d;
|
110
|
+
return &t;
|
111
|
+
}
|
112
|
+
|
113
|
+
typedef int (*add_cb)(int a1, int a2);
|
114
|
+
typedef int (*sub_cb)(int a1, int a2);
|
115
|
+
struct test2 {
|
116
|
+
add_cb add_callback;
|
117
|
+
sub_cb sub_callback;
|
118
|
+
};
|
119
|
+
|
120
|
+
int
|
121
|
+
struct_call_add_cb(struct test2* t, int a1, int a2)
|
122
|
+
{
|
123
|
+
return t->add_callback(a1, a2);
|
124
|
+
}
|
125
|
+
|
126
|
+
int
|
127
|
+
struct_call_sub_cb(struct test2* t, int a1, int a2)
|
128
|
+
{
|
129
|
+
return t->sub_callback(a1, a2);
|
130
|
+
}
|
131
|
+
|
132
|
+
|
133
|
+
struct struct_with_array*
|
134
|
+
struct_make_struct_with_array(int a_0, int a_1, int a_2, int a_3, int a_4)
|
135
|
+
{
|
136
|
+
static struct struct_with_array s;
|
137
|
+
|
138
|
+
memset(&s, 0, sizeof(s));
|
139
|
+
|
140
|
+
s.a[0] = a_0;
|
141
|
+
s.a[1] = a_1;
|
142
|
+
s.a[2] = a_2;
|
143
|
+
s.a[3] = a_3;
|
144
|
+
s.a[4] = a_4;
|
145
|
+
|
146
|
+
return &s;
|
147
|
+
|
148
|
+
}
|
149
|
+
|
150
|
+
struct s8s32 {
|
151
|
+
char s8;
|
152
|
+
int s32;
|
153
|
+
};
|
154
|
+
|
155
|
+
struct s8s32
|
156
|
+
struct_return_s8s32()
|
157
|
+
{
|
158
|
+
struct s8s32 s;
|
159
|
+
s.s8 = 0x7f;
|
160
|
+
s.s32 = 0x12345678;
|
161
|
+
|
162
|
+
return s;
|
163
|
+
}
|
164
|
+
|
165
|
+
struct s8s32
|
166
|
+
struct_s8s32_set(char s8, int s32)
|
167
|
+
{
|
168
|
+
struct s8s32 s;
|
169
|
+
|
170
|
+
s.s8 = s8;
|
171
|
+
s.s32 = s32;
|
172
|
+
|
173
|
+
return s;
|
174
|
+
}
|
175
|
+
|
176
|
+
int
|
177
|
+
struct_s8s32_get_s8(struct s8s32 s)
|
178
|
+
{
|
179
|
+
return s.s8;
|
180
|
+
}
|
181
|
+
|
182
|
+
int
|
183
|
+
struct_s8s32_get_s32(struct s8s32 s)
|
184
|
+
{
|
185
|
+
return s.s32;
|
186
|
+
}
|
187
|
+
|
188
|
+
struct s8s32
|
189
|
+
struct_s8s32_ret_s8s32(struct s8s32 s)
|
190
|
+
{
|
191
|
+
return s;
|
192
|
+
}
|
193
|
+
|
194
|
+
// Pass a struct and an int arg, ensure the int arg is passed correctly
|
195
|
+
int
|
196
|
+
struct_s8s32_s32_ret_s32(struct s8s32 s, int s32)
|
197
|
+
{
|
198
|
+
return s32;
|
199
|
+
}
|
200
|
+
|
201
|
+
// Pass a struct and a long long arg, ensure the long long arg is passed correctly
|
202
|
+
long long
|
203
|
+
struct_s8s32_s64_ret_s64(struct s8s32 s, long long s64)
|
204
|
+
{
|
205
|
+
return s64;
|
206
|
+
}
|
207
|
+
|
208
|
+
// Pass a struct and a long long arg, ensure the long long arg is passed correctly
|
209
|
+
int
|
210
|
+
struct_s32_ptr_s32_s8s32_ret_s32(int s32a, void *ptr, int s32b, struct s8s32 s)
|
211
|
+
{
|
212
|
+
if (ptr != NULL) *(struct s8s32 *) ptr = s;
|
213
|
+
return s.s32;
|
214
|
+
}
|
215
|
+
|
216
|
+
// Pass a char *, copy into buffer length struct
|
217
|
+
struct struct_string {
|
218
|
+
char *bytes;
|
219
|
+
int len;
|
220
|
+
};
|
221
|
+
|
222
|
+
struct struct_string
|
223
|
+
struct_varargs_ret_struct_string(int len, ...)
|
224
|
+
{
|
225
|
+
struct struct_string ss;
|
226
|
+
va_list vl;
|
227
|
+
char* cp = NULL;
|
228
|
+
|
229
|
+
va_start(vl, len);
|
230
|
+
|
231
|
+
ss.len = len;
|
232
|
+
ss.bytes = va_arg(vl, char *);
|
233
|
+
if (ss.bytes != NULL) {
|
234
|
+
cp = malloc(strlen(ss.bytes) + 1);
|
235
|
+
strcpy(cp, ss.bytes);
|
236
|
+
ss.bytes = cp;
|
237
|
+
}
|
238
|
+
|
239
|
+
va_end(vl);
|
240
|
+
|
241
|
+
return ss;
|
242
|
+
}
|
243
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2007 Wayne Meissner. All rights reserved.
|
3
|
+
*
|
4
|
+
* For licensing, see LICENSE.SPECS
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include <stdio.h>
|
8
|
+
#include <stdbool.h>
|
9
|
+
#include <stdint.h>
|
10
|
+
#include <string.h>
|
11
|
+
#include <stdlib.h>
|
12
|
+
|
13
|
+
typedef char s8;
|
14
|
+
typedef short s16;
|
15
|
+
typedef int s32;
|
16
|
+
typedef long long s64;
|
17
|
+
typedef float f32;
|
18
|
+
typedef double f64;
|
19
|
+
|
20
|
+
typedef union union_test {
|
21
|
+
char b;
|
22
|
+
short s;
|
23
|
+
int i;
|
24
|
+
long long j;
|
25
|
+
long l;
|
26
|
+
float f;
|
27
|
+
double d;
|
28
|
+
s8 a[10];
|
29
|
+
} union_test_t;
|
30
|
+
|
31
|
+
#define T(x, type) \
|
32
|
+
type union_align_##type(union_test_t* u) { return u->x; } \
|
33
|
+
union_test_t* union_make_union_with_##type(type value) { static union_test_t u; u.x = value; return &u; }
|
34
|
+
|
35
|
+
T(b, s8);
|
36
|
+
T(s, s16);
|
37
|
+
T(i, s32);
|
38
|
+
T(j, s64);
|
39
|
+
T(f, f32);
|
40
|
+
T(d, f64);
|
41
|
+
T(l, long);
|
42
|
+
|
43
|
+
unsigned int union_size() { return sizeof(union_test_t); }
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2007 Wayne Meissner. All rights reserved.
|
3
|
+
*
|
4
|
+
* For licensing, see LICENSE.SPECS
|
5
|
+
*/
|
6
|
+
|
7
|
+
#include <sys/types.h>
|
8
|
+
#include <stdio.h>
|
9
|
+
#include <stdint.h>
|
10
|
+
#include <string.h>
|
11
|
+
#include <stdarg.h>
|
12
|
+
|
13
|
+
typedef int8_t s8;
|
14
|
+
typedef uint8_t u8;
|
15
|
+
typedef int16_t s16;
|
16
|
+
typedef uint16_t u16;
|
17
|
+
typedef int32_t s32;
|
18
|
+
typedef uint32_t u32;
|
19
|
+
typedef int64_t s64;
|
20
|
+
typedef uint64_t u64;
|
21
|
+
typedef signed long sL;
|
22
|
+
typedef unsigned long uL;
|
23
|
+
typedef float F;
|
24
|
+
typedef double D;
|
25
|
+
|
26
|
+
void pack_varargs(s64* buf, const char* fmt, ...)
|
27
|
+
{
|
28
|
+
va_list ap;
|
29
|
+
int c;
|
30
|
+
double d;
|
31
|
+
va_start(ap, fmt);
|
32
|
+
while ((c = *fmt++)) {
|
33
|
+
switch (c) {
|
34
|
+
case 'c':
|
35
|
+
case 's':
|
36
|
+
case 'i':
|
37
|
+
*buf++ = va_arg(ap, s32);
|
38
|
+
break;
|
39
|
+
case 'l':
|
40
|
+
*buf++ = va_arg(ap, long);
|
41
|
+
break;
|
42
|
+
case 'j':
|
43
|
+
*buf++ = va_arg(ap, s64);
|
44
|
+
break;
|
45
|
+
case 'f':
|
46
|
+
case 'd':
|
47
|
+
d = va_arg(ap, double);
|
48
|
+
memcpy(buf++, &d, sizeof(d));
|
49
|
+
break;
|
50
|
+
case 'C':
|
51
|
+
case 'S':
|
52
|
+
case 'I':
|
53
|
+
*buf++ = va_arg(ap, u32);
|
54
|
+
break;
|
55
|
+
case 'L':
|
56
|
+
*buf++ = va_arg(ap, unsigned long);
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
va_end(ap);
|
61
|
+
}
|
62
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "ffi"
|
5
|
+
s.version = "1.9.10"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Wayne Meissner"]
|
9
|
+
s.date = "2015-07-01"
|
10
|
+
s.description = "Ruby FFI library"
|
11
|
+
s.email = "wmeissner@gmail.com"
|
12
|
+
s.extensions = ["ext/ffi_c/extconf.rb"]
|
13
|
+
s.files = ["ext/ffi_c/extconf.rb"]
|
14
|
+
s.homepage = "http://wiki.github.com/ffi/ffi"
|
15
|
+
s.licenses = ["BSD"]
|
16
|
+
s.rdoc_options = ["--exclude=ext/ffi_c/.*\\.o$", "--exclude=ffi_c\\.(bundle|so)$"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
19
|
+
s.rubygems_version = "2.0.3"
|
20
|
+
s.summary = "Ruby FFI"
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
s.specification_version = 4
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
26
|
+
s.add_development_dependency(%q<rake>, ["~> 10.1"])
|
27
|
+
s.add_development_dependency(%q<rake-compiler>, ["~> 0.9"])
|
28
|
+
s.add_development_dependency(%q<rake-compiler-dock>, ["~> 0.4.0"])
|
29
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.14.1"])
|
30
|
+
s.add_development_dependency(%q<rubygems-tasks>, ["~> 0.2.4"])
|
31
|
+
else
|
32
|
+
s.add_dependency(%q<rake>, ["~> 10.1"])
|
33
|
+
s.add_dependency(%q<rake-compiler>, ["~> 0.9"])
|
34
|
+
s.add_dependency(%q<rake-compiler-dock>, ["~> 0.4.0"])
|
35
|
+
s.add_dependency(%q<rspec>, ["~> 2.14.1"])
|
36
|
+
s.add_dependency(%q<rubygems-tasks>, ["~> 0.2.4"])
|
37
|
+
end
|
38
|
+
else
|
39
|
+
s.add_dependency(%q<rake>, ["~> 10.1"])
|
40
|
+
s.add_dependency(%q<rake-compiler>, ["~> 0.9"])
|
41
|
+
s.add_dependency(%q<rake-compiler-dock>, ["~> 0.4.0"])
|
42
|
+
s.add_dependency(%q<rspec>, ["~> 2.14.1"])
|
43
|
+
s.add_dependency(%q<rubygems-tasks>, ["~> 0.2.4"])
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
The MIT License
|
2
|
+
Copyright (c) 2012 Frederick Cheung
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
+
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
7
|
+
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
CoreFoundation
|
3
|
+
==============
|
4
|
+
|
5
|
+
FFI based wrappers for a subset of core foundation: various bits of CFString, CFData, CFArray, CFDictionary are available. Not that useful on its own but a useful building block for writing ffi wrappers of other OS X libraries.
|
6
|
+
|
7
|
+
Although the CF collection classes can store arbitrary pointer sized values this wrapper only supports storing CFTypes.
|
8
|
+
|
9
|
+
The CF namespace has the raw FFI generated method calls but it's usually easier to use the wrapper classes: `CF::String`, `CF::Date`, `CF::Array`, `CF::Dictionary`, `CF::Boolean` which try to present a rubyish view of the world (for example `CF::Array` implements `Enumerable`)
|
10
|
+
|
11
|
+
These implement methods for creating new instances from ruby objects (eg `CF::String.from_string("hello world")`) but you can also pass build them from an `FFI::Pointer`).
|
12
|
+
|
13
|
+
Converting
|
14
|
+
===========
|
15
|
+
|
16
|
+
`CF::Base` objects has a `to_ruby` that creates a ruby object of the most approprite type (`String` for `CF::String`, `Time` for `CF::Date`, `Integer` or `Float` for `CF::Number` etc). The collection classes call `to_ruby` on their contents too.
|
17
|
+
|
18
|
+
In addition to the methods on the wrapper classes themselves, the ruby classes are extended with a `to_cf` method. Because CoreFoundation strings aren't arbitrary collections of bytes, `String#to_cf` will return a `CF::Data` if the string has the ASCII-8BIT encoding and a `CF::String` if not.
|
19
|
+
|
20
|
+
If you have an `FFI::Pointer` or a raw address then you can create a wrapper by passing it to `new`, for example `CF::String.new(some_pointer)`. This does *not* check that the pointer is actually a `CFString`. You can use `CF::Base.typecast` to construct an instance of the appropriate subclass, for example `CF::Base.typecast(some_pointer)` would return a `CF::String` if `some_pointer` was in fact a `CFStringRef`.
|
21
|
+
|
22
|
+
Memory Management
|
23
|
+
=================
|
24
|
+
|
25
|
+
The convenience methods for creating CF objects will release the cf object when they are garbage collected. Methods on the convenience classes will usually retain the result and mark it for releasing when they are garbage collected (for example `CF::Dictionary#[]` retains the returned value). You don't need to do any extra memory management on these.
|
26
|
+
|
27
|
+
If you pass an `FFI::Pointer` to `new` or `typecast` no assumptions are made for you. You should call `retain` or `release` to manage it manually. As an alternative to calling `release` manually, the `release_on_gc` method adds a finalizer to the wrapper that will call `CFRelease` on the Core Foundation object when the wrapper is garbage collected. You will almost certainly crash your ruby interpreter if you overrelease an object and you will leak memory if you overretain one.
|
28
|
+
|
29
|
+
If you use the raw api (eg `CF.CFArrayCreate`) then you're on your own.
|
30
|
+
|
31
|
+
|
32
|
+
Compatibility
|
33
|
+
=============
|
34
|
+
|
35
|
+
Should work in MRI 1.8.7 and above and jruby. Not compatible with rubinius due to rubinius' ffi implementation not supporting certain features. On 1.8.7 the `binary?` and `binary!` methods tag a string's binary-ness with a flag, on 1.9 these methods are just shortcuts for testing whether the encoding is Encoding::ASCII_8BIT
|
36
|
+
|
37
|
+
License
|
38
|
+
=======
|
39
|
+
|
40
|
+
Released under the MIT license. See LICENSE
|
@@ -0,0 +1,123 @@
|
|
1
|
+
module CF
|
2
|
+
typedef :pointer, :cfarrayref
|
3
|
+
|
4
|
+
# @private
|
5
|
+
class ArrayCallbacks < FFI::Struct
|
6
|
+
layout :version, :cfindex, #cfindex
|
7
|
+
:retain, :pointer,
|
8
|
+
:release, :pointer,
|
9
|
+
:copyDescription, :pointer,
|
10
|
+
:equal, :pointer
|
11
|
+
end
|
12
|
+
|
13
|
+
attach_variable :kCFTypeArrayCallBacks, ArrayCallbacks
|
14
|
+
attach_function :CFArrayCreate, [:pointer, :pointer, :cfindex, :pointer], :cfarrayref
|
15
|
+
attach_function :CFArrayCreateMutable, [:pointer, :cfindex, :pointer], :cfarrayref
|
16
|
+
attach_function :CFArrayGetValueAtIndex, [:pointer, :cfindex], :pointer
|
17
|
+
attach_function :CFArraySetValueAtIndex, [:pointer, :cfindex, :pointer], :void
|
18
|
+
attach_function :CFArrayAppendValue, [:pointer, :pointer], :void
|
19
|
+
attach_function :CFArrayGetCount, [:pointer], :cfindex
|
20
|
+
|
21
|
+
callback :each_applier, [:pointer, :pointer], :void
|
22
|
+
|
23
|
+
attach_function :CFArrayApplyFunction, [:cfarrayref, CF::Range.by_value, :each_applier, :pointer], :void
|
24
|
+
|
25
|
+
|
26
|
+
# Wrapper class for CFArrayRef. It implements enumberable so you can use a lot of your favourite ruby methods on it.
|
27
|
+
#
|
28
|
+
# Values returned by the accessor methods or yielded by the block are retained and marked as releasable on garbage collection
|
29
|
+
# This means you can safely use the returned values even if the CFArray itself has been destroyed
|
30
|
+
#
|
31
|
+
# Unlike ruby arrays you cannot set arbitary array indexes - You can only set indexes in the range 0..length
|
32
|
+
class Array < Base
|
33
|
+
include Enumerable
|
34
|
+
register_type("CFArray")
|
35
|
+
|
36
|
+
# Whether the array is mutable
|
37
|
+
#
|
38
|
+
# WARNING: this only works for arrays created by CF::Array, there is no public api for telling whether an arbitrary
|
39
|
+
# CFTypeRef is a mutable array or not
|
40
|
+
def mutable?
|
41
|
+
@mutable
|
42
|
+
end
|
43
|
+
|
44
|
+
# Iterates over the array yielding the value to the block
|
45
|
+
# The value is wrapped in the appropriate CF::Base subclass and retained (but marked for releasing upon garbage collection)
|
46
|
+
# @return self
|
47
|
+
def each
|
48
|
+
range = CF::Range.new
|
49
|
+
range[:location] = 0
|
50
|
+
range[:length] = length
|
51
|
+
callback = lambda do |value, _|
|
52
|
+
yield Base.typecast(value).retain.release_on_gc
|
53
|
+
end
|
54
|
+
CF.CFArrayApplyFunction(self, range, callback, nil)
|
55
|
+
self
|
56
|
+
end
|
57
|
+
|
58
|
+
# Creates a new, immutable CFArray from a ruby array of cf objects
|
59
|
+
# @param [Array<CF::Base>] array The objects to place in the array. They must inherit from CF::Base
|
60
|
+
# @return [CF::Array] A CF::Array containing the objects, setup to release the array upon garbage collection
|
61
|
+
def self.immutable(array)
|
62
|
+
if bad_element = array.detect {|value| !value.is_a?(CF::Base)}
|
63
|
+
raise TypeError, "Array contains non cftype #{bad_element.inspect}"
|
64
|
+
end
|
65
|
+
m = FFI::MemoryPointer.new(:pointer, array.length)
|
66
|
+
m.write_array_of_pointer(array)
|
67
|
+
new(CF.CFArrayCreate(nil,m,array.length,CF::kCFTypeArrayCallBacks.to_ptr)).release_on_gc
|
68
|
+
end
|
69
|
+
|
70
|
+
# Creates a new, empty mutable CFArray
|
71
|
+
# @return [CF::Array] A mutable CF::Array containing the objects, setup to release the array upon garbage collection
|
72
|
+
def self.mutable
|
73
|
+
result = new(CF.CFArrayCreateMutable nil, 0, CF::kCFTypeArrayCallBacks.to_ptr).release_on_gc
|
74
|
+
result.instance_variable_set(:@mutable, true)
|
75
|
+
result
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns the object at the index
|
79
|
+
# @param [Integer] index the 0 based index of the item to retrieve. Behaviour is undefined if it is not in the range 0...size
|
80
|
+
# @return [CF::Base] a subclass of CF::Base
|
81
|
+
def [](index)
|
82
|
+
Base.typecast(CF.CFArrayGetValueAtIndex(self, index)).retain.release_on_gc
|
83
|
+
end
|
84
|
+
|
85
|
+
# Sets object at the index
|
86
|
+
# @param [Integer] index the 0 based index of the item to retrieve. Behaviour is undefined if it is not in the range 0..size
|
87
|
+
# It is legal to set the value at index n of a n item array - this is equivalent to appending the object
|
88
|
+
#
|
89
|
+
# @param [CF::Base] value the value to store
|
90
|
+
# @return [CF::Base] the store value
|
91
|
+
def []=(index, value)
|
92
|
+
raise TypeError, "instance is not mutable" unless mutable?
|
93
|
+
self.class.check_cftype(value)
|
94
|
+
CF.CFArraySetValueAtIndex(self, index, value)
|
95
|
+
value
|
96
|
+
end
|
97
|
+
|
98
|
+
# Appends a value to the array
|
99
|
+
#
|
100
|
+
# @return [CF::Array] self
|
101
|
+
def <<(value)
|
102
|
+
raise TypeError, "instance is not mutable" unless mutable?
|
103
|
+
self.class.check_cftype(value)
|
104
|
+
CF.CFArrayAppendValue(self, value)
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
108
|
+
# Returns a ruby array containing the result of calling to_ruby on each of the array's elements
|
109
|
+
#
|
110
|
+
def to_ruby
|
111
|
+
collect(&:to_ruby)
|
112
|
+
end
|
113
|
+
|
114
|
+
alias_method :push, :<<
|
115
|
+
|
116
|
+
# Returns the number of elements the array contains
|
117
|
+
# @return [Integer]
|
118
|
+
def length
|
119
|
+
CF.CFArrayGetCount(self)
|
120
|
+
end
|
121
|
+
alias_method :size, :length
|
122
|
+
end
|
123
|
+
end
|