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,52 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. All rights reserved.
3
+ *
4
+ * For licensing, see LICENSE.SPECS
5
+ */
6
+ #include <sys/types.h>
7
+ #include <stdint.h>
8
+
9
+ void returnVoid() {
10
+
11
+ }
12
+
13
+ void returnVoidI(int arg) {
14
+
15
+ }
16
+ int returnInt() {
17
+ return 0;
18
+ }
19
+
20
+ int returnIntI(int arg) {
21
+ return arg;
22
+ }
23
+
24
+ typedef int8_t s8;
25
+ typedef uint8_t u8;
26
+ typedef int16_t s16;
27
+ typedef uint16_t u16;
28
+ typedef int32_t s32;
29
+ typedef uint32_t u32;
30
+ typedef int64_t s64;
31
+ typedef uint64_t u64;
32
+ typedef float f32;
33
+ typedef double f64;
34
+ typedef void v;
35
+ typedef char* S;
36
+ typedef void* P;
37
+
38
+ #define B6(R, T1, T2, T3, T4, T5, T6) R bench_##T1##T2##T3##T4##T5##T6##_##R(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6) {}
39
+ #define B5(R, T1, T2, T3, T4, T5) R bench_##T1##T2##T3##T4##T5##_##R(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) {}
40
+ #define B4(R, T1, T2, T3, T4) R bench_##T1##T2##T3##T4##_##R(T1 a1, T2 a2, T3 a3, T4 a4) {}
41
+ #define B3(R, T1, T2, T3) R bench_##T1##T2##T3##_##R(T1 a1, T2 a2, T3 a3) {}
42
+ #define B2(R, T1, T2) R bench_##T1##T2##_##R(T1 a1, T2 a2) {}
43
+ #define B1(R, T1) R bench_##T1##_##R(T1 a1) {}
44
+ #define BrV(T) B1(v, T); B2(v, T, T); B3(v, T, T, T); B4(v, T, T, T, T); B5(v, T, T, T, T, T); B6(v, T, T, T, T, T, T);
45
+ BrV(u32);
46
+ BrV(s32);
47
+ BrV(s64);
48
+ BrV(u64);
49
+ BrV(f32);
50
+ BrV(f64);
51
+ BrV(S);
52
+ BrV(P);
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner.
3
+ * Copyright (c) 2009 Aman Gupta.
4
+ *
5
+ * All rights reserved.
6
+ *
7
+ * For licensing, see LICENSE.SPECS
8
+ */
9
+
10
+ #include <stdbool.h>
11
+
12
+ bool
13
+ bool_return_true()
14
+ {
15
+ return true;
16
+ }
17
+
18
+ bool
19
+ bool_return_false()
20
+ {
21
+ return false;
22
+ }
23
+
24
+ bool
25
+ bool_return_val(bool value)
26
+ {
27
+ return value;
28
+ }
29
+
30
+ bool
31
+ bool_reverse_val(bool value)
32
+ {
33
+ return value ? false : true;
34
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. All rights reserved.
3
+ *
4
+ * For licensing, see LICENSE.SPECS
5
+ */
6
+
7
+
8
+ #define MEMSET(buf, value, size) do { \
9
+ int i; for (i = 0; i < size; ++i) buf[i] = value; \
10
+ } while(0)
11
+ #define MEMCPY(dst, src, size) do { \
12
+ int i; for (i = 0; i < size; ++i) dst[i] = src[i]; \
13
+ } while(0)
14
+
15
+ #define FILL(JTYPE, CTYPE) \
16
+ void fill##JTYPE##Buffer(CTYPE* buf, CTYPE value, int size) { MEMSET(buf, value, size); }
17
+
18
+ #define COPY(JTYPE, CTYPE) \
19
+ void copy##JTYPE##Buffer(CTYPE* dst, CTYPE* src, int size) { MEMCPY(dst, src, size); }
20
+
21
+ #define FUNC(JTYPE, CTYPE) \
22
+ FILL(JTYPE, CTYPE); \
23
+ COPY(JTYPE, CTYPE)
24
+
25
+ FUNC(Byte, char);
26
+ FUNC(Short, short);
27
+ FUNC(Int, int);
28
+ FUNC(Long, long long);
29
+ FUNC(Float, float);
30
+ FUNC(Double, double);
31
+
@@ -0,0 +1,205 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. All rights reserved.
3
+ *
4
+ * For licensing, see LICENSE.SPECS
5
+ */
6
+
7
+ #include <stdlib.h>
8
+ #include <stdbool.h>
9
+ #ifndef _WIN32
10
+ # include <pthread.h>
11
+ #else
12
+ # include <windows.h>
13
+ # include <process.h>
14
+ #endif
15
+
16
+ #define R(T, rtype) rtype testClosureVr##T(rtype (*closure)(void)) { \
17
+ return closure != NULL ? (*closure)() : (rtype) 0; \
18
+ }
19
+
20
+ #define P(T, ptype) void testClosure##T##rV(void (*closure)(ptype), ptype a1) { \
21
+ if (closure != NULL) (*closure)(a1); \
22
+ }
23
+
24
+ void testClosureVrV(void (*closure)(void))
25
+ {
26
+ (*closure)();
27
+ }
28
+
29
+ R(Z, bool);
30
+ R(B, char);
31
+ R(S, short);
32
+ R(I, int);
33
+ R(L, long);
34
+ R(J, long long);
35
+ R(LL, long long);
36
+ R(F, float);
37
+ R(D, double);
38
+ R(P, const void*);
39
+
40
+
41
+ P(Z, bool);
42
+ P(B, char);
43
+ P(S, short);
44
+ P(I, int);
45
+ P(L, long);
46
+ P(J, long long);
47
+ P(LL, long long);
48
+ P(F, float);
49
+ P(D, double);
50
+ P(P, const void*);
51
+ P(UL, unsigned long);
52
+
53
+ #if defined(_WIN32) && !defined(_WIN64)
54
+ bool __stdcall testClosureStdcall(long *a1, void __stdcall(*closure)(void *, long), long a2) { \
55
+ void* sp_pre;
56
+ void* sp_post;
57
+
58
+ asm volatile (" movl %%esp,%0" : "=g" (sp_pre));
59
+ (*closure)(a1, a2);
60
+ asm volatile (" movl %%esp,%0" : "=g" (sp_post));
61
+
62
+ /* %esp before pushing parameters on the stack and after the call returns
63
+ * should be equal, if both sides respects the stdcall convention */
64
+ return sp_pre == sp_post;
65
+ }
66
+ #endif
67
+
68
+ void testOptionalClosureBrV(void (*closure)(char), char a1)
69
+ {
70
+ if (closure) {
71
+ (*closure)(a1);
72
+ }
73
+ }
74
+
75
+
76
+ struct ThreadVrV {
77
+ void (*closure)(void);
78
+ int count;
79
+ };
80
+
81
+ static void *
82
+ threadVrV(void *arg)
83
+ {
84
+ struct ThreadVrV* t = (struct ThreadVrV *) arg;
85
+
86
+ int i;
87
+ for (i = 0; i < t->count; i++) {
88
+ (*t->closure)();
89
+ }
90
+
91
+ return NULL;
92
+ }
93
+
94
+ void testThreadedClosureVrV(void (*closure)(void), int n)
95
+ {
96
+ struct ThreadVrV arg = {closure, n};
97
+ #ifndef _WIN32
98
+ pthread_t t;
99
+ pthread_create(&t, NULL, threadVrV, &arg);
100
+ pthread_join(t, NULL);
101
+ #else
102
+ HANDLE hThread = (HANDLE) _beginthread((void (*)(void *))threadVrV, 0, &arg);
103
+ WaitForSingleObject(hThread, INFINITE);
104
+ #endif
105
+ }
106
+
107
+ struct s8f32s32 {
108
+ char s8;
109
+ float f32;
110
+ int s32;
111
+ };
112
+
113
+ // Takes a struct argument
114
+ void testClosureTrV(void (*closure)(struct s8f32s32 s), struct s8f32s32* s)
115
+ {
116
+ (*closure)(*s);
117
+ }
118
+
119
+ // Returns a struct value
120
+ struct s8f32s32 testClosureVrT(struct s8f32s32 (*closure)())
121
+ {
122
+ return (*closure)();
123
+ }
124
+
125
+ typedef int (*returnTypeClosure_t)(int) ;
126
+ typedef returnTypeClosure_t (*lookupClosure_t)();
127
+
128
+ int testReturnsClosure(lookupClosure_t lookup, int val)
129
+ {
130
+ returnTypeClosure_t func = lookup ? (*lookup)() : NULL;
131
+ return func ? (*func)(val) : 0;
132
+ }
133
+
134
+ static int multiplyByTwo(int value)
135
+ {
136
+ return value * 2;
137
+ }
138
+
139
+ returnTypeClosure_t testReturnsFunctionPointer()
140
+ {
141
+ return multiplyByTwo;
142
+ }
143
+
144
+ typedef int (*argumentClosure_t)(int);
145
+ typedef int (*withArgumentClosure_t)(argumentClosure_t, int);
146
+
147
+ int testArgumentClosure(withArgumentClosure_t closure_with, argumentClosure_t closure_arg, int val)
148
+ {
149
+ return (*closure_with)(closure_arg, val);
150
+ }
151
+
152
+
153
+ //
154
+ // These macros produce functions of the form:
155
+ // testClosureBIrV(void (*closure)(char, int), char a1, int a2) {}
156
+ //
157
+ #define C2_(J1, J2, N1, N2) \
158
+ void testClosure##J1##J2##rV(void (*closure)(N1, N2), N1 a1, N2 a2) \
159
+ { \
160
+ if (closure != NULL) (*closure)(a1, a2); \
161
+ }
162
+
163
+ #define C2(J, N) \
164
+ C2_(B, J, char, N) \
165
+ C2_(S, J, short, N) \
166
+ C2_(I, J, int, N) \
167
+ C2_(LL, J, long long, N) \
168
+ C2_(F, J, float, N) \
169
+ C2_(D, J, double, N) \
170
+
171
+
172
+ C2(B, char);
173
+ C2(S, short);
174
+ C2(I, int);
175
+ C2(LL, long long);
176
+ C2(F, float);
177
+ C2(D, double);
178
+
179
+ #define C3_(J1, J2, J3, N1, N2, N3) \
180
+ void testClosure##J1##J2##J3##rV(void (*closure)(N1, N2, N3), N1 a1, N2 a2, N3 a3) \
181
+ { \
182
+ (*closure)(a1, a2, a3); \
183
+ }
184
+
185
+
186
+ #define C3(J, N) \
187
+ C3_(B, J, B, char, N, char) \
188
+ C3_(S, J, S, short, N, short) \
189
+ C3_(I, J, I, int, N, int) \
190
+ C3_(LL, J, LL, long long, N, long long) \
191
+ C3_(F, J, F, float, N, float) \
192
+ C3_(D, J, D, double, N, double) \
193
+
194
+ C3(B, char);
195
+ C3(S, short);
196
+ C3(I, int);
197
+ C3(LL, long long);
198
+ C3(F, float);
199
+ C3(D, double);
200
+ C3_(B, S, I, char, short, int);
201
+ C3_(B, S, LL, char, short, long long);
202
+ C3_(LL, S, B, long long, short, char);
203
+ C3_(LL, B, S, long long, char, short);
204
+
205
+
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. All rights reserved.
3
+ *
4
+ * For licensing, see LICENSE.SPECS
5
+ */
6
+ #include <stdint.h>
7
+
8
+ int test_untagged_enum(int val) {
9
+ return val;
10
+ }
11
+
12
+ int test_untagged_typedef_enum(int val) {
13
+ return val;
14
+ }
15
+
16
+ uint8_t test_untagged_nonint_enum(uint8_t val) {
17
+ return val;
18
+ }
19
+
20
+ uint16_t test_tagged_nonint_enum1(uint16_t val) {
21
+ return val;
22
+ }
23
+
24
+ uint32_t test_tagged_nonint_enum2(uint32_t val) {
25
+ return val;
26
+ }
27
+
28
+ uint64_t test_tagged_nonint_enum3(uint64_t val) {
29
+ return val;
30
+ }
31
+
32
+ typedef enum {c1, c2, c3, c4} enum_type1;
33
+ enum_type1 test_tagged_typedef_enum1(enum_type1 val) {
34
+ return val;
35
+ }
36
+
37
+ typedef enum {c5 = 42, c6, c7, c8} enum_type2;
38
+ enum_type2 test_tagged_typedef_enum2(enum_type2 val) {
39
+ return val;
40
+ }
41
+
42
+ typedef enum {c9 = 42, c10, c11 = 4242, c12} enum_type3;
43
+ enum_type3 test_tagged_typedef_enum3(enum_type3 val) {
44
+ return val;
45
+ }
46
+
47
+ typedef enum {c13 = 42, c14 = 4242, c15 = 424242, c16 = 42424242} enum_type4;
48
+ enum_type4 test_tagged_typedef_enum4(enum_type4 val) {
49
+ return val;
50
+ }
51
+
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. All rights reserved.
3
+ *
4
+ * For licensing, see LICENSE.SPECS
5
+ */
6
+
7
+ #ifdef _WIN32
8
+ #include <windows.h>
9
+ #define sleep(x) Sleep(x)
10
+ #endif
11
+
12
+ #ifndef _WIN32
13
+ #include <unistd.h>
14
+ #include <pthread.h>
15
+ #endif
16
+
17
+ int testAdd(int a, int b)
18
+ {
19
+ return a + b;
20
+ };
21
+
22
+ int testFunctionAdd(int a, int b, int (*f)(int, int))
23
+ {
24
+ return f(a, b);
25
+ };
26
+
27
+ void testBlocking(int seconds) {
28
+ sleep(seconds);
29
+ };
30
+
31
+ struct async_data {
32
+ void (*fn)(int);
33
+ int value;
34
+ };
35
+
36
+ static void* asyncThreadCall(void *data)
37
+ {
38
+ struct async_data* d = (struct async_data *) data;
39
+ if (d != NULL && d->fn != NULL) {
40
+ (*d->fn)(d->value);
41
+ }
42
+
43
+ return NULL;
44
+ }
45
+
46
+ void testAsyncCallback(void (*fn)(int), int value)
47
+ {
48
+ #ifndef _WIN32
49
+ pthread_t t;
50
+ struct async_data d;
51
+ d.fn = fn;
52
+ d.value = value;
53
+ pthread_create(&t, NULL, asyncThreadCall, &d);
54
+ pthread_join(t, NULL);
55
+ #else
56
+ (*fn)(value);
57
+ #endif
58
+ }
59
+
60
+ #if defined(_WIN32) && !defined(_WIN64)
61
+ struct StructUCDP {
62
+ unsigned char a1;
63
+ double a2;
64
+ void *a3;
65
+ };
66
+
67
+ void __stdcall testStdcallManyParams(long *a1, char a2, short int a3, int a4, __int64 a5,
68
+ struct StructUCDP a6, struct StructUCDP *a7, float a8, double a9) {
69
+ }
70
+ #endif
@@ -0,0 +1,149 @@
1
+ # -*- makefile -*-
2
+
3
+ ifeq ($(OS),)
4
+ BUILD_OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
5
+ OS := $(BUILD_OS)
6
+ endif
7
+
8
+ ifeq ($(CPU),)
9
+ CPU := $(shell uname -m | sed -e 's/i[345678]86/i386/')
10
+ endif
11
+
12
+ PLATFORM = $(CPU)-$(OS)
13
+
14
+ ifeq ($(OS), sunos)
15
+ OS = solaris
16
+ endif
17
+
18
+ SRC_DIR = libtest
19
+ BUILD_DIR ?= build
20
+ TEST_BUILD_DIR = $(BUILD_DIR)/libtest
21
+ # Set defaults to unix (linux/solaris/bsd)
22
+ PREFIX = lib
23
+ LIBEXT ?= so
24
+ LIBNAME = $(PREFIX)test.$(LIBEXT)
25
+
26
+ export MACOSX_DEPLOYMENT_TARGET=10.4
27
+
28
+ CCACHE := $(strip $(realpath $(shell which ccache 2> /dev/null)))
29
+
30
+ TEST_SRCS = $(wildcard $(SRC_DIR)/*.c)
31
+ TEST_OBJS := $(patsubst $(SRC_DIR)/%.c, $(TEST_BUILD_DIR)/%.o, $(TEST_SRCS))
32
+
33
+ #
34
+ # Compiler/linker flags from:
35
+ # http://weblogs.java.net/blog/kellyohair/archive/2006/01/compilation_of_1.html
36
+ JFLAGS = -fno-omit-frame-pointer -fno-strict-aliasing
37
+ OFLAGS = -O2 $(JFLAGS)
38
+ WFLAGS = -W -Wall -Wno-unused -Wno-parentheses
39
+ PICFLAGS = -fPIC
40
+ SOFLAGS = -shared
41
+ LDFLAGS += $(SOFLAGS)
42
+
43
+ IFLAGS = -I"$(BUILD_DIR)"
44
+ CFLAGS = $(OFLAGS) $(WFLAGS) $(IFLAGS) $(PICFLAGS) -D_REENTRANT
45
+
46
+ ifneq ($(strip $(findstring $(OS), win32, mingw, cygwin)),)
47
+ # For cygwin => win32-native builds, strip out cygwin deps
48
+ ifneq ($(findstring cygwin, $(BUILD_OS)),)
49
+ CC += -mno-cygwin -mwin32
50
+ LDFLAGS += -mno-cygwin -Wl,--add-stdcall-alias
51
+ endif
52
+ PICFLAGS=
53
+ LIBEXT=dll
54
+ CC = gcc
55
+ endif
56
+
57
+ ifeq ($(OS), darwin)
58
+ ifneq ($(findstring $(CPU),ppc),)
59
+ ARCHFLAGS += -arch ppc
60
+ endif
61
+ ifneq ($(findstring $(CPU),i386 x86_64),)
62
+ ARCHFLAGS += -arch i386 -arch x86_64
63
+ endif
64
+ CFLAGS += $(ARCHFLAGS) -DTARGET_RT_MAC_CFM=0
65
+ CFLAGS += -fno-common
66
+ LDFLAGS = $(ARCHFLAGS) -dynamiclib
67
+ # link against the universal libraries on ppc machines
68
+ LDFLAGS += -L$(MACSDK)/usr/lib
69
+ LIBEXT = dylib
70
+ FFI_CFLAGS += -isysroot $(MACSDK)
71
+ PICFLAGS =
72
+ SOFLAGS =
73
+ endif
74
+
75
+ ifeq ($(OS), linux)
76
+ SOFLAGS += -Wl,-soname,$(LIBNAME)
77
+ endif
78
+
79
+ ifeq ($(OS), solaris)
80
+ CC = /usr/sfw/bin/gcc -std=c99
81
+ LD = /usr/ccs/bin/ld
82
+ SOFLAGS = -shared -static-libgcc
83
+ endif
84
+
85
+ ifeq ($(OS), aix)
86
+ LIBEXT = a
87
+ SOFLAGS = -shared -static-libgcc
88
+ PICFLAGS += -pthread
89
+ endif
90
+
91
+ ifneq ($(findstring bsd, $(OS)),)
92
+ SOFLAGS = -shared -static-libgcc
93
+ CFLAGS += -pthread
94
+ LDFLAGS += -pthread
95
+ endif
96
+
97
+ ifeq ($(CPU), i386)
98
+ MODEL = 32
99
+ endif
100
+
101
+ ifeq ($(CPU), sparcv9)
102
+ MODEL = 64
103
+ endif
104
+
105
+ ifeq ($(CPU), amd64)
106
+ MODEL = 64
107
+ endif
108
+
109
+ ifeq ($(CPU), x86_64)
110
+ MODEL = 64
111
+ endif
112
+
113
+ ifeq ($(CPU), ppc64)
114
+ MODEL = 64
115
+ endif
116
+
117
+ ifeq ($(CPU), powerpc64)
118
+ MODEL = 64
119
+ endif
120
+
121
+ MODELFLAG =
122
+ ifneq ($(MODEL),)
123
+ MODELFLAG = -m$(MODEL)
124
+ endif
125
+
126
+ # On platforms (linux, solaris) that support both 32bit and 64bit, force building for one or the other
127
+ ifneq ($(or $(findstring linux, $(OS)), $(findstring solaris, $(OS))),)
128
+ # Change the CC/LD instead of CFLAGS/LDFLAGS, incase other things in the flags
129
+ # makes the libffi build choke
130
+ CC += $(MODELFLAG)
131
+ LD += $(MODELFLAG)
132
+ endif
133
+
134
+ LIBTEST = $(BUILD_DIR)/$(LIBNAME)
135
+
136
+ all: $(LIBTEST)
137
+
138
+ $(TEST_BUILD_DIR)/%.o : $(SRC_DIR)/%.c
139
+ @mkdir -p $(@D)
140
+ $(CCACHE) $(CC) $(CFLAGS) -c $< -o $@
141
+
142
+ $(LIBTEST): $(TEST_OBJS)
143
+ $(CC) -o $@ $(LDFLAGS) $(TEST_OBJS) -lm
144
+
145
+ clean::
146
+ # nothing to do - ant will delete the build dir
147
+
148
+ debug::
149
+ @echo "SRCS=$(TEST_SRCS)"
@@ -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 <stdint.h>
9
+
10
+ typedef int8_t s8;
11
+ typedef uint8_t u8;
12
+ typedef int16_t s16;
13
+ typedef uint16_t u16;
14
+ typedef int32_t s32;
15
+ typedef uint32_t u32;
16
+ typedef int64_t s64;
17
+ typedef uint64_t u64;
18
+ typedef signed long sL;
19
+ typedef unsigned long uL;
20
+ typedef float f32;
21
+ typedef double f64;
22
+ #if !defined(__OpenBSD__)
23
+ typedef unsigned long ulong;
24
+ #endif
25
+ typedef void* pointer;
26
+ typedef void* P;
27
+
28
+ #define GVAR(T) \
29
+ extern T gvar_##T; \
30
+ T gvar_##T = (T) -1; \
31
+ T gvar_##T##_get() { return gvar_##T; }; \
32
+ void gvar_##T##_set(T v) { gvar_##T = v; }
33
+
34
+ GVAR(s8);
35
+ GVAR(u8);
36
+ GVAR(s16);
37
+ GVAR(u16);
38
+ GVAR(s32);
39
+ GVAR(u32);
40
+ GVAR(s64);
41
+ GVAR(u64);
42
+ GVAR(long);
43
+ GVAR(ulong);
44
+ GVAR(pointer);
45
+
46
+ struct gstruct {
47
+ long data;
48
+ };
49
+
50
+ struct gstruct gvar_gstruct = { -1 };
51
+
52
+ struct gstruct*
53
+ gvar_gstruct_get(void)
54
+ {
55
+ return &gvar_gstruct;
56
+ }
57
+
58
+ void
59
+ gvar_gstruct_set(const struct gstruct* val)
60
+ {
61
+ gvar_gstruct = *val;
62
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2007 Wayne Meissner. All rights reserved.
3
+ *
4
+ * For licensing, see LICENSE.SPECS
5
+ */
6
+
7
+ #if defined(_WIN32) || defined(__WIN32__)
8
+ # include <windows.h>
9
+ #else
10
+ # include <errno.h>
11
+ #endif
12
+
13
+ int setLastError(int error) {
14
+ #if defined(_WIN32) || defined(__WIN32__)
15
+ SetLastError(error);
16
+ #else
17
+ errno = error;
18
+ #endif
19
+ return -1;
20
+ }
21
+