yakg 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (300) hide show
  1. checksums.yaml +6 -14
  2. data/.gitignore +1 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +27 -19
  5. data/VERSION +1 -1
  6. data/lib/yakg.rb +6 -6
  7. data/spec/spec_helper.rb +1 -3
  8. data/spec/yakg_spec.rb +13 -13
  9. data/vendor/gems/README.md +26 -20
  10. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/COPYING +49 -0
  11. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/LICENSE +24 -0
  12. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/README.md +7 -7
  13. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/Rakefile +31 -41
  14. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/ffi.gemspec +7 -6
  15. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/autopointer.rb +24 -14
  16. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/enum.rb +34 -22
  17. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/errno.rb +43 -0
  18. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/ffi.rb +44 -0
  19. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/io.rb +62 -0
  20. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/library.rb +79 -44
  21. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/managedstruct.rb +29 -0
  22. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/aarch64-linux/types.conf +104 -0
  23. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  24. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  25. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  26. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
  27. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
  28. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/platform.rb +35 -15
  29. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/pointer.rb +22 -10
  30. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/struct.rb +31 -14
  31. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/struct_layout_builder.rb +46 -30
  32. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/types.rb +24 -11
  33. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/union.rb +43 -0
  34. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/variadic.rb +78 -0
  35. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi/version.rb +4 -0
  36. data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi.rb +1 -9
  37. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/lib/ffi_c.bundle +0 -0
  38. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/Benchmark.c +52 -0
  39. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/BoolTest.c +34 -0
  40. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/BufferTest.c +31 -0
  41. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/ClosureTest.c +205 -0
  42. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/EnumTest.c +51 -0
  43. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/FunctionTest.c +70 -0
  44. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/GNUmakefile +149 -0
  45. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/GlobalVariable.c +62 -0
  46. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/LastErrorTest.c +21 -0
  47. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/NumberTest.c +132 -0
  48. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/PointerTest.c +63 -0
  49. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/ReferenceTest.c +23 -0
  50. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/StringTest.c +34 -0
  51. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/StructTest.c +243 -0
  52. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/UnionTest.c +43 -0
  53. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.10/libtest/VariadicTest.c +62 -0
  54. data/vendor/gems/ruby/2.0.0/specifications/ffi-1.9.10.gemspec +45 -0
  55. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/CHANGELOG +12 -0
  56. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/LICENSE +8 -0
  57. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/README.md +40 -0
  58. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/array.rb +123 -0
  59. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/base.rb +197 -0
  60. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb +25 -0
  61. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/data.rb +42 -0
  62. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/date.rb +32 -0
  63. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/dictionary.rb +114 -0
  64. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/extensions.rb +158 -0
  65. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/null.rb +11 -0
  66. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/number.rb +98 -0
  67. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/string.rb +91 -0
  68. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation/version.rb +4 -0
  69. data/vendor/gems/ruby/2.1.0/gems/corefoundation-0.2.0/lib/corefoundation.rb +13 -0
  70. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/COPYING +49 -0
  71. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/LICENSE +24 -0
  72. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/README.md +109 -0
  73. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/Rakefile +210 -0
  74. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/ffi.gemspec +23 -0
  75. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/gen/Rakefile +30 -0
  76. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/autopointer.rb +194 -0
  77. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/buffer.rb +4 -0
  78. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/callback.rb +4 -0
  79. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/enum.rb +174 -0
  80. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/errno.rb +43 -0
  81. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/ffi.rb +44 -0
  82. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/io.rb +62 -0
  83. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/library.rb +524 -0
  84. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/managedstruct.rb +84 -0
  85. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/memorypointer.rb +1 -0
  86. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/aarch64-linux/types.conf +104 -0
  87. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/arm-linux/types.conf +104 -0
  88. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  89. 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
  90. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  91. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-gnu/types.conf +107 -0
  92. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-linux/types.conf +103 -0
  93. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-openbsd/types.conf +128 -0
  94. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-solaris/types.conf +122 -0
  95. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/i386-windows/types.conf +105 -0
  96. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/ia64-linux/types.conf +104 -0
  97. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/mips-linux/types.conf +102 -0
  98. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  99. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  100. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-aix/types.conf +180 -0
  101. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
  102. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  103. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  104. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/s390-linux/types.conf +102 -0
  105. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/s390x-linux/types.conf +102 -0
  106. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-linux/types.conf +102 -0
  107. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-solaris/types.conf +128 -0
  108. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
  109. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  110. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
  111. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
  112. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-linux/types.conf +102 -0
  113. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
  114. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
  115. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
  116. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-windows/types.conf +27 -0
  117. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/platform.rb +159 -0
  118. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/pointer.rb +134 -0
  119. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/struct.rb +373 -0
  120. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/struct_layout_builder.rb +227 -0
  121. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/const_generator.rb +229 -0
  122. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/generator.rb +60 -0
  123. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/generator_task.rb +36 -0
  124. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/struct_generator.rb +194 -0
  125. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/tools/types_generator.rb +135 -0
  126. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/types.rb +190 -0
  127. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/union.rb +43 -0
  128. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/variadic.rb +78 -0
  129. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi/version.rb +4 -0
  130. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi.rb +20 -0
  131. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/lib/ffi_c.bundle +0 -0
  132. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/Benchmark.c +52 -0
  133. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/BoolTest.c +34 -0
  134. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/BufferTest.c +31 -0
  135. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/ClosureTest.c +205 -0
  136. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/EnumTest.c +51 -0
  137. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/FunctionTest.c +70 -0
  138. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/GNUmakefile +149 -0
  139. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/GlobalVariable.c +62 -0
  140. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/LastErrorTest.c +21 -0
  141. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/NumberTest.c +132 -0
  142. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/PointerTest.c +63 -0
  143. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/ReferenceTest.c +23 -0
  144. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/StringTest.c +34 -0
  145. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/StructTest.c +243 -0
  146. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/UnionTest.c +43 -0
  147. data/vendor/gems/ruby/2.1.0/gems/ffi-1.9.10/libtest/VariadicTest.c +62 -0
  148. data/vendor/gems/ruby/2.1.0/specifications/corefoundation-0.2.0.gemspec +45 -0
  149. data/vendor/gems/ruby/2.1.0/specifications/ffi-1.9.10.gemspec +49 -0
  150. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/CHANGELOG +12 -0
  151. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/LICENSE +8 -0
  152. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/README.md +40 -0
  153. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/array.rb +123 -0
  154. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/base.rb +197 -0
  155. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/boolean.rb +25 -0
  156. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/data.rb +42 -0
  157. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/date.rb +32 -0
  158. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/dictionary.rb +114 -0
  159. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/extensions.rb +158 -0
  160. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/null.rb +11 -0
  161. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/number.rb +98 -0
  162. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/string.rb +91 -0
  163. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation/version.rb +4 -0
  164. data/vendor/gems/ruby/2.2.0/gems/corefoundation-0.2.0/lib/corefoundation.rb +13 -0
  165. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/COPYING +49 -0
  166. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/LICENSE +24 -0
  167. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/README.md +109 -0
  168. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/Rakefile +210 -0
  169. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/ffi.gemspec +23 -0
  170. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/gen/Rakefile +30 -0
  171. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/autopointer.rb +194 -0
  172. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/buffer.rb +4 -0
  173. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/callback.rb +4 -0
  174. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/enum.rb +174 -0
  175. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/errno.rb +43 -0
  176. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/ffi.rb +44 -0
  177. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/io.rb +62 -0
  178. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/library.rb +524 -0
  179. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/managedstruct.rb +84 -0
  180. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/memorypointer.rb +1 -0
  181. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/aarch64-linux/types.conf +104 -0
  182. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/arm-linux/types.conf +104 -0
  183. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-cygwin/types.conf +3 -0
  184. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-darwin/types.conf +100 -0
  185. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  186. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-gnu/types.conf +107 -0
  187. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-linux/types.conf +103 -0
  188. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-netbsd/types.conf +126 -0
  189. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-openbsd/types.conf +128 -0
  190. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-solaris/types.conf +122 -0
  191. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/i386-windows/types.conf +105 -0
  192. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/ia64-linux/types.conf +104 -0
  193. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/mips-linux/types.conf +102 -0
  194. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/mips64el-linux/types.conf +104 -0
  195. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  196. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-aix/types.conf +180 -0
  197. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
  198. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  199. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
  200. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/s390-linux/types.conf +102 -0
  201. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/s390x-linux/types.conf +102 -0
  202. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-linux/types.conf +102 -0
  203. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/sparc-solaris/types.conf +128 -0
  204. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
  205. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
  206. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
  207. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
  208. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-linux/types.conf +102 -0
  209. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
  210. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
  211. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
  212. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform/x86_64-windows/types.conf +27 -0
  213. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/platform.rb +159 -0
  214. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/pointer.rb +134 -0
  215. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/struct.rb +373 -0
  216. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/struct_layout_builder.rb +227 -0
  217. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/const_generator.rb +229 -0
  218. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/generator.rb +60 -0
  219. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/generator_task.rb +36 -0
  220. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/struct_generator.rb +194 -0
  221. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/tools/types_generator.rb +135 -0
  222. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/types.rb +190 -0
  223. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/union.rb +43 -0
  224. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/variadic.rb +78 -0
  225. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi/version.rb +4 -0
  226. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi.rb +20 -0
  227. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/lib/ffi_c.bundle +0 -0
  228. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/Benchmark.c +52 -0
  229. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/BoolTest.c +34 -0
  230. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/BufferTest.c +31 -0
  231. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/ClosureTest.c +205 -0
  232. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/EnumTest.c +51 -0
  233. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/FunctionTest.c +70 -0
  234. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/GNUmakefile +149 -0
  235. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/GlobalVariable.c +62 -0
  236. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/LastErrorTest.c +21 -0
  237. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/NumberTest.c +132 -0
  238. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/PointerTest.c +63 -0
  239. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/ReferenceTest.c +23 -0
  240. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/StringTest.c +34 -0
  241. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/StructTest.c +243 -0
  242. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/UnionTest.c +43 -0
  243. data/vendor/gems/ruby/2.2.0/gems/ffi-1.9.10/libtest/VariadicTest.c +62 -0
  244. data/vendor/gems/ruby/2.2.0/specifications/corefoundation-0.2.0.gemspec +45 -0
  245. data/vendor/gems/ruby/2.2.0/specifications/ffi-1.9.10.gemspec +49 -0
  246. data/yakg.gemspec +3 -3
  247. metadata +288 -83
  248. data/vendor/gems/Gemfile +0 -4
  249. data/vendor/gems/Gemfile.lock +0 -13
  250. data/vendor/gems/installit.sh +0 -65
  251. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/COPYING +0 -674
  252. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/COPYING.LESSER +0 -165
  253. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/History.txt +0 -1
  254. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/LICENSE +0 -14
  255. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/gen/log +0 -1
  256. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/errno.rb +0 -33
  257. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/ffi.iml +0 -11
  258. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/ffi.rb +0 -33
  259. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/io.rb +0 -52
  260. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/union.rb +0 -32
  261. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/variadic.rb +0 -65
  262. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/version.rb +0 -4
  263. data/vendor/gems/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi_c.bundle +0 -0
  264. data/vendor/gems/ruby/2.0.0/specifications/ffi-1.9.0.gemspec +0 -42
  265. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/gen/Rakefile +0 -0
  266. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/buffer.rb +0 -0
  267. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/callback.rb +0 -0
  268. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/memorypointer.rb +0 -0
  269. /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
  270. /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
  271. /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
  272. /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
  273. /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
  274. /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
  275. /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
  276. /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
  277. /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
  278. /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
  279. /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
  280. /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
  281. /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
  282. /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
  283. /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
  284. /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
  285. /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
  286. /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
  287. /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
  288. /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
  289. /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
  290. /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
  291. /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
  292. /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
  293. /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
  294. /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
  295. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/const_generator.rb +0 -0
  296. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/generator.rb +0 -0
  297. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/generator_task.rb +0 -0
  298. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/struct_generator.rb +0 -0
  299. /data/vendor/gems/ruby/2.0.0/gems/{ffi-1.9.0 → ffi-1.9.10}/lib/ffi/tools/types_generator.rb +0 -0
  300. /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,210 @@
1
+ require 'rubygems/tasks'
2
+ require 'rbconfig'
3
+ require 'rake/clean'
4
+ require File.expand_path("./lib/ffi/version")
5
+
6
+ USE_RAKE_COMPILER = (RUBY_PLATFORM =~ /java/) ? false : true
7
+ if USE_RAKE_COMPILER
8
+ require 'rake/extensiontask'
9
+ end
10
+
11
+ require 'date'
12
+ require 'fileutils'
13
+ require 'rbconfig'
14
+ require 'rspec/core/rake_task'
15
+ require 'rubygems/package_task'
16
+
17
+ LIBEXT = case RbConfig::CONFIG['host_os'].downcase
18
+ when /darwin/
19
+ "dylib"
20
+ when /mswin|mingw/
21
+ "dll"
22
+ else
23
+ RbConfig::CONFIG['DLEXT']
24
+ end
25
+
26
+ CPU = case RbConfig::CONFIG['host_cpu'].downcase
27
+ when /i[3456]86/
28
+ # Darwin always reports i686, even when running in 64bit mode
29
+ if RbConfig::CONFIG['host_os'] =~ /darwin/ && 0xfee1deadbeef.is_a?(Fixnum)
30
+ "x86_64"
31
+ else
32
+ "i386"
33
+ end
34
+
35
+ when /amd64|x86_64/
36
+ "x86_64"
37
+
38
+ when /ppc64|powerpc64/
39
+ "powerpc64"
40
+
41
+ when /ppc|powerpc/
42
+ "powerpc"
43
+
44
+ when /^arm/
45
+ "arm"
46
+
47
+ else
48
+ RbConfig::CONFIG['host_cpu']
49
+ end
50
+
51
+ OS = case RbConfig::CONFIG['host_os'].downcase
52
+ when /linux/
53
+ "linux"
54
+ when /darwin/
55
+ "darwin"
56
+ when /freebsd/
57
+ "freebsd"
58
+ when /openbsd/
59
+ "openbsd"
60
+ when /sunos|solaris/
61
+ "solaris"
62
+ when /mswin|mingw/
63
+ "win32"
64
+ else
65
+ RbConfig::CONFIG['host_os'].downcase
66
+ end
67
+
68
+ GMAKE = system('which gmake >/dev/null') && 'gmake' || 'make'
69
+
70
+ LIBTEST = "build/libtest.#{LIBEXT}"
71
+ BUILD_DIR = "build"
72
+ BUILD_EXT_DIR = File.join(BUILD_DIR, "#{RbConfig::CONFIG['arch']}", 'ffi_c', RUBY_VERSION)
73
+
74
+ def gem_spec
75
+ @gem_spec ||= Gem::Specification.load('ffi.gemspec')
76
+ end
77
+
78
+ TEST_DEPS = [ LIBTEST ]
79
+ if RUBY_PLATFORM == "java"
80
+ RSpec::Core::RakeTask.new(:spec) do |config|
81
+ config.rspec_opts = YAML.load_file 'spec/spec.opts'
82
+ end
83
+ else
84
+ RSpec::Core::RakeTask.new(:spec => :compile) do |config|
85
+ config.rspec_opts = YAML.load_file 'spec/spec.opts'
86
+ end
87
+
88
+ TEST_DEPS.unshift :compile
89
+ end
90
+
91
+ desc "Build all packages"
92
+ task :package => 'gem:package'
93
+
94
+ CLOBBER.include 'lib/ffi/types.conf'
95
+ CLOBBER.include 'pkg'
96
+
97
+ CLEAN.include 'build'
98
+ CLEAN.include 'conftest.dSYM'
99
+ CLEAN.include 'spec/ffi/fixtures/libtest.{dylib,so,dll}'
100
+ CLEAN.include 'spec/ffi/fixtures/*.o'
101
+ CLEAN.include "pkg/ffi-#{FFI::VERSION}-*-mingw32"
102
+ CLEAN.include "pkg/ffi-#{FFI::VERSION}-java"
103
+ CLEAN.include 'lib/1.*'
104
+ CLEAN.include 'lib/2.*'
105
+ CLEAN.include 'bin'
106
+
107
+ task :distclean => :clobber
108
+
109
+ desc "Build the native test lib"
110
+ file "build/libtest.#{LIBEXT}" => FileList['libtest/**/*.[ch]'] do
111
+ sh %{#{GMAKE} -f libtest/GNUmakefile CPU=#{CPU} OS=#{OS} }
112
+ end
113
+
114
+
115
+ desc "Build test helper lib"
116
+ task :libtest => "build/libtest.#{LIBEXT}"
117
+
118
+ desc "Test the extension"
119
+ task :test => [ :spec ]
120
+
121
+
122
+ namespace :bench do
123
+ ITER = ENV['ITER'] ? ENV['ITER'].to_i : 100000
124
+ bench_libs = "-Ilib -I#{BUILD_DIR}" unless RUBY_PLATFORM == "java"
125
+ bench_files = Dir["bench/bench_*.rb"].reject { |f| f == "bench_helper.rb" }
126
+ bench_files.each do |bench|
127
+ task File.basename(bench, ".rb")[6..-1] => TEST_DEPS do
128
+ sh %{#{Gem.ruby} #{bench_libs} #{bench} #{ITER}}
129
+ end
130
+ end
131
+ task :all => TEST_DEPS do
132
+ bench_files.each do |bench|
133
+ sh %{#{Gem.ruby} #{bench_libs} #{bench}}
134
+ end
135
+ end
136
+ end
137
+
138
+ task 'spec:run' => TEST_DEPS
139
+ task 'spec:specdoc' => TEST_DEPS
140
+
141
+ task :default => :specs
142
+
143
+ namespace 'java' do
144
+
145
+ java_gem_spec = Gem::Specification.new do |s|
146
+ s.name = gem_spec.name
147
+ s.version = gem_spec.version
148
+ s.author = gem_spec.author
149
+ s.email = gem_spec.email
150
+ s.homepage = gem_spec.homepage
151
+ s.summary = gem_spec.summary
152
+ s.description = gem_spec.description
153
+ s.files = %w(LICENSE COPYING README.md Rakefile)
154
+ s.has_rdoc = false
155
+ s.license = gem_spec.license
156
+ s.platform = 'java'
157
+ end
158
+
159
+ Gem::PackageTask.new(java_gem_spec) do |pkg|
160
+ pkg.need_zip = true
161
+ pkg.need_tar = true
162
+ pkg.package_dir = 'pkg'
163
+ end
164
+ end
165
+
166
+ task 'gem:java' => 'java:gem'
167
+
168
+
169
+ if USE_RAKE_COMPILER
170
+ Rake::ExtensionTask.new('ffi_c', gem_spec) do |ext|
171
+ ext.name = 'ffi_c' # indicate the name of the extension.
172
+ # ext.lib_dir = BUILD_DIR # put binaries into this folder.
173
+ ext.tmp_dir = BUILD_DIR # temporary folder used during compilation.
174
+ ext.cross_compile = true # enable cross compilation (requires cross compile toolchain)
175
+ ext.cross_platform = %w[i386-mingw32 x64-mingw32] # forces the Windows platform instead of the default one
176
+ end
177
+
178
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0:2.1.5:2.2.1'
179
+
180
+ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
181
+ task "copy:ffi_c:i386-mingw32:#{ruby_version}" do |t|
182
+ sh "i686-w64-mingw32-strip -S #{BUILD_DIR}/i386-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
183
+ end
184
+
185
+ task "copy:ffi_c:x64-mingw32:#{ruby_version}" do |t|
186
+ sh "x86_64-w64-mingw32-strip -S #{BUILD_DIR}/x64-mingw32/stage/lib/#{ruby_version[/^\d+\.\d+/]}/ffi_c.so"
187
+ end
188
+ end
189
+
190
+ desc "build a windows gem without all the ceremony."
191
+ task "gem:windows" do
192
+ require "rake_compiler_dock"
193
+ RakeCompilerDock.sh "bundle && rake cross native gem MAKE='nice make -j`nproc`'"
194
+ end
195
+ end
196
+
197
+ Gem::Tasks.new do |t|
198
+ t.scm.tag.format = '%s'
199
+ end
200
+
201
+ begin
202
+ require 'yard'
203
+
204
+ namespace :doc do
205
+ YARD::Rake::YardocTask.new do |yard|
206
+ end
207
+ end
208
+ rescue LoadError
209
+ warn "[warn] YARD unavailable"
210
+ end
@@ -0,0 +1,23 @@
1
+ require File.expand_path("../lib/#{File.basename(__FILE__, '.gemspec')}/version", __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'ffi'
5
+ s.version = FFI::VERSION
6
+ s.author = 'Wayne Meissner'
7
+ s.email = 'wmeissner@gmail.com'
8
+ s.homepage = 'http://wiki.github.com/ffi/ffi'
9
+ s.summary = 'Ruby FFI'
10
+ s.description = 'Ruby FFI library'
11
+ s.files = %w(ffi.gemspec LICENSE COPYING README.md Rakefile) + Dir.glob("{ext,gen,lib,spec,libtest}/**/*").reject { |f| f =~ /(lib\/[12]\.[089]|\.s?[ao]$|\.bundle|\.dylib$)/ }
12
+ s.extensions << 'ext/ffi_c/extconf.rb'
13
+ s.has_rdoc = false
14
+ s.rdoc_options = %w[--exclude=ext/ffi_c/.*\.o$ --exclude=ffi_c\.(bundle|so)$]
15
+ s.license = 'BSD'
16
+ s.require_paths << 'ext/ffi_c'
17
+ s.required_ruby_version = '>= 1.8.7'
18
+ s.add_development_dependency 'rake', '~> 10.1'
19
+ s.add_development_dependency 'rake-compiler', '~> 0.9'
20
+ s.add_development_dependency 'rake-compiler-dock', '~> 0.4.0'
21
+ s.add_development_dependency 'rspec', '~> 2.14.1'
22
+ s.add_development_dependency 'rubygems-tasks', "~> 0.2.4"
23
+ end
@@ -0,0 +1,30 @@
1
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
2
+ require 'fileutils'
3
+ require 'ffi'
4
+ require 'ffi/platform'
5
+ require 'ffi/tools/types_generator'
6
+ types_conf = File.expand_path(File.join(FFI::Platform::CONF_DIR, 'types.conf'))
7
+
8
+ logfile = File.join(File.dirname(__FILE__), 'log')
9
+
10
+ file types_conf do |task|
11
+ options = {}
12
+ FileUtils.mkdir_p(File.dirname(task.name), { :mode => 0755 })
13
+ File.open(task.name, File::CREAT|File::TRUNC|File::RDWR, 0644) do |f|
14
+ f.puts FFI::TypesGenerator.generate(options)
15
+ end
16
+ File.open(logfile, 'w') do |log|
17
+ log.puts(types_conf)
18
+ end
19
+ end
20
+
21
+ task :default => types_conf do
22
+ end
23
+
24
+ task :clean do
25
+ File.readlines(logfile).each do |file|
26
+ file.strip!
27
+ rm_f file
28
+ end
29
+ rm_f logfile
30
+ end
@@ -0,0 +1,194 @@
1
+ #
2
+ # Copyright (C) 2008-2010 Wayne Meissner
3
+ # Copyright (C) 2008 Mike Dalessio
4
+ #
5
+ # This file is part of ruby-ffi.
6
+ #
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
+ #
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
+ #
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.
31
+
32
+ module FFI
33
+ class AutoPointer < Pointer
34
+ extend DataConverter
35
+
36
+ # @overload initialize(pointer, method)
37
+ # @param [Pointer] pointer
38
+ # @param [Method] method
39
+ # @return [self]
40
+ # The passed Method will be invoked at GC time.
41
+ # @overload initialize(pointer, proc)
42
+ # @param [Pointer] pointer
43
+ # @return [self]
44
+ # The passed Proc will be invoked at GC time (SEE WARNING BELOW!)
45
+ # @note WARNING: passing a proc _may_ cause your pointer to never be GC'd, unless you're
46
+ # careful to avoid trapping a reference to the pointer in the proc. See the test
47
+ # specs for examples.
48
+ # @overload initialize(pointer) { |p| ... }
49
+ # @param [Pointer] pointer
50
+ # @yieldparam [Pointer] p +pointer+ passed to the block
51
+ # @return [self]
52
+ # The passed block will be invoked at GC time.
53
+ # @note WARNING: passing a block will cause your pointer to never be GC'd. This is bad.
54
+ # @overload initialize(pointer)
55
+ # @param [Pointer] pointer
56
+ # @return [self]
57
+ # The pointer's release() class method will be invoked at GC time.
58
+ #
59
+ # @note The safest, and therefore preferred, calling
60
+ # idiom is to pass a Method as the second parameter. Example usage:
61
+ #
62
+ # class PointerHelper
63
+ # def self.release(pointer)
64
+ # ...
65
+ # end
66
+ # end
67
+ #
68
+ # p = AutoPointer.new(other_pointer, PointerHelper.method(:release))
69
+ #
70
+ # The above code will cause PointerHelper#release to be invoked at GC time.
71
+ #
72
+ # @note
73
+ # The last calling idiom (only one parameter) is generally only
74
+ # going to be useful if you subclass {AutoPointer}, and override
75
+ # #release, which by default does nothing.
76
+ def initialize(ptr, proc=nil, &block)
77
+ super(ptr.type_size, ptr)
78
+ raise TypeError, "Invalid pointer" if ptr.nil? || !ptr.kind_of?(Pointer) \
79
+ || ptr.kind_of?(MemoryPointer) || ptr.kind_of?(AutoPointer)
80
+
81
+ @releaser = if proc
82
+ raise RuntimeError.new("proc must be callable") unless proc.respond_to?(:call)
83
+ CallableReleaser.new(ptr, proc)
84
+
85
+ else
86
+ raise RuntimeError.new("no release method defined") unless self.class.respond_to?(:release)
87
+ DefaultReleaser.new(ptr, self.class)
88
+ end
89
+
90
+ ObjectSpace.define_finalizer(self, @releaser)
91
+ self
92
+ end
93
+
94
+ # @return [nil]
95
+ # Free the pointer.
96
+ def free
97
+ @releaser.free
98
+ end
99
+
100
+ # @param [Boolean] autorelease
101
+ # @return [Boolean] +autorelease+
102
+ # Set +autorelease+ property. See {Pointer Autorelease section at Pointer}.
103
+ def autorelease=(autorelease)
104
+ @releaser.autorelease=(autorelease)
105
+ end
106
+
107
+ # @return [Boolean] +autorelease+
108
+ # Get +autorelease+ property. See {Pointer Autorelease section at Pointer}.
109
+ def autorelease?
110
+ @releaser.autorelease
111
+ end
112
+
113
+ # @abstract Base class for {AutoPointer}'s releasers.
114
+ #
115
+ # All subclasses of Releaser should define a +#release(ptr)+ method.
116
+ # A releaser is an object in charge of release an {AutoPointer}.
117
+ class Releaser
118
+ attr_accessor :autorelease
119
+
120
+ # @param [Pointer] ptr
121
+ # @param [#call] proc
122
+ # @return [nil]
123
+ # A new instance of Releaser.
124
+ def initialize(ptr, proc)
125
+ @ptr = ptr
126
+ @proc = proc
127
+ @autorelease = true
128
+ end
129
+
130
+ # @return [nil]
131
+ # Free pointer.
132
+ def free
133
+ if @ptr
134
+ release(@ptr)
135
+ @autorelease = false
136
+ @ptr = nil
137
+ @proc = nil
138
+ end
139
+ end
140
+
141
+ # @param args
142
+ # Release pointer if +autorelease+ is set.
143
+ def call(*args)
144
+ release(@ptr) if @autorelease && @ptr
145
+ end
146
+
147
+ end
148
+
149
+ # DefaultReleaser is a {Releaser} used when an {AutoPointer} is defined without Proc
150
+ # or Method. In this case, the pointer to release must be of a class derived from
151
+ # AutoPointer with a +#release+ class method.
152
+ class DefaultReleaser < Releaser
153
+ # @param [Pointer] ptr
154
+ # @return [nil]
155
+ # Release +ptr+ by using his #release class method.
156
+ def release(ptr)
157
+ @proc.release(ptr)
158
+ end
159
+ end
160
+
161
+ # CallableReleaser is a {Releaser} used when an {AutoPointer} is defined with a
162
+ # Proc or a Method.
163
+ class CallableReleaser < Releaser
164
+ # Release +ptr+ by using Proc or Method defined at +ptr+ {AutoPointer#initialize initialization}.
165
+ # @param [Pointer] ptr
166
+ # @return [nil]
167
+ def release(ptr)
168
+ @proc.call(ptr)
169
+ end
170
+ end
171
+
172
+ # Return native type of AutoPointer.
173
+ #
174
+ # Override {DataConverter#native_type}.
175
+ # @return [Type::POINTER]
176
+ # @raise {RuntimeError} if class does not implement a +#release+ method
177
+ def self.native_type
178
+ raise RuntimeError.new("no release method defined for #{self.inspect}") unless self.respond_to?(:release)
179
+ Type::POINTER
180
+ end
181
+
182
+ # Create a new AutoPointer.
183
+ #
184
+ # Override {DataConverter#from_native}.
185
+ # @overload self.from_native(ptr, ctx)
186
+ # @param [Pointer] ptr
187
+ # @param ctx not used. Please set +nil+.
188
+ # @return [AutoPointer]
189
+ def self.from_native(val, ctx)
190
+ self.new(val)
191
+ end
192
+ end
193
+
194
+ end
@@ -0,0 +1,4 @@
1
+ #
2
+ # All the code from this file is now implemented in C. This file remains
3
+ # to satisfy any leftover require 'ffi/buffer' in user code
4
+ #
@@ -0,0 +1,4 @@
1
+ #
2
+ # All the code from this file is now implemented in C. This file remains
3
+ # to satisfy any leftover require 'ffi/callback' in user code
4
+ #
@@ -0,0 +1,174 @@
1
+ #
2
+ # Copyright (C) 2009, 2010 Wayne Meissner
3
+ # Copyright (C) 2009 Luc Heinrich
4
+ #
5
+ # This file is part of ruby-ffi.
6
+ #
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
+ #
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
+ #
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.
31
+ #
32
+
33
+ module FFI
34
+
35
+ # An instance of this class permits to manage {Enum}s. In fact, Enums is a collection of {Enum}s.
36
+ class Enums
37
+
38
+ # @return [nil]
39
+ def initialize
40
+ @all_enums = Array.new
41
+ @tagged_enums = Hash.new
42
+ @symbol_map = Hash.new
43
+ end
44
+
45
+ # @param [Enum] enum
46
+ # Add an {Enum} to the collection.
47
+ def <<(enum)
48
+ @all_enums << enum
49
+ @tagged_enums[enum.tag] = enum unless enum.tag.nil?
50
+ @symbol_map.merge!(enum.symbol_map)
51
+ end
52
+
53
+ # @param query enum tag or part of an enum name
54
+ # @return [Enum]
55
+ # Find a {Enum} in collection.
56
+ def find(query)
57
+ if @tagged_enums.has_key?(query)
58
+ @tagged_enums[query]
59
+ else
60
+ @all_enums.detect { |enum| enum.symbols.include?(query) }
61
+ end
62
+ end
63
+
64
+ # @param symbol a symbol to find in merge symbol maps of all enums.
65
+ # @return a symbol
66
+ def __map_symbol(symbol)
67
+ @symbol_map[symbol]
68
+ end
69
+
70
+ end
71
+
72
+ # Represents a C enum.
73
+ #
74
+ # For a C enum:
75
+ # enum fruits {
76
+ # apple,
77
+ # banana,
78
+ # orange,
79
+ # pineapple
80
+ # };
81
+ # are defined this vocabulary:
82
+ # * a _symbol_ is a word from the enumeration (ie. _apple_, by example);
83
+ # * a _value_ is the value of a symbol in the enumeration (by example, apple has value _0_ and banana _1_).
84
+ class Enum
85
+ include DataConverter
86
+
87
+ attr_reader :tag
88
+ attr_reader :native_type
89
+
90
+ # @overload initialize(info, tag=nil)
91
+ # @param [nil, Enumerable] info
92
+ # @param [nil, Symbol] tag enum tag
93
+ # @overload initialize(native_type, info, tag=nil)
94
+ # @param [FFI::Type] native_type Native type for new Enum
95
+ # @param [nil, Enumerable] info symbols and values for new Enum
96
+ # @param [nil, Symbol] tag name of new Enum
97
+ def initialize(*args)
98
+ @native_type = args.first.kind_of?(FFI::Type) ? args.shift : Type::INT
99
+ info, @tag = *args
100
+ @kv_map = Hash.new
101
+ unless info.nil?
102
+ last_cst = nil
103
+ value = 0
104
+ info.each do |i|
105
+ case i
106
+ when Symbol
107
+ raise ArgumentError, "duplicate enum key" if @kv_map.has_key?(i)
108
+ @kv_map[i] = value
109
+ last_cst = i
110
+ value += 1
111
+ when Integer
112
+ @kv_map[last_cst] = i
113
+ value = i+1
114
+ end
115
+ end
116
+ end
117
+ @vk_map = @kv_map.invert
118
+ end
119
+
120
+ # @return [Array] enum symbol names
121
+ def symbols
122
+ @kv_map.keys
123
+ end
124
+
125
+ # Get a symbol or a value from the enum.
126
+ # @overload [](query)
127
+ # Get enum value from symbol.
128
+ # @param [Symbol] query
129
+ # @return [Integer]
130
+ # @overload [](query)
131
+ # Get enum symbol from value.
132
+ # @param [Integer] query
133
+ # @return [Symbol]
134
+ def [](query)
135
+ case query
136
+ when Symbol
137
+ @kv_map[query]
138
+ when Integer
139
+ @vk_map[query]
140
+ end
141
+ end
142
+ alias find []
143
+
144
+ # Get the symbol map.
145
+ # @return [Hash]
146
+ def symbol_map
147
+ @kv_map
148
+ end
149
+
150
+ alias to_h symbol_map
151
+ alias to_hash symbol_map
152
+
153
+ # @param [Symbol, Integer, #to_int] val
154
+ # @param ctx unused
155
+ # @return [Integer] value of a enum symbol
156
+ def to_native(val, ctx)
157
+ @kv_map[val] || if val.is_a?(Integer)
158
+ val
159
+ elsif val.respond_to?(:to_int)
160
+ val.to_int
161
+ else
162
+ raise ArgumentError, "invalid enum value, #{val.inspect}"
163
+ end
164
+ end
165
+
166
+ # @param val
167
+ # @return symbol name if it exists for +val+.
168
+ def from_native(val, ctx)
169
+ @vk_map[val] || val
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -0,0 +1,43 @@
1
+ #
2
+ # Copyright (C) 2008-2010 Wayne Meissner
3
+ #
4
+ # This file is part of ruby-ffi.
5
+ #
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:
10
+ #
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
+ #
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.#
30
+
31
+ module FFI
32
+ # @return (see FFI::LastError.error)
33
+ # @see FFI::LastError.error
34
+ def self.errno
35
+ FFI::LastError.error
36
+ end
37
+ # @param error (see FFI::LastError.error=)
38
+ # @return (see FFI::LastError.error=)
39
+ # @see FFI::LastError.error=
40
+ def self.errno=(error)
41
+ FFI::LastError.error = error
42
+ end
43
+ end