mt-libuv 4.1.0 → 4.1.03

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2094) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/ext/Rakefile +1 -1
  4. data/ext/gyp/.gitignore +1 -0
  5. data/ext/gyp/AUTHORS +17 -0
  6. data/ext/gyp/DEPS +23 -0
  7. data/ext/gyp/LICENSE +27 -0
  8. data/ext/gyp/OWNERS +1 -0
  9. data/ext/gyp/PRESUBMIT.py +125 -0
  10. data/ext/gyp/README.md +5 -0
  11. data/ext/gyp/buildbot/buildbot_run.py +138 -0
  12. data/ext/gyp/buildbot/commit_queue/OWNERS +6 -0
  13. data/ext/gyp/buildbot/commit_queue/README +3 -0
  14. data/ext/gyp/buildbot/commit_queue/cq_config.json +15 -0
  15. data/ext/gyp/buildbot/travis-checkout.sh +27 -0
  16. data/ext/gyp/buildbot/travis-test.sh +12 -0
  17. data/ext/gyp/codereview.settings +6 -0
  18. data/ext/gyp/data/win/large-pdb-shim.cc +12 -0
  19. data/ext/gyp/gyp +8 -0
  20. data/ext/gyp/gyp.bat +5 -0
  21. data/ext/gyp/gyp_main.py +16 -0
  22. data/ext/gyp/gyptest.py +243 -0
  23. data/ext/gyp/pylib/gyp/MSVSNew.py +353 -0
  24. data/ext/gyp/pylib/gyp/MSVSProject.py +208 -0
  25. data/ext/gyp/pylib/gyp/MSVSSettings.py +1106 -0
  26. data/ext/gyp/pylib/gyp/MSVSSettings_test.py +1486 -0
  27. data/ext/gyp/pylib/gyp/MSVSToolFile.py +58 -0
  28. data/ext/gyp/pylib/gyp/MSVSUserFile.py +147 -0
  29. data/ext/gyp/pylib/gyp/MSVSUtil.py +271 -0
  30. data/ext/gyp/pylib/gyp/MSVSVersion.py +504 -0
  31. data/ext/gyp/pylib/gyp/__init__.py +555 -0
  32. data/ext/gyp/pylib/gyp/common.py +619 -0
  33. data/ext/gyp/pylib/gyp/common_test.py +73 -0
  34. data/ext/gyp/pylib/gyp/easy_xml.py +170 -0
  35. data/ext/gyp/pylib/gyp/easy_xml_test.py +106 -0
  36. data/ext/gyp/pylib/gyp/flock_tool.py +54 -0
  37. data/ext/gyp/pylib/gyp/generator/__init__.py +0 -0
  38. data/ext/gyp/pylib/gyp/generator/analyzer.py +744 -0
  39. data/ext/gyp/pylib/gyp/generator/cmake.py +1256 -0
  40. data/ext/gyp/pylib/gyp/generator/dump_dependency_json.py +101 -0
  41. data/ext/gyp/pylib/gyp/generator/eclipse.py +425 -0
  42. data/ext/gyp/pylib/gyp/generator/gypd.py +94 -0
  43. data/ext/gyp/pylib/gyp/generator/gypsh.py +56 -0
  44. data/ext/gyp/pylib/gyp/generator/make.py +2260 -0
  45. data/ext/gyp/pylib/gyp/generator/msvs.py +3537 -0
  46. data/ext/gyp/pylib/gyp/generator/msvs_test.py +40 -0
  47. data/ext/gyp/pylib/gyp/generator/ninja.py +2500 -0
  48. data/ext/gyp/pylib/gyp/generator/ninja_test.py +46 -0
  49. data/ext/gyp/pylib/gyp/generator/xcode.py +1302 -0
  50. data/ext/gyp/pylib/gyp/generator/xcode_test.py +23 -0
  51. data/ext/gyp/pylib/gyp/input.py +2908 -0
  52. data/ext/gyp/pylib/gyp/input_test.py +90 -0
  53. data/ext/gyp/pylib/gyp/mac_tool.py +721 -0
  54. data/ext/gyp/pylib/gyp/msvs_emulation.py +1112 -0
  55. data/ext/gyp/pylib/gyp/ninja_syntax.py +168 -0
  56. data/ext/gyp/pylib/gyp/simple_copy.py +57 -0
  57. data/ext/gyp/pylib/gyp/win_tool.py +326 -0
  58. data/ext/gyp/pylib/gyp/xcode_emulation.py +1800 -0
  59. data/ext/gyp/pylib/gyp/xcode_ninja.py +289 -0
  60. data/ext/gyp/pylib/gyp/xcodeproj_file.py +2995 -0
  61. data/ext/gyp/pylib/gyp/xml_fix.py +68 -0
  62. data/ext/gyp/samples/samples +83 -0
  63. data/ext/gyp/samples/samples.bat +5 -0
  64. data/ext/gyp/setup.py +19 -0
  65. data/ext/gyp/test/actions/generated-header/action.py +11 -0
  66. data/ext/gyp/test/actions/generated-header/main.cc +7 -0
  67. data/ext/gyp/test/actions/generated-header/test.gyp +34 -0
  68. data/ext/gyp/test/actions/gyptest-all.py +101 -0
  69. data/ext/gyp/test/actions/gyptest-default.py +68 -0
  70. data/ext/gyp/test/actions/gyptest-errors.py +24 -0
  71. data/ext/gyp/test/actions/gyptest-generated-header.py +38 -0
  72. data/ext/gyp/test/actions/src/action_missing_name.gyp +24 -0
  73. data/ext/gyp/test/actions/src/actions.gyp +114 -0
  74. data/ext/gyp/test/actions/src/confirm-dep-files.py +21 -0
  75. data/ext/gyp/test/actions/src/subdir1/counter.py +44 -0
  76. data/ext/gyp/test/actions/src/subdir1/executable.gyp +74 -0
  77. data/ext/gyp/test/actions/src/subdir1/make-prog1.py +20 -0
  78. data/ext/gyp/test/actions/src/subdir1/make-prog2.py +20 -0
  79. data/ext/gyp/test/actions/src/subdir1/program.c +12 -0
  80. data/ext/gyp/test/actions/src/subdir2/make-file.py +11 -0
  81. data/ext/gyp/test/actions/src/subdir2/none.gyp +33 -0
  82. data/ext/gyp/test/actions/src/subdir3/generate_main.py +21 -0
  83. data/ext/gyp/test/actions/src/subdir3/null_input.gyp +29 -0
  84. data/ext/gyp/test/actions-bare/gyptest-bare.py +24 -0
  85. data/ext/gyp/test/actions-bare/src/bare.gyp +25 -0
  86. data/ext/gyp/test/actions-bare/src/bare.py +11 -0
  87. data/ext/gyp/test/actions-depfile/depfile.gyp +42 -0
  88. data/ext/gyp/test/actions-depfile/gyptest-all.py +30 -0
  89. data/ext/gyp/test/actions-depfile/input.txt +1 -0
  90. data/ext/gyp/test/actions-depfile/touch.py +18 -0
  91. data/ext/gyp/test/actions-multiple/gyptest-all.py +72 -0
  92. data/ext/gyp/test/actions-multiple/src/actions.gyp +226 -0
  93. data/ext/gyp/test/actions-multiple/src/copyfile.py +9 -0
  94. data/ext/gyp/test/actions-multiple/src/filter.py +12 -0
  95. data/ext/gyp/test/actions-multiple/src/foo.c +11 -0
  96. data/ext/gyp/test/actions-multiple/src/input.txt +1 -0
  97. data/ext/gyp/test/actions-multiple/src/main.c +22 -0
  98. data/ext/gyp/test/actions-multiple-outputs/gyptest-multiple-outputs.py +45 -0
  99. data/ext/gyp/test/actions-multiple-outputs/src/multiple-outputs.gyp +23 -0
  100. data/ext/gyp/test/actions-multiple-outputs/src/touch.py +16 -0
  101. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/gyptest-action.py +45 -0
  102. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/action.gyp +28 -0
  103. data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/rcopy.py +20 -0
  104. data/ext/gyp/test/actions-none/gyptest-none.py +24 -0
  105. data/ext/gyp/test/actions-none/src/fake_cross.py +12 -0
  106. data/ext/gyp/test/actions-none/src/foo.cc +1 -0
  107. data/ext/gyp/test/actions-none/src/none_with_source_files.gyp +35 -0
  108. data/ext/gyp/test/actions-subdir/gyptest-action.py +26 -0
  109. data/ext/gyp/test/actions-subdir/src/make-file.py +11 -0
  110. data/ext/gyp/test/actions-subdir/src/none.gyp +31 -0
  111. data/ext/gyp/test/actions-subdir/src/subdir/make-subdir-file.py +11 -0
  112. data/ext/gyp/test/actions-subdir/src/subdir/subdir.gyp +28 -0
  113. data/ext/gyp/test/additional-targets/gyptest-additional.py +63 -0
  114. data/ext/gyp/test/additional-targets/src/all.gyp +13 -0
  115. data/ext/gyp/test/additional-targets/src/dir1/actions.gyp +56 -0
  116. data/ext/gyp/test/additional-targets/src/dir1/emit.py +11 -0
  117. data/ext/gyp/test/additional-targets/src/dir1/lib1.c +6 -0
  118. data/ext/gyp/test/analyzer/common.gypi +6 -0
  119. data/ext/gyp/test/analyzer/gyptest-analyzer.py +427 -0
  120. data/ext/gyp/test/analyzer/static_library_test.gyp +34 -0
  121. data/ext/gyp/test/analyzer/subdir/subdir.gyp +36 -0
  122. data/ext/gyp/test/analyzer/subdir/subdir2/subdir2.gyp +15 -0
  123. data/ext/gyp/test/analyzer/subdir2/subdir.gyp +18 -0
  124. data/ext/gyp/test/analyzer/subdir2/subdir.includes.gypi +9 -0
  125. data/ext/gyp/test/analyzer/test.gyp +114 -0
  126. data/ext/gyp/test/analyzer/test2.gyp +25 -0
  127. data/ext/gyp/test/analyzer/test2.includes.gypi +13 -0
  128. data/ext/gyp/test/analyzer/test2.includes.includes.gypi +9 -0
  129. data/ext/gyp/test/analyzer/test2.toplevel_includes.gypi +15 -0
  130. data/ext/gyp/test/analyzer/test3.gyp +77 -0
  131. data/ext/gyp/test/analyzer/test4.gyp +80 -0
  132. data/ext/gyp/test/analyzer/test5.gyp +25 -0
  133. data/ext/gyp/test/arflags/gyptest-arflags.py +26 -0
  134. data/ext/gyp/test/arflags/lib.cc +0 -0
  135. data/ext/gyp/test/arflags/test.gyp +10 -0
  136. data/ext/gyp/test/assembly/gyptest-assembly.py +31 -0
  137. data/ext/gyp/test/assembly/gyptest-override.py +24 -0
  138. data/ext/gyp/test/assembly/src/as.bat +4 -0
  139. data/ext/gyp/test/assembly/src/assembly.gyp +62 -0
  140. data/ext/gyp/test/assembly/src/lib1.S +15 -0
  141. data/ext/gyp/test/assembly/src/lib1.c +3 -0
  142. data/ext/gyp/test/assembly/src/override.gyp +34 -0
  143. data/ext/gyp/test/assembly/src/override_asm.asm +8 -0
  144. data/ext/gyp/test/assembly/src/program.c +12 -0
  145. data/ext/gyp/test/build-option/gyptest-build.py +27 -0
  146. data/ext/gyp/test/build-option/hello.c +13 -0
  147. data/ext/gyp/test/build-option/hello.gyp +15 -0
  148. data/ext/gyp/test/builddir/gyptest-all.py +85 -0
  149. data/ext/gyp/test/builddir/gyptest-default.py +85 -0
  150. data/ext/gyp/test/builddir/src/builddir.gypi +18 -0
  151. data/ext/gyp/test/builddir/src/func1.c +6 -0
  152. data/ext/gyp/test/builddir/src/func2.c +6 -0
  153. data/ext/gyp/test/builddir/src/func3.c +6 -0
  154. data/ext/gyp/test/builddir/src/func4.c +6 -0
  155. data/ext/gyp/test/builddir/src/func5.c +6 -0
  156. data/ext/gyp/test/builddir/src/prog1.c +10 -0
  157. data/ext/gyp/test/builddir/src/prog1.gyp +30 -0
  158. data/ext/gyp/test/builddir/src/subdir2/prog2.c +10 -0
  159. data/ext/gyp/test/builddir/src/subdir2/prog2.gyp +19 -0
  160. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.c +10 -0
  161. data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp +19 -0
  162. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c +10 -0
  163. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp +19 -0
  164. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c +10 -0
  165. data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp +19 -0
  166. data/ext/gyp/test/cflags/cflags.c +15 -0
  167. data/ext/gyp/test/cflags/cflags.gyp +23 -0
  168. data/ext/gyp/test/cflags/gyptest-cflags.py +75 -0
  169. data/ext/gyp/test/compilable/gyptest-headers.py +29 -0
  170. data/ext/gyp/test/compilable/src/headers.gyp +26 -0
  171. data/ext/gyp/test/compilable/src/lib1.cpp +7 -0
  172. data/ext/gyp/test/compilable/src/lib1.hpp +6 -0
  173. data/ext/gyp/test/compilable/src/program.cpp +9 -0
  174. data/ext/gyp/test/compiler-override/compiler-exe.gyp +16 -0
  175. data/ext/gyp/test/compiler-override/compiler-global-settings.gyp.in +34 -0
  176. data/ext/gyp/test/compiler-override/compiler-host.gyp +17 -0
  177. data/ext/gyp/test/compiler-override/compiler-shared-lib.gyp +16 -0
  178. data/ext/gyp/test/compiler-override/cxxtest.cc +7 -0
  179. data/ext/gyp/test/compiler-override/gyptest-compiler-env-toolchain.py +78 -0
  180. data/ext/gyp/test/compiler-override/gyptest-compiler-env.py +110 -0
  181. data/ext/gyp/test/compiler-override/gyptest-compiler-global-settings.py +82 -0
  182. data/ext/gyp/test/compiler-override/my_cc.py +7 -0
  183. data/ext/gyp/test/compiler-override/my_cxx.py +7 -0
  184. data/ext/gyp/test/compiler-override/my_ld.py +7 -0
  185. data/ext/gyp/test/compiler-override/my_nm.py +9 -0
  186. data/ext/gyp/test/compiler-override/my_readelf.py +9 -0
  187. data/ext/gyp/test/compiler-override/test.c +7 -0
  188. data/ext/gyp/test/conditions/elseif/elseif.gyp +43 -0
  189. data/ext/gyp/test/conditions/elseif/elseif_bad1.gyp +20 -0
  190. data/ext/gyp/test/conditions/elseif/elseif_bad2.gyp +22 -0
  191. data/ext/gyp/test/conditions/elseif/elseif_bad3.gyp +23 -0
  192. data/ext/gyp/test/conditions/elseif/elseif_conditions.gypi +15 -0
  193. data/ext/gyp/test/conditions/elseif/gyptest_elseif.py +33 -0
  194. data/ext/gyp/test/conditions/elseif/program.cc +10 -0
  195. data/ext/gyp/test/configurations/basics/configurations.c +15 -0
  196. data/ext/gyp/test/configurations/basics/configurations.gyp +32 -0
  197. data/ext/gyp/test/configurations/basics/gyptest-configurations.py +29 -0
  198. data/ext/gyp/test/configurations/inheritance/configurations.c +21 -0
  199. data/ext/gyp/test/configurations/inheritance/configurations.gyp +40 -0
  200. data/ext/gyp/test/configurations/inheritance/duplicates.gyp +27 -0
  201. data/ext/gyp/test/configurations/inheritance/duplicates.gypd.golden +12 -0
  202. data/ext/gyp/test/configurations/inheritance/gyptest-duplicates.py +36 -0
  203. data/ext/gyp/test/configurations/inheritance/gyptest-inheritance.py +33 -0
  204. data/ext/gyp/test/configurations/invalid/actions.gyp +18 -0
  205. data/ext/gyp/test/configurations/invalid/all_dependent_settings.gyp +18 -0
  206. data/ext/gyp/test/configurations/invalid/configurations.gyp +18 -0
  207. data/ext/gyp/test/configurations/invalid/dependencies.gyp +18 -0
  208. data/ext/gyp/test/configurations/invalid/direct_dependent_settings.gyp +18 -0
  209. data/ext/gyp/test/configurations/invalid/gyptest-configurations.py +36 -0
  210. data/ext/gyp/test/configurations/invalid/libraries.gyp +18 -0
  211. data/ext/gyp/test/configurations/invalid/link_settings.gyp +18 -0
  212. data/ext/gyp/test/configurations/invalid/sources.gyp +18 -0
  213. data/ext/gyp/test/configurations/invalid/standalone_static_library.gyp +17 -0
  214. data/ext/gyp/test/configurations/invalid/target_name.gyp +18 -0
  215. data/ext/gyp/test/configurations/invalid/type.gyp +18 -0
  216. data/ext/gyp/test/configurations/target_platform/configurations.gyp +58 -0
  217. data/ext/gyp/test/configurations/target_platform/front.c +8 -0
  218. data/ext/gyp/test/configurations/target_platform/gyptest-target_platform.py +40 -0
  219. data/ext/gyp/test/configurations/target_platform/left.c +3 -0
  220. data/ext/gyp/test/configurations/target_platform/right.c +3 -0
  221. data/ext/gyp/test/configurations/x64/configurations.c +12 -0
  222. data/ext/gyp/test/configurations/x64/configurations.gyp +38 -0
  223. data/ext/gyp/test/configurations/x64/gyptest-x86.py +31 -0
  224. data/ext/gyp/test/copies/gyptest-all.py +42 -0
  225. data/ext/gyp/test/copies/gyptest-attribs.py +41 -0
  226. data/ext/gyp/test/copies/gyptest-default.py +42 -0
  227. data/ext/gyp/test/copies/gyptest-samedir.py +28 -0
  228. data/ext/gyp/test/copies/gyptest-slash.py +39 -0
  229. data/ext/gyp/test/copies/gyptest-sourceless-shared-lib.py +20 -0
  230. data/ext/gyp/test/copies/gyptest-updir.py +32 -0
  231. data/ext/gyp/test/copies/src/copies-attribs.gyp +20 -0
  232. data/ext/gyp/test/copies/src/copies-samedir.gyp +37 -0
  233. data/ext/gyp/test/copies/src/copies-slash.gyp +36 -0
  234. data/ext/gyp/test/copies/src/copies-sourceless-shared-lib.gyp +27 -0
  235. data/ext/gyp/test/copies/src/copies-updir.gyp +21 -0
  236. data/ext/gyp/test/copies/src/copies.gyp +70 -0
  237. data/ext/gyp/test/copies/src/directory/file3 +1 -0
  238. data/ext/gyp/test/copies/src/directory/file4 +1 -0
  239. data/ext/gyp/test/copies/src/directory/subdir/file5 +1 -0
  240. data/ext/gyp/test/copies/src/executable-file.sh +3 -0
  241. data/ext/gyp/test/copies/src/file1 +1 -0
  242. data/ext/gyp/test/copies/src/file2 +1 -0
  243. data/ext/gyp/test/copies/src/foo.c +13 -0
  244. data/ext/gyp/test/copies/src/parentdir/subdir/file6 +1 -0
  245. data/ext/gyp/test/custom-generator/gyptest-custom-generator.py +18 -0
  246. data/ext/gyp/test/custom-generator/mygenerator.py +14 -0
  247. data/ext/gyp/test/custom-generator/test.gyp +15 -0
  248. data/ext/gyp/test/cxxflags/cxxflags.cc +15 -0
  249. data/ext/gyp/test/cxxflags/cxxflags.gyp +15 -0
  250. data/ext/gyp/test/cxxflags/gyptest-cxxflags.py +45 -0
  251. data/ext/gyp/test/defines/defines-env.gyp +22 -0
  252. data/ext/gyp/test/defines/defines.c +23 -0
  253. data/ext/gyp/test/defines/defines.gyp +38 -0
  254. data/ext/gyp/test/defines/gyptest-define-override.py +43 -0
  255. data/ext/gyp/test/defines/gyptest-defines-env-regyp.py +51 -0
  256. data/ext/gyp/test/defines/gyptest-defines-env.py +85 -0
  257. data/ext/gyp/test/defines/gyptest-defines.py +39 -0
  258. data/ext/gyp/test/defines-escaping/defines-escaping.c +11 -0
  259. data/ext/gyp/test/defines-escaping/defines-escaping.gyp +19 -0
  260. data/ext/gyp/test/defines-escaping/gyptest-defines-escaping.py +184 -0
  261. data/ext/gyp/test/dependencies/a.c +9 -0
  262. data/ext/gyp/test/dependencies/adso/all_dependent_settings_order.gyp +45 -0
  263. data/ext/gyp/test/dependencies/adso/write_args.py +11 -0
  264. data/ext/gyp/test/dependencies/b/b.c +3 -0
  265. data/ext/gyp/test/dependencies/b/b.gyp +22 -0
  266. data/ext/gyp/test/dependencies/b/b3.c +9 -0
  267. data/ext/gyp/test/dependencies/c/c.c +4 -0
  268. data/ext/gyp/test/dependencies/c/c.gyp +22 -0
  269. data/ext/gyp/test/dependencies/c/d.c +3 -0
  270. data/ext/gyp/test/dependencies/double_dependency.gyp +23 -0
  271. data/ext/gyp/test/dependencies/double_dependent.gyp +12 -0
  272. data/ext/gyp/test/dependencies/extra_targets.gyp +18 -0
  273. data/ext/gyp/test/dependencies/gyptest-all-dependent-settings-order.py +19 -0
  274. data/ext/gyp/test/dependencies/gyptest-double-dependency.py +19 -0
  275. data/ext/gyp/test/dependencies/gyptest-extra-targets.py +22 -0
  276. data/ext/gyp/test/dependencies/gyptest-indirect-module-dependency.py +22 -0
  277. data/ext/gyp/test/dependencies/gyptest-lib-only.py +39 -0
  278. data/ext/gyp/test/dependencies/gyptest-none-traversal.py +25 -0
  279. data/ext/gyp/test/dependencies/gyptest-sharedlib-linksettings.py +21 -0
  280. data/ext/gyp/test/dependencies/lib_only.gyp +16 -0
  281. data/ext/gyp/test/dependencies/main.c +14 -0
  282. data/ext/gyp/test/dependencies/module-dep/a.cc +7 -0
  283. data/ext/gyp/test/dependencies/module-dep/dll.cc +9 -0
  284. data/ext/gyp/test/dependencies/module-dep/exe.cc +7 -0
  285. data/ext/gyp/test/dependencies/module-dep/indirect-module-dependency.gyp +37 -0
  286. data/ext/gyp/test/dependencies/none_traversal.gyp +46 -0
  287. data/ext/gyp/test/dependencies/sharedlib-linksettings/program.c +25 -0
  288. data/ext/gyp/test/dependencies/sharedlib-linksettings/sharedlib.c +16 -0
  289. data/ext/gyp/test/dependencies/sharedlib-linksettings/staticlib.c +24 -0
  290. data/ext/gyp/test/dependencies/sharedlib-linksettings/test.gyp +37 -0
  291. data/ext/gyp/test/dependency-copy/gyptest-copy.py +26 -0
  292. data/ext/gyp/test/dependency-copy/src/copies.gyp +25 -0
  293. data/ext/gyp/test/dependency-copy/src/file1.c +7 -0
  294. data/ext/gyp/test/dependency-copy/src/file2.c +7 -0
  295. data/ext/gyp/test/dependent-settings/nested-dependent-settings/all-dependent-settings.gyp +19 -0
  296. data/ext/gyp/test/dependent-settings/nested-dependent-settings/direct-dependent-settings.gyp +19 -0
  297. data/ext/gyp/test/dependent-settings/nested-dependent-settings/gyptest-nested-dependent-settings.py +18 -0
  298. data/ext/gyp/test/determinism/determinism.gyp +59 -0
  299. data/ext/gyp/test/determinism/empty-targets.gyp +32 -0
  300. data/ext/gyp/test/determinism/gyptest-determinism.py +30 -0
  301. data/ext/gyp/test/determinism/gyptest-empty-target-names.py +30 -0
  302. data/ext/gyp/test/determinism/gyptest-needed-variables.py +30 -0
  303. data/ext/gyp/test/determinism/gyptest-solibs.py +37 -0
  304. data/ext/gyp/test/determinism/main.cc +5 -0
  305. data/ext/gyp/test/determinism/needed-variables.gyp +33 -0
  306. data/ext/gyp/test/determinism/rule.py +8 -0
  307. data/ext/gyp/test/determinism/solib.cc +8 -0
  308. data/ext/gyp/test/determinism/solibs.gyp +32 -0
  309. data/ext/gyp/test/empty-target/empty-target.gyp +12 -0
  310. data/ext/gyp/test/empty-target/gyptest-empty-target.py +18 -0
  311. data/ext/gyp/test/errors/dependency_cycle.gyp +23 -0
  312. data/ext/gyp/test/errors/duplicate_basenames.gyp +13 -0
  313. data/ext/gyp/test/errors/duplicate_node.gyp +12 -0
  314. data/ext/gyp/test/errors/duplicate_rule.gyp +22 -0
  315. data/ext/gyp/test/errors/duplicate_targets.gyp +14 -0
  316. data/ext/gyp/test/errors/error_command.gyp +12 -0
  317. data/ext/gyp/test/errors/file_cycle0.gyp +17 -0
  318. data/ext/gyp/test/errors/file_cycle1.gyp +13 -0
  319. data/ext/gyp/test/errors/gyptest-errors.py +80 -0
  320. data/ext/gyp/test/errors/missing_command.gyp +12 -0
  321. data/ext/gyp/test/errors/missing_dep.gyp +15 -0
  322. data/ext/gyp/test/errors/missing_targets.gyp +8 -0
  323. data/ext/gyp/test/escaping/colon/test.gyp +21 -0
  324. data/ext/gyp/test/escaping/gyptest-colon.py +51 -0
  325. data/ext/gyp/test/exclusion/exclusion.gyp +23 -0
  326. data/ext/gyp/test/exclusion/gyptest-exclusion.py +22 -0
  327. data/ext/gyp/test/exclusion/hello.c +15 -0
  328. data/ext/gyp/test/external-cross-compile/gyptest-cross.py +31 -0
  329. data/ext/gyp/test/external-cross-compile/src/bogus1.cc +1 -0
  330. data/ext/gyp/test/external-cross-compile/src/bogus2.c +1 -0
  331. data/ext/gyp/test/external-cross-compile/src/cross.gyp +83 -0
  332. data/ext/gyp/test/external-cross-compile/src/cross_compile.gypi +23 -0
  333. data/ext/gyp/test/external-cross-compile/src/fake_cross.py +18 -0
  334. data/ext/gyp/test/external-cross-compile/src/program.cc +16 -0
  335. data/ext/gyp/test/external-cross-compile/src/test1.cc +1 -0
  336. data/ext/gyp/test/external-cross-compile/src/test2.c +1 -0
  337. data/ext/gyp/test/external-cross-compile/src/test3.cc +1 -0
  338. data/ext/gyp/test/external-cross-compile/src/test4.c +1 -0
  339. data/ext/gyp/test/external-cross-compile/src/tochar.py +13 -0
  340. data/ext/gyp/test/generator-output/actions/actions.gyp +16 -0
  341. data/ext/gyp/test/generator-output/actions/build/README.txt +4 -0
  342. data/ext/gyp/test/generator-output/actions/subdir1/actions-out/README.txt +4 -0
  343. data/ext/gyp/test/generator-output/actions/subdir1/build/README.txt +4 -0
  344. data/ext/gyp/test/generator-output/actions/subdir1/executable.gyp +44 -0
  345. data/ext/gyp/test/generator-output/actions/subdir1/make-prog1.py +20 -0
  346. data/ext/gyp/test/generator-output/actions/subdir1/make-prog2.py +20 -0
  347. data/ext/gyp/test/generator-output/actions/subdir1/program.c +12 -0
  348. data/ext/gyp/test/generator-output/actions/subdir2/actions-out/README.txt +4 -0
  349. data/ext/gyp/test/generator-output/actions/subdir2/build/README.txt +4 -0
  350. data/ext/gyp/test/generator-output/actions/subdir2/make-file.py +11 -0
  351. data/ext/gyp/test/generator-output/actions/subdir2/none.gyp +31 -0
  352. data/ext/gyp/test/generator-output/copies/build/README.txt +4 -0
  353. data/ext/gyp/test/generator-output/copies/copies-out/README.txt +4 -0
  354. data/ext/gyp/test/generator-output/copies/copies.gyp +50 -0
  355. data/ext/gyp/test/generator-output/copies/file1 +1 -0
  356. data/ext/gyp/test/generator-output/copies/file2 +1 -0
  357. data/ext/gyp/test/generator-output/copies/subdir/build/README.txt +4 -0
  358. data/ext/gyp/test/generator-output/copies/subdir/copies-out/README.txt +4 -0
  359. data/ext/gyp/test/generator-output/copies/subdir/file3 +1 -0
  360. data/ext/gyp/test/generator-output/copies/subdir/file4 +1 -0
  361. data/ext/gyp/test/generator-output/copies/subdir/subdir.gyp +32 -0
  362. data/ext/gyp/test/generator-output/gyptest-actions.py +57 -0
  363. data/ext/gyp/test/generator-output/gyptest-copies.py +59 -0
  364. data/ext/gyp/test/generator-output/gyptest-depth.py +58 -0
  365. data/ext/gyp/test/generator-output/gyptest-mac-bundle.py +33 -0
  366. data/ext/gyp/test/generator-output/gyptest-relocate.py +59 -0
  367. data/ext/gyp/test/generator-output/gyptest-rules.py +58 -0
  368. data/ext/gyp/test/generator-output/gyptest-subdir2-deep.py +36 -0
  369. data/ext/gyp/test/generator-output/gyptest-symlink.py +44 -0
  370. data/ext/gyp/test/generator-output/gyptest-top-all.py +53 -0
  371. data/ext/gyp/test/generator-output/mac-bundle/Info.plist +32 -0
  372. data/ext/gyp/test/generator-output/mac-bundle/app.order +1 -0
  373. data/ext/gyp/test/generator-output/mac-bundle/header.h +1 -0
  374. data/ext/gyp/test/generator-output/mac-bundle/main.c +1 -0
  375. data/ext/gyp/test/generator-output/mac-bundle/resource.sb +1 -0
  376. data/ext/gyp/test/generator-output/mac-bundle/test.gyp +25 -0
  377. data/ext/gyp/test/generator-output/rules/build/README.txt +4 -0
  378. data/ext/gyp/test/generator-output/rules/copy-file.py +12 -0
  379. data/ext/gyp/test/generator-output/rules/rules.gyp +16 -0
  380. data/ext/gyp/test/generator-output/rules/subdir1/build/README.txt +4 -0
  381. data/ext/gyp/test/generator-output/rules/subdir1/define3.in0 +1 -0
  382. data/ext/gyp/test/generator-output/rules/subdir1/define4.in0 +1 -0
  383. data/ext/gyp/test/generator-output/rules/subdir1/executable.gyp +59 -0
  384. data/ext/gyp/test/generator-output/rules/subdir1/function1.in1 +6 -0
  385. data/ext/gyp/test/generator-output/rules/subdir1/function2.in1 +6 -0
  386. data/ext/gyp/test/generator-output/rules/subdir1/program.c +18 -0
  387. data/ext/gyp/test/generator-output/rules/subdir2/build/README.txt +4 -0
  388. data/ext/gyp/test/generator-output/rules/subdir2/file1.in0 +1 -0
  389. data/ext/gyp/test/generator-output/rules/subdir2/file2.in0 +1 -0
  390. data/ext/gyp/test/generator-output/rules/subdir2/file3.in1 +1 -0
  391. data/ext/gyp/test/generator-output/rules/subdir2/file4.in1 +1 -0
  392. data/ext/gyp/test/generator-output/rules/subdir2/none.gyp +49 -0
  393. data/ext/gyp/test/generator-output/rules/subdir2/rules-out/README.txt +4 -0
  394. data/ext/gyp/test/generator-output/src/build/README.txt +4 -0
  395. data/ext/gyp/test/generator-output/src/inc.h +1 -0
  396. data/ext/gyp/test/generator-output/src/inc1/include1.h +1 -0
  397. data/ext/gyp/test/generator-output/src/prog1.c +18 -0
  398. data/ext/gyp/test/generator-output/src/prog1.gyp +28 -0
  399. data/ext/gyp/test/generator-output/src/subdir2/build/README.txt +4 -0
  400. data/ext/gyp/test/generator-output/src/subdir2/deeper/build/README.txt +4 -0
  401. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.c +7 -0
  402. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp +18 -0
  403. data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.h +1 -0
  404. data/ext/gyp/test/generator-output/src/subdir2/inc2/include2.h +1 -0
  405. data/ext/gyp/test/generator-output/src/subdir2/prog2.c +18 -0
  406. data/ext/gyp/test/generator-output/src/subdir2/prog2.gyp +28 -0
  407. data/ext/gyp/test/generator-output/src/subdir3/build/README.txt +4 -0
  408. data/ext/gyp/test/generator-output/src/subdir3/inc3/include3.h +1 -0
  409. data/ext/gyp/test/generator-output/src/subdir3/prog3.c +18 -0
  410. data/ext/gyp/test/generator-output/src/subdir3/prog3.gyp +25 -0
  411. data/ext/gyp/test/generator-output/src/symroot.gypi +16 -0
  412. data/ext/gyp/test/gyp-defines/defines.gyp +26 -0
  413. data/ext/gyp/test/gyp-defines/echo.py +11 -0
  414. data/ext/gyp/test/gyp-defines/gyptest-multiple-values.py +36 -0
  415. data/ext/gyp/test/gyp-defines/gyptest-regyp.py +40 -0
  416. data/ext/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py +37 -0
  417. data/ext/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py +36 -0
  418. data/ext/gyp/test/hard_dependency/src/a.c +9 -0
  419. data/ext/gyp/test/hard_dependency/src/a.h +12 -0
  420. data/ext/gyp/test/hard_dependency/src/b.c +9 -0
  421. data/ext/gyp/test/hard_dependency/src/b.h +12 -0
  422. data/ext/gyp/test/hard_dependency/src/c.c +10 -0
  423. data/ext/gyp/test/hard_dependency/src/c.h +10 -0
  424. data/ext/gyp/test/hard_dependency/src/d.c +9 -0
  425. data/ext/gyp/test/hard_dependency/src/emit.py +11 -0
  426. data/ext/gyp/test/hard_dependency/src/hard_dependency.gyp +78 -0
  427. data/ext/gyp/test/hello/gyptest-all.py +24 -0
  428. data/ext/gyp/test/hello/gyptest-default.py +24 -0
  429. data/ext/gyp/test/hello/gyptest-disable-regyp.py +32 -0
  430. data/ext/gyp/test/hello/gyptest-regyp-output.py +36 -0
  431. data/ext/gyp/test/hello/gyptest-regyp.py +32 -0
  432. data/ext/gyp/test/hello/gyptest-target.py +24 -0
  433. data/ext/gyp/test/hello/hello.c +11 -0
  434. data/ext/gyp/test/hello/hello.gyp +15 -0
  435. data/ext/gyp/test/hello/hello2.c +11 -0
  436. data/ext/gyp/test/hello/hello2.gyp +15 -0
  437. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py +31 -0
  438. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py +33 -0
  439. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py +44 -0
  440. data/ext/gyp/test/home_dot_gyp/gyptest-home-includes.py +30 -0
  441. data/ext/gyp/test/home_dot_gyp/home/.gyp/include.gypi +5 -0
  442. data/ext/gyp/test/home_dot_gyp/home2/.gyp/include.gypi +5 -0
  443. data/ext/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi +5 -0
  444. data/ext/gyp/test/home_dot_gyp/src/all.gyp +22 -0
  445. data/ext/gyp/test/home_dot_gyp/src/printfoo.c +7 -0
  446. data/ext/gyp/test/include_dirs/gyptest-all.py +43 -0
  447. data/ext/gyp/test/include_dirs/gyptest-default.py +43 -0
  448. data/ext/gyp/test/include_dirs/src/inc.h +1 -0
  449. data/ext/gyp/test/include_dirs/src/inc1/include1.h +1 -0
  450. data/ext/gyp/test/include_dirs/src/includes.c +19 -0
  451. data/ext/gyp/test/include_dirs/src/includes.gyp +27 -0
  452. data/ext/gyp/test/include_dirs/src/shadow1/shadow.h +1 -0
  453. data/ext/gyp/test/include_dirs/src/shadow2/shadow.h +1 -0
  454. data/ext/gyp/test/include_dirs/src/subdir/inc.h +1 -0
  455. data/ext/gyp/test/include_dirs/src/subdir/inc2/include2.h +1 -0
  456. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.c +14 -0
  457. data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.gyp +20 -0
  458. data/ext/gyp/test/intermediate_dir/gyptest-intermediate-dir.py +44 -0
  459. data/ext/gyp/test/intermediate_dir/src/script.py +22 -0
  460. data/ext/gyp/test/intermediate_dir/src/shared_infile.txt +1 -0
  461. data/ext/gyp/test/intermediate_dir/src/test.gyp +42 -0
  462. data/ext/gyp/test/intermediate_dir/src/test2.gyp +42 -0
  463. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  464. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  465. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/LanguageMap.plist +8 -0
  466. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/MainMenu.xib +17 -0
  467. data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/Main_iPhone.storyboard +27 -0
  468. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  469. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  470. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  471. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  472. data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  473. data/ext/gyp/test/ios/app-bundle/TestApp/TestApp-Info.plist +28 -0
  474. data/ext/gyp/test/ios/app-bundle/TestApp/check_no_signature.py +13 -0
  475. data/ext/gyp/test/ios/app-bundle/TestApp/main.m +13 -0
  476. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-32-bits.m +7 -0
  477. data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-64-bits.m +7 -0
  478. data/ext/gyp/test/ios/app-bundle/test-archs.gyp +109 -0
  479. data/ext/gyp/test/ios/app-bundle/test-assets-catalog.gyp +45 -0
  480. data/ext/gyp/test/ios/app-bundle/test-crosscompile.gyp +47 -0
  481. data/ext/gyp/test/ios/app-bundle/test-device.gyp +109 -0
  482. data/ext/gyp/test/ios/app-bundle/test.gyp +75 -0
  483. data/ext/gyp/test/ios/app-bundle/tool_main.cc +7 -0
  484. data/ext/gyp/test/ios/copies-with-xcode-envvars/Info.plist +24 -0
  485. data/ext/gyp/test/ios/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +97 -0
  486. data/ext/gyp/test/ios/copies-with-xcode-envvars/empty.c +1 -0
  487. data/ext/gyp/test/ios/copies-with-xcode-envvars/file0 +1 -0
  488. data/ext/gyp/test/ios/copies-with-xcode-envvars/file1 +1 -0
  489. data/ext/gyp/test/ios/copies-with-xcode-envvars/file10 +1 -0
  490. data/ext/gyp/test/ios/copies-with-xcode-envvars/file11 +1 -0
  491. data/ext/gyp/test/ios/copies-with-xcode-envvars/file2 +1 -0
  492. data/ext/gyp/test/ios/copies-with-xcode-envvars/file3 +1 -0
  493. data/ext/gyp/test/ios/copies-with-xcode-envvars/file4 +1 -0
  494. data/ext/gyp/test/ios/copies-with-xcode-envvars/file5 +1 -0
  495. data/ext/gyp/test/ios/copies-with-xcode-envvars/file6 +1 -0
  496. data/ext/gyp/test/ios/copies-with-xcode-envvars/file7 +1 -0
  497. data/ext/gyp/test/ios/copies-with-xcode-envvars/file8 +1 -0
  498. data/ext/gyp/test/ios/copies-with-xcode-envvars/file9 +1 -0
  499. data/ext/gyp/test/ios/deployment-target/check-version-min.c +33 -0
  500. data/ext/gyp/test/ios/deployment-target/deployment-target.gyp +34 -0
  501. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.h +9 -0
  502. data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.m +31 -0
  503. data/ext/gyp/test/ios/extension/ActionExtension/Info.plist +42 -0
  504. data/ext/gyp/test/ios/extension/ActionExtension/MainInterface.storyboard +63 -0
  505. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.h +12 -0
  506. data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.m +19 -0
  507. data/ext/gyp/test/ios/extension/ExtensionContainer/Base.lproj/Main.storyboard +25 -0
  508. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  509. data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  510. data/ext/gyp/test/ios/extension/ExtensionContainer/Info.plist +32 -0
  511. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.h +11 -0
  512. data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.m +24 -0
  513. data/ext/gyp/test/ios/extension/ExtensionContainer/main.m +13 -0
  514. data/ext/gyp/test/ios/extension/extension.gyp +91 -0
  515. data/ext/gyp/test/ios/framework/framework.gyp +43 -0
  516. data/ext/gyp/test/ios/framework/iOSFramework/Info.plist +26 -0
  517. data/ext/gyp/test/ios/framework/iOSFramework/Thing.h +10 -0
  518. data/ext/gyp/test/ios/framework/iOSFramework/Thing.m +22 -0
  519. data/ext/gyp/test/ios/framework/iOSFramework/iOSFramework.h +9 -0
  520. data/ext/gyp/test/ios/gyptest-app-ios-assets-catalog.py +57 -0
  521. data/ext/gyp/test/ios/gyptest-app-ios.py +76 -0
  522. data/ext/gyp/test/ios/gyptest-archs.py +62 -0
  523. data/ext/gyp/test/ios/gyptest-copies-with-xcode-envvars.py +65 -0
  524. data/ext/gyp/test/ios/gyptest-crosscompile.py +34 -0
  525. data/ext/gyp/test/ios/gyptest-deployment-target.py +23 -0
  526. data/ext/gyp/test/ios/gyptest-extension.py +51 -0
  527. data/ext/gyp/test/ios/gyptest-framework.py +37 -0
  528. data/ext/gyp/test/ios/gyptest-per-config-settings.py +190 -0
  529. data/ext/gyp/test/ios/gyptest-watch.py +44 -0
  530. data/ext/gyp/test/ios/gyptest-xcode-ninja.py +25 -0
  531. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
  532. data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/LaunchImage.launchimage/Contents.json +24 -0
  533. data/ext/gyp/test/ios/watch/WatchApp/Info.plist +35 -0
  534. data/ext/gyp/test/ios/watch/WatchApp/Interface.storyboard +15 -0
  535. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.h +12 -0
  536. data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.m +19 -0
  537. data/ext/gyp/test/ios/watch/WatchContainer/Base.lproj/Main.storyboard +25 -0
  538. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  539. data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
  540. data/ext/gyp/test/ios/watch/WatchContainer/Info.plist +32 -0
  541. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.h +11 -0
  542. data/ext/gyp/test/ios/watch/WatchContainer/ViewController.m +24 -0
  543. data/ext/gyp/test/ios/watch/WatchContainer/main.m +13 -0
  544. data/ext/gyp/test/ios/watch/WatchKitExtension/Images.xcassets/MyImage.imageset/Contents.json +20 -0
  545. data/ext/gyp/test/ios/watch/WatchKitExtension/Info.plist +38 -0
  546. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.h +10 -0
  547. data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.m +25 -0
  548. data/ext/gyp/test/ios/watch/WatchKitExtension/MainInterface.storyboard +63 -0
  549. data/ext/gyp/test/ios/watch/watch.gyp +105 -0
  550. data/ext/gyp/test/ios/xctests/App/AppDelegate.h +11 -0
  551. data/ext/gyp/test/ios/xctests/App/AppDelegate.m +18 -0
  552. data/ext/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib +41 -0
  553. data/ext/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard +25 -0
  554. data/ext/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json +68 -0
  555. data/ext/gyp/test/ios/xctests/App/Info.plist +47 -0
  556. data/ext/gyp/test/ios/xctests/App/ViewController.h +9 -0
  557. data/ext/gyp/test/ios/xctests/App/ViewController.m +21 -0
  558. data/ext/gyp/test/ios/xctests/App/main.m +13 -0
  559. data/ext/gyp/test/ios/xctests/AppTests/AppTests.m +31 -0
  560. data/ext/gyp/test/ios/xctests/AppTests/Info.plist +24 -0
  561. data/ext/gyp/test/ios/xctests/gyptest-xctests.py +49 -0
  562. data/ext/gyp/test/ios/xctests/xctests.gyp +74 -0
  563. data/ext/gyp/test/lib/README.txt +17 -0
  564. data/ext/gyp/test/lib/TestCmd.py +1597 -0
  565. data/ext/gyp/test/lib/TestCommon.py +591 -0
  566. data/ext/gyp/test/lib/TestGyp.py +1259 -0
  567. data/ext/gyp/test/lib/TestMac.py +76 -0
  568. data/ext/gyp/test/lib/TestWin.py +101 -0
  569. data/ext/gyp/test/library/gyptest-shared-obj-install-path.py +39 -0
  570. data/ext/gyp/test/library/gyptest-shared.py +84 -0
  571. data/ext/gyp/test/library/gyptest-static.py +84 -0
  572. data/ext/gyp/test/library/src/lib1.c +10 -0
  573. data/ext/gyp/test/library/src/lib1_moveable.c +10 -0
  574. data/ext/gyp/test/library/src/lib2.c +10 -0
  575. data/ext/gyp/test/library/src/lib2_moveable.c +10 -0
  576. data/ext/gyp/test/library/src/library.gyp +58 -0
  577. data/ext/gyp/test/library/src/program.c +15 -0
  578. data/ext/gyp/test/library/src/shared_dependency.gyp +33 -0
  579. data/ext/gyp/test/library_dirs/gyptest-library-dirs.py +50 -0
  580. data/ext/gyp/test/library_dirs/subdir/README.txt +1 -0
  581. data/ext/gyp/test/library_dirs/subdir/hello.cc +11 -0
  582. data/ext/gyp/test/library_dirs/subdir/mylib.cc +9 -0
  583. data/ext/gyp/test/library_dirs/subdir/mylib.h +12 -0
  584. data/ext/gyp/test/library_dirs/subdir/test-win.gyp +60 -0
  585. data/ext/gyp/test/library_dirs/subdir/test.gyp +68 -0
  586. data/ext/gyp/test/link-dependency/gyptest-link-dependency.py +23 -0
  587. data/ext/gyp/test/link-dependency/main.c +7 -0
  588. data/ext/gyp/test/link-dependency/mymalloc.c +12 -0
  589. data/ext/gyp/test/link-dependency/test.gyp +37 -0
  590. data/ext/gyp/test/link-objects/base.c +6 -0
  591. data/ext/gyp/test/link-objects/extra.c +5 -0
  592. data/ext/gyp/test/link-objects/gyptest-all.py +28 -0
  593. data/ext/gyp/test/link-objects/link-objects.gyp +24 -0
  594. data/ext/gyp/test/linux/gyptest-implicit-rpath.py +48 -0
  595. data/ext/gyp/test/linux/gyptest-ldflags-duplicates.py +22 -0
  596. data/ext/gyp/test/linux/gyptest-ldflags-from-environment.py +45 -0
  597. data/ext/gyp/test/linux/gyptest-target-rpath.py +43 -0
  598. data/ext/gyp/test/linux/implicit-rpath/file.c +1 -0
  599. data/ext/gyp/test/linux/implicit-rpath/main.c +1 -0
  600. data/ext/gyp/test/linux/implicit-rpath/test.gyp +47 -0
  601. data/ext/gyp/test/linux/ldflags-duplicates/check-ldflags.py +28 -0
  602. data/ext/gyp/test/linux/ldflags-duplicates/lib1.c +6 -0
  603. data/ext/gyp/test/linux/ldflags-duplicates/lib2.c +6 -0
  604. data/ext/gyp/test/linux/ldflags-duplicates/main.c +7 -0
  605. data/ext/gyp/test/linux/ldflags-duplicates/test.gyp +45 -0
  606. data/ext/gyp/test/linux/ldflags-from-environment/main.c +7 -0
  607. data/ext/gyp/test/linux/ldflags-from-environment/test.gyp +23 -0
  608. data/ext/gyp/test/linux/target-rpath/file.c +1 -0
  609. data/ext/gyp/test/linux/target-rpath/main.c +1 -0
  610. data/ext/gyp/test/linux/target-rpath/test.gyp +47 -0
  611. data/ext/gyp/test/mac/action-envvars/action/action.gyp +34 -0
  612. data/ext/gyp/test/mac/action-envvars/action/action.sh +8 -0
  613. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
  614. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
  615. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
  616. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16be.strings +0 -0
  617. data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16le.strings +0 -0
  618. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
  619. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
  620. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
  621. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
  622. data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
  623. data/ext/gyp/test/mac/app-bundle/TestApp/TestApp-Info.plist +34 -0
  624. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.h +13 -0
  625. data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.m +15 -0
  626. data/ext/gyp/test/mac/app-bundle/TestApp/main.m +10 -0
  627. data/ext/gyp/test/mac/app-bundle/empty.c +0 -0
  628. data/ext/gyp/test/mac/app-bundle/test-assets-catalog.gyp +43 -0
  629. data/ext/gyp/test/mac/app-bundle/test-error.gyp +31 -0
  630. data/ext/gyp/test/mac/app-bundle/test.gyp +41 -0
  631. data/ext/gyp/test/mac/archs/empty_main.cc +1 -0
  632. data/ext/gyp/test/mac/archs/file.mm +1 -0
  633. data/ext/gyp/test/mac/archs/file_a.cc +8 -0
  634. data/ext/gyp/test/mac/archs/file_a.h +10 -0
  635. data/ext/gyp/test/mac/archs/file_b.cc +8 -0
  636. data/ext/gyp/test/mac/archs/file_b.h +10 -0
  637. data/ext/gyp/test/mac/archs/file_c.cc +11 -0
  638. data/ext/gyp/test/mac/archs/file_d.cc +11 -0
  639. data/ext/gyp/test/mac/archs/header.h +1 -0
  640. data/ext/gyp/test/mac/archs/my_file.cc +4 -0
  641. data/ext/gyp/test/mac/archs/my_main_file.cc +9 -0
  642. data/ext/gyp/test/mac/archs/test-archs-multiarch.gyp +92 -0
  643. data/ext/gyp/test/mac/archs/test-archs-x86_64.gyp +27 -0
  644. data/ext/gyp/test/mac/archs/test-dependencies.gyp +92 -0
  645. data/ext/gyp/test/mac/archs/test-no-archs.gyp +21 -0
  646. data/ext/gyp/test/mac/archs/test-valid-archs.gyp +28 -0
  647. data/ext/gyp/test/mac/bundle-resources/change.sh +3 -0
  648. data/ext/gyp/test/mac/bundle-resources/executable-file.sh +3 -0
  649. data/ext/gyp/test/mac/bundle-resources/secret.txt +1 -0
  650. data/ext/gyp/test/mac/bundle-resources/test.gyp +59 -0
  651. data/ext/gyp/test/mac/cflags/ccfile.cc +7 -0
  652. data/ext/gyp/test/mac/cflags/ccfile_withcflags.cc +7 -0
  653. data/ext/gyp/test/mac/cflags/cfile.c +7 -0
  654. data/ext/gyp/test/mac/cflags/cppfile.cpp +7 -0
  655. data/ext/gyp/test/mac/cflags/cppfile_withcflags.cpp +7 -0
  656. data/ext/gyp/test/mac/cflags/cxxfile.cxx +7 -0
  657. data/ext/gyp/test/mac/cflags/cxxfile_withcflags.cxx +7 -0
  658. data/ext/gyp/test/mac/cflags/mfile.m +7 -0
  659. data/ext/gyp/test/mac/cflags/mmfile.mm +7 -0
  660. data/ext/gyp/test/mac/cflags/mmfile_withcflags.mm +7 -0
  661. data/ext/gyp/test/mac/cflags/test.gyp +132 -0
  662. data/ext/gyp/test/mac/clang-cxx-language-standard/c++11.cc +8 -0
  663. data/ext/gyp/test/mac/clang-cxx-language-standard/c++98.cc +24 -0
  664. data/ext/gyp/test/mac/clang-cxx-language-standard/clang-cxx-language-standard.gyp +30 -0
  665. data/ext/gyp/test/mac/clang-cxx-library/clang-cxx-library.gyp +32 -0
  666. data/ext/gyp/test/mac/clang-cxx-library/libc++.cc +11 -0
  667. data/ext/gyp/test/mac/clang-cxx-library/libstdc++.cc +11 -0
  668. data/ext/gyp/test/mac/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +87 -0
  669. data/ext/gyp/test/mac/copies-with-xcode-envvars/empty.c +1 -0
  670. data/ext/gyp/test/mac/copies-with-xcode-envvars/file0 +1 -0
  671. data/ext/gyp/test/mac/copies-with-xcode-envvars/file1 +1 -0
  672. data/ext/gyp/test/mac/copies-with-xcode-envvars/file10 +1 -0
  673. data/ext/gyp/test/mac/copies-with-xcode-envvars/file11 +1 -0
  674. data/ext/gyp/test/mac/copies-with-xcode-envvars/file2 +1 -0
  675. data/ext/gyp/test/mac/copies-with-xcode-envvars/file3 +1 -0
  676. data/ext/gyp/test/mac/copies-with-xcode-envvars/file4 +1 -0
  677. data/ext/gyp/test/mac/copies-with-xcode-envvars/file5 +1 -0
  678. data/ext/gyp/test/mac/copies-with-xcode-envvars/file6 +1 -0
  679. data/ext/gyp/test/mac/copies-with-xcode-envvars/file7 +1 -0
  680. data/ext/gyp/test/mac/copies-with-xcode-envvars/file8 +1 -0
  681. data/ext/gyp/test/mac/copies-with-xcode-envvars/file9 +1 -0
  682. data/ext/gyp/test/mac/copy-dylib/empty.c +1 -0
  683. data/ext/gyp/test/mac/copy-dylib/test.gyp +31 -0
  684. data/ext/gyp/test/mac/debuginfo/file.c +6 -0
  685. data/ext/gyp/test/mac/debuginfo/test.gyp +82 -0
  686. data/ext/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings +1 -0
  687. data/ext/gyp/test/mac/depend-on-bundle/Info.plist +28 -0
  688. data/ext/gyp/test/mac/depend-on-bundle/bundle.c +1 -0
  689. data/ext/gyp/test/mac/depend-on-bundle/executable.c +4 -0
  690. data/ext/gyp/test/mac/depend-on-bundle/test.gyp +28 -0
  691. data/ext/gyp/test/mac/deployment-target/check-version-min.c +33 -0
  692. data/ext/gyp/test/mac/deployment-target/deployment-target.gyp +28 -0
  693. data/ext/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings +2 -0
  694. data/ext/gyp/test/mac/framework/TestFramework/Info.plist +28 -0
  695. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.h +28 -0
  696. data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.mm +63 -0
  697. data/ext/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h +9 -0
  698. data/ext/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch +7 -0
  699. data/ext/gyp/test/mac/framework/empty.c +0 -0
  700. data/ext/gyp/test/mac/framework/framework.gyp +108 -0
  701. data/ext/gyp/test/mac/framework-dirs/calculate.c +15 -0
  702. data/ext/gyp/test/mac/framework-dirs/framework-dirs.gyp +21 -0
  703. data/ext/gyp/test/mac/framework-headers/myframework.h +8 -0
  704. data/ext/gyp/test/mac/framework-headers/myframework.m +8 -0
  705. data/ext/gyp/test/mac/framework-headers/test.gyp +44 -0
  706. data/ext/gyp/test/mac/global-settings/src/dir1/dir1.gyp +11 -0
  707. data/ext/gyp/test/mac/global-settings/src/dir2/dir2.gyp +22 -0
  708. data/ext/gyp/test/mac/global-settings/src/dir2/file.txt +1 -0
  709. data/ext/gyp/test/mac/gyptest-action-envvars.py +36 -0
  710. data/ext/gyp/test/mac/gyptest-app-assets-catalog.py +125 -0
  711. data/ext/gyp/test/mac/gyptest-app-error.py +49 -0
  712. data/ext/gyp/test/mac/gyptest-app.py +122 -0
  713. data/ext/gyp/test/mac/gyptest-archs.py +96 -0
  714. data/ext/gyp/test/mac/gyptest-bundle-resources.py +64 -0
  715. data/ext/gyp/test/mac/gyptest-cflags.py +21 -0
  716. data/ext/gyp/test/mac/gyptest-clang-cxx-language-standard.py +25 -0
  717. data/ext/gyp/test/mac/gyptest-clang-cxx-library.py +32 -0
  718. data/ext/gyp/test/mac/gyptest-copies-with-xcode-envvars.py +65 -0
  719. data/ext/gyp/test/mac/gyptest-copies.py +62 -0
  720. data/ext/gyp/test/mac/gyptest-copy-dylib.py +25 -0
  721. data/ext/gyp/test/mac/gyptest-debuginfo.py +36 -0
  722. data/ext/gyp/test/mac/gyptest-depend-on-bundle.py +45 -0
  723. data/ext/gyp/test/mac/gyptest-deployment-target.py +27 -0
  724. data/ext/gyp/test/mac/gyptest-framework-dirs.py +23 -0
  725. data/ext/gyp/test/mac/gyptest-framework-headers.py +38 -0
  726. data/ext/gyp/test/mac/gyptest-framework.py +80 -0
  727. data/ext/gyp/test/mac/gyptest-global-settings.py +33 -0
  728. data/ext/gyp/test/mac/gyptest-identical-name.py +45 -0
  729. data/ext/gyp/test/mac/gyptest-infoplist-process.py +56 -0
  730. data/ext/gyp/test/mac/gyptest-installname.py +85 -0
  731. data/ext/gyp/test/mac/gyptest-kext.py +27 -0
  732. data/ext/gyp/test/mac/gyptest-ldflags-passed-to-libtool.py +37 -0
  733. data/ext/gyp/test/mac/gyptest-ldflags.py +74 -0
  734. data/ext/gyp/test/mac/gyptest-libraries.py +30 -0
  735. data/ext/gyp/test/mac/gyptest-libtool-zero.py +26 -0
  736. data/ext/gyp/test/mac/gyptest-loadable-module-bundle-product-extension.py +31 -0
  737. data/ext/gyp/test/mac/gyptest-loadable-module.py +54 -0
  738. data/ext/gyp/test/mac/gyptest-lto.py +66 -0
  739. data/ext/gyp/test/mac/gyptest-missing-cfbundlesignature.py +34 -0
  740. data/ext/gyp/test/mac/gyptest-non-strs-flattened-to-env.py +38 -0
  741. data/ext/gyp/test/mac/gyptest-objc-arc.py +27 -0
  742. data/ext/gyp/test/mac/gyptest-objc-gc.py +51 -0
  743. data/ext/gyp/test/mac/gyptest-postbuild-copy-bundle.py +75 -0
  744. data/ext/gyp/test/mac/gyptest-postbuild-defaults.py +34 -0
  745. data/ext/gyp/test/mac/gyptest-postbuild-fail.py +71 -0
  746. data/ext/gyp/test/mac/gyptest-postbuild-multiple-configurations.py +26 -0
  747. data/ext/gyp/test/mac/gyptest-postbuild-static-library.py +28 -0
  748. data/ext/gyp/test/mac/gyptest-postbuild.py +53 -0
  749. data/ext/gyp/test/mac/gyptest-prefixheader.py +20 -0
  750. data/ext/gyp/test/mac/gyptest-rebuild.py +46 -0
  751. data/ext/gyp/test/mac/gyptest-rpath.py +50 -0
  752. data/ext/gyp/test/mac/gyptest-sdkroot.py +56 -0
  753. data/ext/gyp/test/mac/gyptest-sourceless-module.py +77 -0
  754. data/ext/gyp/test/mac/gyptest-strip-default.py +97 -0
  755. data/ext/gyp/test/mac/gyptest-strip.py +66 -0
  756. data/ext/gyp/test/mac/gyptest-swift-library.py +67 -0
  757. data/ext/gyp/test/mac/gyptest-type-envvars.py +26 -0
  758. data/ext/gyp/test/mac/gyptest-unicode-settings.py +20 -0
  759. data/ext/gyp/test/mac/gyptest-xcode-env-order.py +95 -0
  760. data/ext/gyp/test/mac/gyptest-xcode-gcc-clang.py +40 -0
  761. data/ext/gyp/test/mac/gyptest-xcode-gcc.py +60 -0
  762. data/ext/gyp/test/mac/gyptest-xcode-support-actions.py +25 -0
  763. data/ext/gyp/test/mac/gyptest-xctest.py +41 -0
  764. data/ext/gyp/test/mac/gyptest-xcuitest.py +39 -0
  765. data/ext/gyp/test/mac/identical-name/proxy/proxy.cc +2 -0
  766. data/ext/gyp/test/mac/identical-name/proxy/proxy.gyp +9 -0
  767. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.cc +2 -0
  768. data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.gyp +8 -0
  769. data/ext/gyp/test/mac/identical-name/test-should-fail.gyp +10 -0
  770. data/ext/gyp/test/mac/identical-name/test.gyp +11 -0
  771. data/ext/gyp/test/mac/identical-name/test.gypi +7 -0
  772. data/ext/gyp/test/mac/identical-name/testlib/main.cc +3 -0
  773. data/ext/gyp/test/mac/identical-name/testlib/testlib.gyp +14 -0
  774. data/ext/gyp/test/mac/identical-name/testlib/void.cc +2 -0
  775. data/ext/gyp/test/mac/infoplist-process/Info.plist +36 -0
  776. data/ext/gyp/test/mac/infoplist-process/main.c +7 -0
  777. data/ext/gyp/test/mac/infoplist-process/test1.gyp +25 -0
  778. data/ext/gyp/test/mac/infoplist-process/test2.gyp +25 -0
  779. data/ext/gyp/test/mac/infoplist-process/test3.gyp +25 -0
  780. data/ext/gyp/test/mac/installname/Info.plist +28 -0
  781. data/ext/gyp/test/mac/installname/file.c +1 -0
  782. data/ext/gyp/test/mac/installname/main.c +1 -0
  783. data/ext/gyp/test/mac/installname/test.gyp +93 -0
  784. data/ext/gyp/test/mac/kext/GypKext/GypKext-Info.plist +35 -0
  785. data/ext/gyp/test/mac/kext/GypKext/GypKext.c +16 -0
  786. data/ext/gyp/test/mac/kext/kext.gyp +18 -0
  787. data/ext/gyp/test/mac/ldflags/subdirectory/Info.plist +8 -0
  788. data/ext/gyp/test/mac/ldflags/subdirectory/file.c +2 -0
  789. data/ext/gyp/test/mac/ldflags/subdirectory/symbol_list.def +1 -0
  790. data/ext/gyp/test/mac/ldflags/subdirectory/test.gyp +66 -0
  791. data/ext/gyp/test/mac/ldflags-libtool/file.c +1 -0
  792. data/ext/gyp/test/mac/ldflags-libtool/test.gyp +17 -0
  793. data/ext/gyp/test/mac/libraries/subdir/README.txt +1 -0
  794. data/ext/gyp/test/mac/libraries/subdir/hello.cc +10 -0
  795. data/ext/gyp/test/mac/libraries/subdir/mylib.c +7 -0
  796. data/ext/gyp/test/mac/libraries/subdir/test.gyp +65 -0
  797. data/ext/gyp/test/mac/libtool-zero/mylib.c +7 -0
  798. data/ext/gyp/test/mac/libtool-zero/test.gyp +18 -0
  799. data/ext/gyp/test/mac/loadable-module/Info.plist +26 -0
  800. data/ext/gyp/test/mac/loadable-module/module.c +11 -0
  801. data/ext/gyp/test/mac/loadable-module/test.gyp +18 -0
  802. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/src.cc +7 -0
  803. data/ext/gyp/test/mac/loadable-module-bundle-product-extension/test.gyp +24 -0
  804. data/ext/gyp/test/mac/lto/asmfile.S +2 -0
  805. data/ext/gyp/test/mac/lto/ccfile.cc +1 -0
  806. data/ext/gyp/test/mac/lto/cfile.c +1 -0
  807. data/ext/gyp/test/mac/lto/mfile.m +1 -0
  808. data/ext/gyp/test/mac/lto/mmfile.mm +1 -0
  809. data/ext/gyp/test/mac/lto/test.gyp +35 -0
  810. data/ext/gyp/test/mac/missing-cfbundlesignature/Info.plist +10 -0
  811. data/ext/gyp/test/mac/missing-cfbundlesignature/Other-Info.plist +12 -0
  812. data/ext/gyp/test/mac/missing-cfbundlesignature/Third-Info.plist +12 -0
  813. data/ext/gyp/test/mac/missing-cfbundlesignature/file.c +1 -0
  814. data/ext/gyp/test/mac/missing-cfbundlesignature/test.gyp +34 -0
  815. data/ext/gyp/test/mac/non-strs-flattened-to-env/Info.plist +15 -0
  816. data/ext/gyp/test/mac/non-strs-flattened-to-env/main.c +7 -0
  817. data/ext/gyp/test/mac/non-strs-flattened-to-env/test.gyp +27 -0
  818. data/ext/gyp/test/mac/objc-arc/c-file.c +5 -0
  819. data/ext/gyp/test/mac/objc-arc/cc-file.cc +5 -0
  820. data/ext/gyp/test/mac/objc-arc/m-file-arc-weak.m +9 -0
  821. data/ext/gyp/test/mac/objc-arc/m-file-no-arc.m +9 -0
  822. data/ext/gyp/test/mac/objc-arc/m-file.m +9 -0
  823. data/ext/gyp/test/mac/objc-arc/mm-file-arc-weak.mm +9 -0
  824. data/ext/gyp/test/mac/objc-arc/mm-file-no-arc.mm +9 -0
  825. data/ext/gyp/test/mac/objc-arc/mm-file.mm +9 -0
  826. data/ext/gyp/test/mac/objc-arc/test.gyp +53 -0
  827. data/ext/gyp/test/mac/objc-gc/c-file.c +1 -0
  828. data/ext/gyp/test/mac/objc-gc/cc-file.cc +1 -0
  829. data/ext/gyp/test/mac/objc-gc/main.m +6 -0
  830. data/ext/gyp/test/mac/objc-gc/needs-gc-mm.mm +1 -0
  831. data/ext/gyp/test/mac/objc-gc/needs-gc.m +1 -0
  832. data/ext/gyp/test/mac/objc-gc/test.gyp +102 -0
  833. data/ext/gyp/test/mac/postbuild-copy-bundle/Framework-Info.plist +30 -0
  834. data/ext/gyp/test/mac/postbuild-copy-bundle/TestApp-Info.plist +32 -0
  835. data/ext/gyp/test/mac/postbuild-copy-bundle/copied.txt +1 -0
  836. data/ext/gyp/test/mac/postbuild-copy-bundle/empty.c +0 -0
  837. data/ext/gyp/test/mac/postbuild-copy-bundle/main.c +4 -0
  838. data/ext/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh +9 -0
  839. data/ext/gyp/test/mac/postbuild-copy-bundle/resource_file.sb +1 -0
  840. data/ext/gyp/test/mac/postbuild-copy-bundle/test.gyp +49 -0
  841. data/ext/gyp/test/mac/postbuild-defaults/Info.plist +13 -0
  842. data/ext/gyp/test/mac/postbuild-defaults/main.c +7 -0
  843. data/ext/gyp/test/mac/postbuild-defaults/postbuild-defaults.sh +15 -0
  844. data/ext/gyp/test/mac/postbuild-defaults/test.gyp +26 -0
  845. data/ext/gyp/test/mac/postbuild-fail/file.c +6 -0
  846. data/ext/gyp/test/mac/postbuild-fail/postbuild-fail.sh +6 -0
  847. data/ext/gyp/test/mac/postbuild-fail/test.gyp +38 -0
  848. data/ext/gyp/test/mac/postbuild-fail/touch-dynamic.sh +7 -0
  849. data/ext/gyp/test/mac/postbuild-fail/touch-static.sh +7 -0
  850. data/ext/gyp/test/mac/postbuild-multiple-configurations/main.c +4 -0
  851. data/ext/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh +7 -0
  852. data/ext/gyp/test/mac/postbuild-multiple-configurations/test.gyp +26 -0
  853. data/ext/gyp/test/mac/postbuild-static-library/empty.c +4 -0
  854. data/ext/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh +7 -0
  855. data/ext/gyp/test/mac/postbuild-static-library/test.gyp +34 -0
  856. data/ext/gyp/test/mac/postbuilds/copy.sh +3 -0
  857. data/ext/gyp/test/mac/postbuilds/file.c +4 -0
  858. data/ext/gyp/test/mac/postbuilds/file_g.c +4 -0
  859. data/ext/gyp/test/mac/postbuilds/file_h.c +4 -0
  860. data/ext/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh +23 -0
  861. data/ext/gyp/test/mac/postbuilds/script/static_library_postbuild.sh +23 -0
  862. data/ext/gyp/test/mac/postbuilds/subdirectory/copied_file.txt +1 -0
  863. data/ext/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp +53 -0
  864. data/ext/gyp/test/mac/postbuilds/test.gyp +93 -0
  865. data/ext/gyp/test/mac/prefixheader/file.c +1 -0
  866. data/ext/gyp/test/mac/prefixheader/file.cc +1 -0
  867. data/ext/gyp/test/mac/prefixheader/file.m +1 -0
  868. data/ext/gyp/test/mac/prefixheader/file.mm +1 -0
  869. data/ext/gyp/test/mac/prefixheader/header.h +1 -0
  870. data/ext/gyp/test/mac/prefixheader/test.gyp +82 -0
  871. data/ext/gyp/test/mac/rebuild/TestApp-Info.plist +32 -0
  872. data/ext/gyp/test/mac/rebuild/delay-touch.sh +6 -0
  873. data/ext/gyp/test/mac/rebuild/empty.c +0 -0
  874. data/ext/gyp/test/mac/rebuild/main.c +1 -0
  875. data/ext/gyp/test/mac/rebuild/test.gyp +56 -0
  876. data/ext/gyp/test/mac/rpath/file.c +1 -0
  877. data/ext/gyp/test/mac/rpath/main.c +1 -0
  878. data/ext/gyp/test/mac/rpath/test.gyp +48 -0
  879. data/ext/gyp/test/mac/sdkroot/file.cc +5 -0
  880. data/ext/gyp/test/mac/sdkroot/test.gyp +35 -0
  881. data/ext/gyp/test/mac/sdkroot/test_shorthand.sh +20 -0
  882. data/ext/gyp/test/mac/sourceless-module/empty.c +1 -0
  883. data/ext/gyp/test/mac/sourceless-module/empty.txt +2 -0
  884. data/ext/gyp/test/mac/sourceless-module/fun.c +1 -0
  885. data/ext/gyp/test/mac/sourceless-module/test.gyp +96 -0
  886. data/ext/gyp/test/mac/strip/file.c +22 -0
  887. data/ext/gyp/test/mac/strip/main.c +25 -0
  888. data/ext/gyp/test/mac/strip/strip.saves +5 -0
  889. data/ext/gyp/test/mac/strip/subdirectory/nested_file.c +1 -0
  890. data/ext/gyp/test/mac/strip/subdirectory/nested_strip.saves +5 -0
  891. data/ext/gyp/test/mac/strip/subdirectory/subdirectory.gyp +38 -0
  892. data/ext/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh +5 -0
  893. data/ext/gyp/test/mac/strip/test-defaults.gyp +51 -0
  894. data/ext/gyp/test/mac/strip/test.gyp +119 -0
  895. data/ext/gyp/test/mac/swift-library/Info.plist +28 -0
  896. data/ext/gyp/test/mac/swift-library/file.swift +9 -0
  897. data/ext/gyp/test/mac/swift-library/test.gyp +21 -0
  898. data/ext/gyp/test/mac/type_envvars/file.c +6 -0
  899. data/ext/gyp/test/mac/type_envvars/test.gyp +100 -0
  900. data/ext/gyp/test/mac/type_envvars/test_bundle_executable.sh +30 -0
  901. data/ext/gyp/test/mac/type_envvars/test_bundle_loadable_module.sh +35 -0
  902. data/ext/gyp/test/mac/type_envvars/test_bundle_shared_library.sh +38 -0
  903. data/ext/gyp/test/mac/type_envvars/test_check_sdkroot.sh +47 -0
  904. data/ext/gyp/test/mac/type_envvars/test_nonbundle_executable.sh +33 -0
  905. data/ext/gyp/test/mac/type_envvars/test_nonbundle_loadable_module.sh +31 -0
  906. data/ext/gyp/test/mac/type_envvars/test_nonbundle_none.sh +32 -0
  907. data/ext/gyp/test/mac/type_envvars/test_nonbundle_shared_library.sh +31 -0
  908. data/ext/gyp/test/mac/type_envvars/test_nonbundle_static_library.sh +31 -0
  909. data/ext/gyp/test/mac/unicode-settings/file.cc +2 -0
  910. data/ext/gyp/test/mac/unicode-settings/test.gyp +23 -0
  911. data/ext/gyp/test/mac/unicode-settings/test_bundle_display_name.sh +7 -0
  912. data/ext/gyp/test/mac/xcode-env-order/Info.plist +56 -0
  913. data/ext/gyp/test/mac/xcode-env-order/file.ext1 +0 -0
  914. data/ext/gyp/test/mac/xcode-env-order/file.ext2 +0 -0
  915. data/ext/gyp/test/mac/xcode-env-order/file.ext3 +0 -0
  916. data/ext/gyp/test/mac/xcode-env-order/main.c +7 -0
  917. data/ext/gyp/test/mac/xcode-env-order/test.gyp +121 -0
  918. data/ext/gyp/test/mac/xcode-gcc/aliasing.cc +13 -0
  919. data/ext/gyp/test/mac/xcode-gcc/test-clang.gyp +42 -0
  920. data/ext/gyp/test/mac/xcode-gcc/test.gyp +60 -0
  921. data/ext/gyp/test/mac/xcode-gcc/valid_c.c +8 -0
  922. data/ext/gyp/test/mac/xcode-gcc/valid_cc.cc +8 -0
  923. data/ext/gyp/test/mac/xcode-gcc/valid_m.m +8 -0
  924. data/ext/gyp/test/mac/xcode-gcc/valid_mm.mm +8 -0
  925. data/ext/gyp/test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc +15 -0
  926. data/ext/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c +8 -0
  927. data/ext/gyp/test/mac/xcode-support-actions/source.c +0 -0
  928. data/ext/gyp/test/mac/xcode-support-actions/test.gyp +26 -0
  929. data/ext/gyp/test/mac/xctest/MyClass.h +8 -0
  930. data/ext/gyp/test/mac/xctest/MyClass.m +8 -0
  931. data/ext/gyp/test/mac/xctest/TestCase.m +16 -0
  932. data/ext/gyp/test/mac/xctest/resource.txt +1 -0
  933. data/ext/gyp/test/mac/xctest/test.gyp +47 -0
  934. data/ext/gyp/test/mac/xctest/test.xcodeproj/xcshareddata/xcschemes/classes.xcscheme +69 -0
  935. data/ext/gyp/test/mac/xcuitest/Info.plist +28 -0
  936. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.h +8 -0
  937. data/ext/gyp/test/mac/xcuitest/MyAppDelegate.m +19 -0
  938. data/ext/gyp/test/mac/xcuitest/TestCase.m +15 -0
  939. data/ext/gyp/test/mac/xcuitest/main.m +15 -0
  940. data/ext/gyp/test/mac/xcuitest/resource.txt +1 -0
  941. data/ext/gyp/test/mac/xcuitest/test.gyp +69 -0
  942. data/ext/gyp/test/make/dependencies.gyp +15 -0
  943. data/ext/gyp/test/make/gyptest-dependencies.py +26 -0
  944. data/ext/gyp/test/make/gyptest-noload.py +57 -0
  945. data/ext/gyp/test/make/main.cc +12 -0
  946. data/ext/gyp/test/make/main.h +0 -0
  947. data/ext/gyp/test/make/noload/all.gyp +18 -0
  948. data/ext/gyp/test/make/noload/lib/shared.c +3 -0
  949. data/ext/gyp/test/make/noload/lib/shared.gyp +16 -0
  950. data/ext/gyp/test/make/noload/lib/shared.h +1 -0
  951. data/ext/gyp/test/make/noload/main.c +9 -0
  952. data/ext/gyp/test/make_global_settings/ar/gyptest-make_global_settings_ar.py +126 -0
  953. data/ext/gyp/test/make_global_settings/ar/make_global_settings_ar.gyp +29 -0
  954. data/ext/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py +51 -0
  955. data/ext/gyp/test/make_global_settings/basics/make_global_settings.gyp +17 -0
  956. data/ext/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py +51 -0
  957. data/ext/gyp/test/make_global_settings/env-wrapper/wrapper.gyp +17 -0
  958. data/ext/gyp/test/make_global_settings/full-toolchain/bar.cc +1 -0
  959. data/ext/gyp/test/make_global_settings/full-toolchain/foo.c +1 -0
  960. data/ext/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py +53 -0
  961. data/ext/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp +22 -0
  962. data/ext/gyp/test/make_global_settings/full-toolchain/my_nm.py +9 -0
  963. data/ext/gyp/test/make_global_settings/full-toolchain/my_readelf.py +9 -0
  964. data/ext/gyp/test/make_global_settings/ld/gyptest-make_global_settings_ld.py +130 -0
  965. data/ext/gyp/test/make_global_settings/ld/make_global_settings_ld.gyp +29 -0
  966. data/ext/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py +52 -0
  967. data/ext/gyp/test/make_global_settings/wrapper/wrapper.gyp +21 -0
  968. data/ext/gyp/test/many-actions/file0 +0 -0
  969. data/ext/gyp/test/many-actions/file1 +0 -0
  970. data/ext/gyp/test/many-actions/file2 +0 -0
  971. data/ext/gyp/test/many-actions/file3 +0 -0
  972. data/ext/gyp/test/many-actions/file4 +0 -0
  973. data/ext/gyp/test/many-actions/gyptest-many-actions-unsorted.py +43 -0
  974. data/ext/gyp/test/many-actions/gyptest-many-actions.py +29 -0
  975. data/ext/gyp/test/many-actions/many-actions-unsorted.gyp +154 -0
  976. data/ext/gyp/test/many-actions/many-actions.gyp +1817 -0
  977. data/ext/gyp/test/module/gyptest-default.py +28 -0
  978. data/ext/gyp/test/module/src/lib1.c +10 -0
  979. data/ext/gyp/test/module/src/lib2.c +10 -0
  980. data/ext/gyp/test/module/src/module.gyp +53 -0
  981. data/ext/gyp/test/module/src/program.c +111 -0
  982. data/ext/gyp/test/msvs/buildevents/buildevents.gyp +14 -0
  983. data/ext/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py +24 -0
  984. data/ext/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py +29 -0
  985. data/ext/gyp/test/msvs/buildevents/main.cc +5 -0
  986. data/ext/gyp/test/msvs/config_attrs/gyptest-config_attrs.py +41 -0
  987. data/ext/gyp/test/msvs/config_attrs/hello.c +11 -0
  988. data/ext/gyp/test/msvs/config_attrs/hello.gyp +21 -0
  989. data/ext/gyp/test/msvs/express/base/base.gyp +22 -0
  990. data/ext/gyp/test/msvs/express/express.gyp +19 -0
  991. data/ext/gyp/test/msvs/express/gyptest-express.py +29 -0
  992. data/ext/gyp/test/msvs/external_builder/external.gyp +68 -0
  993. data/ext/gyp/test/msvs/external_builder/external_builder.py +9 -0
  994. data/ext/gyp/test/msvs/external_builder/gyptest-all.py +59 -0
  995. data/ext/gyp/test/msvs/external_builder/hello.cpp +10 -0
  996. data/ext/gyp/test/msvs/external_builder/hello.z +6 -0
  997. data/ext/gyp/test/msvs/external_builder/msbuild_action.py +9 -0
  998. data/ext/gyp/test/msvs/external_builder/msbuild_rule.py +11 -0
  999. data/ext/gyp/test/msvs/filters/filters.gyp +47 -0
  1000. data/ext/gyp/test/msvs/filters/gyptest-filters-2008.py +68 -0
  1001. data/ext/gyp/test/msvs/filters/gyptest-filters-2010.py +57 -0
  1002. data/ext/gyp/test/msvs/list_excluded/gyptest-all.py +51 -0
  1003. data/ext/gyp/test/msvs/list_excluded/hello.cpp +10 -0
  1004. data/ext/gyp/test/msvs/list_excluded/hello_exclude.gyp +19 -0
  1005. data/ext/gyp/test/msvs/list_excluded/hello_mac.cpp +10 -0
  1006. data/ext/gyp/test/msvs/missing_sources/gyptest-missing.py +43 -0
  1007. data/ext/gyp/test/msvs/missing_sources/hello_missing.gyp +15 -0
  1008. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_fail.py +7 -0
  1009. data/ext/gyp/test/msvs/multiple_actions_error_handling/action_succeed.py +7 -0
  1010. data/ext/gyp/test/msvs/multiple_actions_error_handling/actions.gyp +40 -0
  1011. data/ext/gyp/test/msvs/multiple_actions_error_handling/gyptest.py +26 -0
  1012. data/ext/gyp/test/msvs/props/AppName.props +14 -0
  1013. data/ext/gyp/test/msvs/props/AppName.vsprops +11 -0
  1014. data/ext/gyp/test/msvs/props/gyptest-props.py +22 -0
  1015. data/ext/gyp/test/msvs/props/hello.c +11 -0
  1016. data/ext/gyp/test/msvs/props/hello.gyp +22 -0
  1017. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.bar +5 -0
  1018. data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.foo +5 -0
  1019. data/ext/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py +29 -0
  1020. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py +8 -0
  1021. data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py +7 -0
  1022. data/ext/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp +52 -0
  1023. data/ext/gyp/test/msvs/shared_output/common.gypi +17 -0
  1024. data/ext/gyp/test/msvs/shared_output/gyptest-shared_output.py +41 -0
  1025. data/ext/gyp/test/msvs/shared_output/hello.c +12 -0
  1026. data/ext/gyp/test/msvs/shared_output/hello.gyp +21 -0
  1027. data/ext/gyp/test/msvs/shared_output/there/there.c +12 -0
  1028. data/ext/gyp/test/msvs/shared_output/there/there.gyp +16 -0
  1029. data/ext/gyp/test/msvs/uldi2010/gyptest-all.py +20 -0
  1030. data/ext/gyp/test/msvs/uldi2010/hello.c +13 -0
  1031. data/ext/gyp/test/msvs/uldi2010/hello.gyp +26 -0
  1032. data/ext/gyp/test/msvs/uldi2010/hello2.c +10 -0
  1033. data/ext/gyp/test/multiple-targets/gyptest-all.py +30 -0
  1034. data/ext/gyp/test/multiple-targets/gyptest-default.py +30 -0
  1035. data/ext/gyp/test/multiple-targets/src/common.c +7 -0
  1036. data/ext/gyp/test/multiple-targets/src/multiple.gyp +24 -0
  1037. data/ext/gyp/test/multiple-targets/src/prog1.c +10 -0
  1038. data/ext/gyp/test/multiple-targets/src/prog2.c +10 -0
  1039. data/ext/gyp/test/ninja/action-rule-hash/gyptest-action-rule-hash.py +32 -0
  1040. data/ext/gyp/test/ninja/action-rule-hash/subdir/action-rule-hash.gyp +29 -0
  1041. data/ext/gyp/test/ninja/action-rule-hash/subdir/emit.py +13 -0
  1042. data/ext/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py +64 -0
  1043. data/ext/gyp/test/ninja/action_dependencies/src/a.c +10 -0
  1044. data/ext/gyp/test/ninja/action_dependencies/src/a.h +13 -0
  1045. data/ext/gyp/test/ninja/action_dependencies/src/action_dependencies.gyp +88 -0
  1046. data/ext/gyp/test/ninja/action_dependencies/src/b.c +18 -0
  1047. data/ext/gyp/test/ninja/action_dependencies/src/b.h +13 -0
  1048. data/ext/gyp/test/ninja/action_dependencies/src/c.c +10 -0
  1049. data/ext/gyp/test/ninja/action_dependencies/src/c.h +13 -0
  1050. data/ext/gyp/test/ninja/action_dependencies/src/emit.py +11 -0
  1051. data/ext/gyp/test/ninja/chained-dependency/chained-dependency.gyp +53 -0
  1052. data/ext/gyp/test/ninja/chained-dependency/chained.c +5 -0
  1053. data/ext/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py +30 -0
  1054. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py +23 -0
  1055. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/subdir/included.gyp +19 -0
  1056. data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/test.gyp +19 -0
  1057. data/ext/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py +46 -0
  1058. data/ext/gyp/test/ninja/normalize-paths-win/hello.cc +7 -0
  1059. data/ext/gyp/test/ninja/normalize-paths-win/normalize-paths.gyp +68 -0
  1060. data/ext/gyp/test/ninja/s-needs-no-depfiles/empty.s +1 -0
  1061. data/ext/gyp/test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py +42 -0
  1062. data/ext/gyp/test/ninja/s-needs-no-depfiles/s-needs-no-depfiles.gyp +13 -0
  1063. data/ext/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py +48 -0
  1064. data/ext/gyp/test/ninja/solibs_avoid_relinking/main.cc +5 -0
  1065. data/ext/gyp/test/ninja/solibs_avoid_relinking/solib.cc +8 -0
  1066. data/ext/gyp/test/ninja/solibs_avoid_relinking/solibs_avoid_relinking.gyp +38 -0
  1067. data/ext/gyp/test/ninja/use-console/foo.bar +5 -0
  1068. data/ext/gyp/test/ninja/use-console/gyptest-use-console.py +29 -0
  1069. data/ext/gyp/test/ninja/use-console/use-console.gyp +60 -0
  1070. data/ext/gyp/test/ninja/use-custom-environment-files/gyptest-use-custom-environment-files.py +28 -0
  1071. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc +7 -0
  1072. data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.gyp +15 -0
  1073. data/ext/gyp/test/no-cpp/gyptest-no-cpp.py +53 -0
  1074. data/ext/gyp/test/no-cpp/src/call-f-main.c +2 -0
  1075. data/ext/gyp/test/no-cpp/src/empty-main.c +1 -0
  1076. data/ext/gyp/test/no-cpp/src/f.cc +3 -0
  1077. data/ext/gyp/test/no-cpp/src/test.gyp +25 -0
  1078. data/ext/gyp/test/no-output/gyptest-no-output.py +21 -0
  1079. data/ext/gyp/test/no-output/src/nooutput.gyp +17 -0
  1080. data/ext/gyp/test/product/gyptest-product.py +43 -0
  1081. data/ext/gyp/test/product/hello.c +15 -0
  1082. data/ext/gyp/test/product/product.gyp +128 -0
  1083. data/ext/gyp/test/prune_targets/gyptest-prune-targets.py +66 -0
  1084. data/ext/gyp/test/prune_targets/lib1.cc +6 -0
  1085. data/ext/gyp/test/prune_targets/lib2.cc +6 -0
  1086. data/ext/gyp/test/prune_targets/lib3.cc +6 -0
  1087. data/ext/gyp/test/prune_targets/lib_indirect.cc +6 -0
  1088. data/ext/gyp/test/prune_targets/program.cc +7 -0
  1089. data/ext/gyp/test/prune_targets/test1.gyp +26 -0
  1090. data/ext/gyp/test/prune_targets/test2.gyp +30 -0
  1091. data/ext/gyp/test/relative/foo/a/a.cc +9 -0
  1092. data/ext/gyp/test/relative/foo/a/a.gyp +13 -0
  1093. data/ext/gyp/test/relative/foo/a/c/c.cc +9 -0
  1094. data/ext/gyp/test/relative/foo/a/c/c.gyp +12 -0
  1095. data/ext/gyp/test/relative/foo/b/b.cc +9 -0
  1096. data/ext/gyp/test/relative/foo/b/b.gyp +9 -0
  1097. data/ext/gyp/test/relative/gyptest-default.py +25 -0
  1098. data/ext/gyp/test/rename/filecase/file.c +1 -0
  1099. data/ext/gyp/test/rename/filecase/test-casesensitive.gyp +15 -0
  1100. data/ext/gyp/test/rename/filecase/test.gyp +14 -0
  1101. data/ext/gyp/test/rename/gyptest-filecase.py +35 -0
  1102. data/ext/gyp/test/restat/gyptest-restat.py +31 -0
  1103. data/ext/gyp/test/restat/src/create_intermediate.py +17 -0
  1104. data/ext/gyp/test/restat/src/restat.gyp +50 -0
  1105. data/ext/gyp/test/restat/src/touch.py +16 -0
  1106. data/ext/gyp/test/rules/gyptest-all.py +84 -0
  1107. data/ext/gyp/test/rules/gyptest-default.py +70 -0
  1108. data/ext/gyp/test/rules/gyptest-input-root.py +26 -0
  1109. data/ext/gyp/test/rules/gyptest-special-variables.py +18 -0
  1110. data/ext/gyp/test/rules/src/actions.gyp +23 -0
  1111. data/ext/gyp/test/rules/src/an_asm.S +6 -0
  1112. data/ext/gyp/test/rules/src/as.bat +7 -0
  1113. data/ext/gyp/test/rules/src/copy-file.py +11 -0
  1114. data/ext/gyp/test/rules/src/external/external.gyp +66 -0
  1115. data/ext/gyp/test/rules/src/external/file1.in +1 -0
  1116. data/ext/gyp/test/rules/src/external/file2.in +1 -0
  1117. data/ext/gyp/test/rules/src/input-root.gyp +24 -0
  1118. data/ext/gyp/test/rules/src/noaction/file1.in +1 -0
  1119. data/ext/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp +37 -0
  1120. data/ext/gyp/test/rules/src/rule.py +17 -0
  1121. data/ext/gyp/test/rules/src/somefile.ext +0 -0
  1122. data/ext/gyp/test/rules/src/special-variables.gyp +34 -0
  1123. data/ext/gyp/test/rules/src/subdir1/executable.gyp +37 -0
  1124. data/ext/gyp/test/rules/src/subdir1/function1.in +6 -0
  1125. data/ext/gyp/test/rules/src/subdir1/function2.in +6 -0
  1126. data/ext/gyp/test/rules/src/subdir1/program.c +12 -0
  1127. data/ext/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp +50 -0
  1128. data/ext/gyp/test/rules/src/subdir2/file1.in +1 -0
  1129. data/ext/gyp/test/rules/src/subdir2/file2.in +1 -0
  1130. data/ext/gyp/test/rules/src/subdir2/never_used.gyp +31 -0
  1131. data/ext/gyp/test/rules/src/subdir2/no_action.gyp +38 -0
  1132. data/ext/gyp/test/rules/src/subdir2/no_inputs.gyp +32 -0
  1133. data/ext/gyp/test/rules/src/subdir2/none.gyp +33 -0
  1134. data/ext/gyp/test/rules/src/subdir2/program.c +12 -0
  1135. data/ext/gyp/test/rules/src/subdir3/executable2.gyp +37 -0
  1136. data/ext/gyp/test/rules/src/subdir3/function3.in +6 -0
  1137. data/ext/gyp/test/rules/src/subdir3/program.c +10 -0
  1138. data/ext/gyp/test/rules/src/subdir4/asm-function.assem +10 -0
  1139. data/ext/gyp/test/rules/src/subdir4/build-asm.gyp +49 -0
  1140. data/ext/gyp/test/rules/src/subdir4/program.c +19 -0
  1141. data/ext/gyp/test/rules-dirname/gyptest-dirname.py +57 -0
  1142. data/ext/gyp/test/rules-dirname/src/actions.gyp +15 -0
  1143. data/ext/gyp/test/rules-dirname/src/copy-file.py +11 -0
  1144. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.gencc +8 -0
  1145. data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.printvars +1 -0
  1146. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc +8 -0
  1147. data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars +1 -0
  1148. data/ext/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp +140 -0
  1149. data/ext/gyp/test/rules-dirname/src/subdir/main.cc +14 -0
  1150. data/ext/gyp/test/rules-dirname/src/subdir/nodir.gencc +8 -0
  1151. data/ext/gyp/test/rules-dirname/src/subdir/printvars.py +14 -0
  1152. data/ext/gyp/test/rules-rebuild/gyptest-all.py +70 -0
  1153. data/ext/gyp/test/rules-rebuild/gyptest-default.py +91 -0
  1154. data/ext/gyp/test/rules-rebuild/src/main.c +12 -0
  1155. data/ext/gyp/test/rules-rebuild/src/make-sources.py +19 -0
  1156. data/ext/gyp/test/rules-rebuild/src/prog1.in +7 -0
  1157. data/ext/gyp/test/rules-rebuild/src/prog2.in +7 -0
  1158. data/ext/gyp/test/rules-rebuild/src/same_target.gyp +31 -0
  1159. data/ext/gyp/test/rules-use-built-dependencies/gyptest-use-built-dependencies.py +23 -0
  1160. data/ext/gyp/test/rules-use-built-dependencies/src/main.cc +17 -0
  1161. data/ext/gyp/test/rules-use-built-dependencies/src/use-built-dependencies-rule.gyp +42 -0
  1162. data/ext/gyp/test/rules-variables/gyptest-rules-variables.py +35 -0
  1163. data/ext/gyp/test/rules-variables/src/input_ext.c +9 -0
  1164. data/ext/gyp/test/rules-variables/src/input_name/test.c +9 -0
  1165. data/ext/gyp/test/rules-variables/src/input_path/subdir/test.c +9 -0
  1166. data/ext/gyp/test/rules-variables/src/subdir/input_dirname.c +9 -0
  1167. data/ext/gyp/test/rules-variables/src/subdir/test.c +18 -0
  1168. data/ext/gyp/test/rules-variables/src/test.input_root.c +9 -0
  1169. data/ext/gyp/test/rules-variables/src/variables.gyp +40 -0
  1170. data/ext/gyp/test/same-gyp-name/gyptest-all.py +38 -0
  1171. data/ext/gyp/test/same-gyp-name/gyptest-default.py +38 -0
  1172. data/ext/gyp/test/same-gyp-name/gyptest-library.py +20 -0
  1173. data/ext/gyp/test/same-gyp-name/library/one/sub.gyp +11 -0
  1174. data/ext/gyp/test/same-gyp-name/library/test.gyp +15 -0
  1175. data/ext/gyp/test/same-gyp-name/library/two/sub.gyp +11 -0
  1176. data/ext/gyp/test/same-gyp-name/src/all.gyp +16 -0
  1177. data/ext/gyp/test/same-gyp-name/src/subdir1/executable.gyp +15 -0
  1178. data/ext/gyp/test/same-gyp-name/src/subdir1/main1.cc +6 -0
  1179. data/ext/gyp/test/same-gyp-name/src/subdir2/executable.gyp +15 -0
  1180. data/ext/gyp/test/same-gyp-name/src/subdir2/main2.cc +6 -0
  1181. data/ext/gyp/test/same-rule-output-file-name/gyptest-all.py +23 -0
  1182. data/ext/gyp/test/same-rule-output-file-name/src/subdir1/subdir1.gyp +30 -0
  1183. data/ext/gyp/test/same-rule-output-file-name/src/subdir2/subdir2.gyp +30 -0
  1184. data/ext/gyp/test/same-rule-output-file-name/src/subdirs.gyp +16 -0
  1185. data/ext/gyp/test/same-rule-output-file-name/src/touch.py +11 -0
  1186. data/ext/gyp/test/same-source-file-name/gyptest-all.py +34 -0
  1187. data/ext/gyp/test/same-source-file-name/gyptest-default.py +34 -0
  1188. data/ext/gyp/test/same-source-file-name/gyptest-pass-executable.py +33 -0
  1189. data/ext/gyp/test/same-source-file-name/gyptest-pass-shared.py +18 -0
  1190. data/ext/gyp/test/same-source-file-name/gyptest-static.py +34 -0
  1191. data/ext/gyp/test/same-source-file-name/src/all.gyp +30 -0
  1192. data/ext/gyp/test/same-source-file-name/src/double-executable.gyp +21 -0
  1193. data/ext/gyp/test/same-source-file-name/src/double-shared.gyp +27 -0
  1194. data/ext/gyp/test/same-source-file-name/src/double-static.gyp +22 -0
  1195. data/ext/gyp/test/same-source-file-name/src/func.c +6 -0
  1196. data/ext/gyp/test/same-source-file-name/src/prog1.c +16 -0
  1197. data/ext/gyp/test/same-source-file-name/src/prog2.c +16 -0
  1198. data/ext/gyp/test/same-source-file-name/src/prog3.c +18 -0
  1199. data/ext/gyp/test/same-source-file-name/src/subdir1/func.c +6 -0
  1200. data/ext/gyp/test/same-source-file-name/src/subdir2/func.c +6 -0
  1201. data/ext/gyp/test/same-target-name/gyptest-same-target-name.py +18 -0
  1202. data/ext/gyp/test/same-target-name/src/all.gyp +16 -0
  1203. data/ext/gyp/test/same-target-name/src/executable1.gyp +15 -0
  1204. data/ext/gyp/test/same-target-name/src/executable2.gyp +15 -0
  1205. data/ext/gyp/test/same-target-name-different-directory/gyptest-all.py +41 -0
  1206. data/ext/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp +66 -0
  1207. data/ext/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp +66 -0
  1208. data/ext/gyp/test/same-target-name-different-directory/src/subdirs.gyp +16 -0
  1209. data/ext/gyp/test/same-target-name-different-directory/src/touch.py +11 -0
  1210. data/ext/gyp/test/sanitize-rule-names/blah.S +0 -0
  1211. data/ext/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py +17 -0
  1212. data/ext/gyp/test/sanitize-rule-names/hello.cc +7 -0
  1213. data/ext/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp +27 -0
  1214. data/ext/gyp/test/sanitize-rule-names/script.py +10 -0
  1215. data/ext/gyp/test/self-dependency/common.gypi +13 -0
  1216. data/ext/gyp/test/self-dependency/dep.gyp +23 -0
  1217. data/ext/gyp/test/self-dependency/gyptest-self-dependency.py +19 -0
  1218. data/ext/gyp/test/self-dependency/self_dependency.gyp +15 -0
  1219. data/ext/gyp/test/sibling/gyptest-all.py +42 -0
  1220. data/ext/gyp/test/sibling/gyptest-relocate.py +44 -0
  1221. data/ext/gyp/test/sibling/src/build/all.gyp +16 -0
  1222. data/ext/gyp/test/sibling/src/prog1/prog1.c +7 -0
  1223. data/ext/gyp/test/sibling/src/prog1/prog1.gyp +15 -0
  1224. data/ext/gyp/test/sibling/src/prog2/prog2.c +7 -0
  1225. data/ext/gyp/test/sibling/src/prog2/prog2.gyp +15 -0
  1226. data/ext/gyp/test/small/gyptest-small.py +56 -0
  1227. data/ext/gyp/test/standalone/gyptest-standalone.py +35 -0
  1228. data/ext/gyp/test/standalone/standalone.gyp +12 -0
  1229. data/ext/gyp/test/standalone-static-library/gyptest-standalone-static-library.py +50 -0
  1230. data/ext/gyp/test/standalone-static-library/invalid.gyp +16 -0
  1231. data/ext/gyp/test/standalone-static-library/mylib.c +7 -0
  1232. data/ext/gyp/test/standalone-static-library/mylib.gyp +26 -0
  1233. data/ext/gyp/test/standalone-static-library/prog.c +7 -0
  1234. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-all.py +36 -0
  1235. data/ext/gyp/test/subdirectory/gyptest-SYMROOT-default.py +37 -0
  1236. data/ext/gyp/test/subdirectory/gyptest-subdir-all.py +34 -0
  1237. data/ext/gyp/test/subdirectory/gyptest-subdir-default.py +34 -0
  1238. data/ext/gyp/test/subdirectory/gyptest-subdir2-deep.py +25 -0
  1239. data/ext/gyp/test/subdirectory/gyptest-top-all.py +43 -0
  1240. data/ext/gyp/test/subdirectory/gyptest-top-default.py +43 -0
  1241. data/ext/gyp/test/subdirectory/src/prog1.c +7 -0
  1242. data/ext/gyp/test/subdirectory/src/prog1.gyp +21 -0
  1243. data/ext/gyp/test/subdirectory/src/subdir/prog2.c +7 -0
  1244. data/ext/gyp/test/subdirectory/src/subdir/prog2.gyp +18 -0
  1245. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.c +7 -0
  1246. data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.gyp +18 -0
  1247. data/ext/gyp/test/subdirectory/src/symroot.gypi +16 -0
  1248. data/ext/gyp/test/symlinks/gyptest-symlinks.py +66 -0
  1249. data/ext/gyp/test/symlinks/hello.c +12 -0
  1250. data/ext/gyp/test/symlinks/hello.gyp +15 -0
  1251. data/ext/gyp/test/target/gyptest-target.py +37 -0
  1252. data/ext/gyp/test/target/hello.c +7 -0
  1253. data/ext/gyp/test/target/target.gyp +24 -0
  1254. data/ext/gyp/test/toolsets/gyptest-toolsets.py +31 -0
  1255. data/ext/gyp/test/toolsets/main.cc +13 -0
  1256. data/ext/gyp/test/toolsets/toolsets.cc +11 -0
  1257. data/ext/gyp/test/toolsets/toolsets.gyp +62 -0
  1258. data/ext/gyp/test/toolsets/toolsets_shared.cc +11 -0
  1259. data/ext/gyp/test/toplevel-dir/gyptest-toplevel-dir.py +31 -0
  1260. data/ext/gyp/test/toplevel-dir/src/sub1/main.gyp +18 -0
  1261. data/ext/gyp/test/toplevel-dir/src/sub1/prog1.c +7 -0
  1262. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.c +7 -0
  1263. data/ext/gyp/test/toplevel-dir/src/sub2/prog2.gyp +15 -0
  1264. data/ext/gyp/test/variables/commands/commands-repeated.gyp +128 -0
  1265. data/ext/gyp/test/variables/commands/commands-repeated.gyp.stdout +136 -0
  1266. data/ext/gyp/test/variables/commands/commands-repeated.gypd.golden +77 -0
  1267. data/ext/gyp/test/variables/commands/commands.gyp +91 -0
  1268. data/ext/gyp/test/variables/commands/commands.gyp.ignore-env.stdout +96 -0
  1269. data/ext/gyp/test/variables/commands/commands.gyp.stdout +96 -0
  1270. data/ext/gyp/test/variables/commands/commands.gypd.golden +66 -0
  1271. data/ext/gyp/test/variables/commands/commands.gypi +23 -0
  1272. data/ext/gyp/test/variables/commands/gyptest-commands-ignore-env.py +47 -0
  1273. data/ext/gyp/test/variables/commands/gyptest-commands-repeated-multidir.py +23 -0
  1274. data/ext/gyp/test/variables/commands/gyptest-commands-repeated.py +40 -0
  1275. data/ext/gyp/test/variables/commands/gyptest-commands.py +40 -0
  1276. data/ext/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp +13 -0
  1277. data/ext/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp +13 -0
  1278. data/ext/gyp/test/variables/commands/repeated_multidir/main.gyp +16 -0
  1279. data/ext/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py +11 -0
  1280. data/ext/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi +25 -0
  1281. data/ext/gyp/test/variables/commands/test.py +7 -0
  1282. data/ext/gyp/test/variables/commands/update_golden +11 -0
  1283. data/ext/gyp/test/variables/empty/empty.gyp +13 -0
  1284. data/ext/gyp/test/variables/empty/empty.gypi +9 -0
  1285. data/ext/gyp/test/variables/empty/gyptest-empty.py +19 -0
  1286. data/ext/gyp/test/variables/filelist/filelist.gyp.stdout +26 -0
  1287. data/ext/gyp/test/variables/filelist/filelist.gypd.golden +43 -0
  1288. data/ext/gyp/test/variables/filelist/gyptest-filelist-golden.py +53 -0
  1289. data/ext/gyp/test/variables/filelist/gyptest-filelist.py +29 -0
  1290. data/ext/gyp/test/variables/filelist/src/dummy.py +5 -0
  1291. data/ext/gyp/test/variables/filelist/src/filelist.gyp +93 -0
  1292. data/ext/gyp/test/variables/filelist/src/filelist2.gyp +40 -0
  1293. data/ext/gyp/test/variables/filelist/update_golden +8 -0
  1294. data/ext/gyp/test/variables/latelate/gyptest-latelate.py +25 -0
  1295. data/ext/gyp/test/variables/latelate/src/latelate.gyp +34 -0
  1296. data/ext/gyp/test/variables/latelate/src/program.cc +13 -0
  1297. data/ext/gyp/test/variables/variable-in-path/C1/hello.cc +7 -0
  1298. data/ext/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py +23 -0
  1299. data/ext/gyp/test/variables/variable-in-path/variable-in-path.gyp +31 -0
  1300. data/ext/gyp/test/win/asm-files/asm-files.gyp +17 -0
  1301. data/ext/gyp/test/win/asm-files/b.s +0 -0
  1302. data/ext/gyp/test/win/asm-files/c.S +0 -0
  1303. data/ext/gyp/test/win/asm-files/hello.cc +7 -0
  1304. data/ext/gyp/test/win/batch-file-action/batch-file-action.gyp +21 -0
  1305. data/ext/gyp/test/win/batch-file-action/infile +1 -0
  1306. data/ext/gyp/test/win/batch-file-action/somecmd.bat +5 -0
  1307. data/ext/gyp/test/win/command-quote/a.S +0 -0
  1308. data/ext/gyp/test/win/command-quote/bat with spaces.bat +7 -0
  1309. data/ext/gyp/test/win/command-quote/command-quote.gyp +79 -0
  1310. data/ext/gyp/test/win/command-quote/go.bat +7 -0
  1311. data/ext/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp +27 -0
  1312. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.cc +10 -0
  1313. data/ext/gyp/test/win/compiler-flags/additional-include-dirs.gyp +20 -0
  1314. data/ext/gyp/test/win/compiler-flags/additional-options.cc +10 -0
  1315. data/ext/gyp/test/win/compiler-flags/additional-options.gyp +31 -0
  1316. data/ext/gyp/test/win/compiler-flags/analysis.gyp +40 -0
  1317. data/ext/gyp/test/win/compiler-flags/buffer-security-check.gyp +51 -0
  1318. data/ext/gyp/test/win/compiler-flags/buffer-security.cc +12 -0
  1319. data/ext/gyp/test/win/compiler-flags/calling-convention-cdecl.def +6 -0
  1320. data/ext/gyp/test/win/compiler-flags/calling-convention-fastcall.def +6 -0
  1321. data/ext/gyp/test/win/compiler-flags/calling-convention-stdcall.def +6 -0
  1322. data/ext/gyp/test/win/compiler-flags/calling-convention-vectorcall.def +6 -0
  1323. data/ext/gyp/test/win/compiler-flags/calling-convention.cc +6 -0
  1324. data/ext/gyp/test/win/compiler-flags/calling-convention.gyp +66 -0
  1325. data/ext/gyp/test/win/compiler-flags/character-set-mbcs.cc +11 -0
  1326. data/ext/gyp/test/win/compiler-flags/character-set-unicode.cc +15 -0
  1327. data/ext/gyp/test/win/compiler-flags/character-set.gyp +35 -0
  1328. data/ext/gyp/test/win/compiler-flags/compile-as-managed.cc +9 -0
  1329. data/ext/gyp/test/win/compiler-flags/compile-as-managed.gyp +29 -0
  1330. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.cc +12 -0
  1331. data/ext/gyp/test/win/compiler-flags/compile-as-winrt.gyp +20 -0
  1332. data/ext/gyp/test/win/compiler-flags/debug-format.gyp +48 -0
  1333. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.cc +15 -0
  1334. data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp +20 -0
  1335. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.cc +9 -0
  1336. data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.gyp +29 -0
  1337. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc +28 -0
  1338. data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp +68 -0
  1339. data/ext/gyp/test/win/compiler-flags/exception-handling-on.cc +24 -0
  1340. data/ext/gyp/test/win/compiler-flags/exception-handling.gyp +46 -0
  1341. data/ext/gyp/test/win/compiler-flags/floating-point-model-fast.cc +19 -0
  1342. data/ext/gyp/test/win/compiler-flags/floating-point-model-precise.cc +19 -0
  1343. data/ext/gyp/test/win/compiler-flags/floating-point-model-strict.cc +19 -0
  1344. data/ext/gyp/test/win/compiler-flags/floating-point-model.gyp +43 -0
  1345. data/ext/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc +10 -0
  1346. data/ext/gyp/test/win/compiler-flags/force-include-files.cc +8 -0
  1347. data/ext/gyp/test/win/compiler-flags/force-include-files.gyp +36 -0
  1348. data/ext/gyp/test/win/compiler-flags/function-level-linking.cc +11 -0
  1349. data/ext/gyp/test/win/compiler-flags/function-level-linking.gyp +28 -0
  1350. data/ext/gyp/test/win/compiler-flags/hello.cc +7 -0
  1351. data/ext/gyp/test/win/compiler-flags/optimizations.gyp +207 -0
  1352. data/ext/gyp/test/win/compiler-flags/pdbname-override.gyp +26 -0
  1353. data/ext/gyp/test/win/compiler-flags/pdbname.cc +7 -0
  1354. data/ext/gyp/test/win/compiler-flags/pdbname.gyp +24 -0
  1355. data/ext/gyp/test/win/compiler-flags/precomp.cc +6 -0
  1356. data/ext/gyp/test/win/compiler-flags/rtti-on.cc +11 -0
  1357. data/ext/gyp/test/win/compiler-flags/rtti.gyp +37 -0
  1358. data/ext/gyp/test/win/compiler-flags/runtime-checks.cc +11 -0
  1359. data/ext/gyp/test/win/compiler-flags/runtime-checks.gyp +29 -0
  1360. data/ext/gyp/test/win/compiler-flags/runtime-library-md.cc +19 -0
  1361. data/ext/gyp/test/win/compiler-flags/runtime-library-mdd.cc +19 -0
  1362. data/ext/gyp/test/win/compiler-flags/runtime-library-mt.cc +19 -0
  1363. data/ext/gyp/test/win/compiler-flags/runtime-library-mtd.cc +19 -0
  1364. data/ext/gyp/test/win/compiler-flags/runtime-library.gyp +48 -0
  1365. data/ext/gyp/test/win/compiler-flags/subdir/header.h +0 -0
  1366. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp +33 -0
  1367. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc +11 -0
  1368. data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc +11 -0
  1369. data/ext/gyp/test/win/compiler-flags/uninit.cc +13 -0
  1370. data/ext/gyp/test/win/compiler-flags/warning-as-error.cc +9 -0
  1371. data/ext/gyp/test/win/compiler-flags/warning-as-error.gyp +37 -0
  1372. data/ext/gyp/test/win/compiler-flags/warning-level.gyp +115 -0
  1373. data/ext/gyp/test/win/compiler-flags/warning-level1.cc +8 -0
  1374. data/ext/gyp/test/win/compiler-flags/warning-level2.cc +14 -0
  1375. data/ext/gyp/test/win/compiler-flags/warning-level3.cc +11 -0
  1376. data/ext/gyp/test/win/compiler-flags/warning-level4.cc +10 -0
  1377. data/ext/gyp/test/win/enable-winrt/dllmain.cc +30 -0
  1378. data/ext/gyp/test/win/enable-winrt/enable-winrt.gyp +39 -0
  1379. data/ext/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py +44 -0
  1380. data/ext/gyp/test/win/generator-output-different-drive/prog.c +10 -0
  1381. data/ext/gyp/test/win/generator-output-different-drive/prog.gyp +15 -0
  1382. data/ext/gyp/test/win/gyptest-asm-files.py +26 -0
  1383. data/ext/gyp/test/win/gyptest-cl-additional-include-dirs.py +22 -0
  1384. data/ext/gyp/test/win/gyptest-cl-additional-options.py +28 -0
  1385. data/ext/gyp/test/win/gyptest-cl-analysis.py +30 -0
  1386. data/ext/gyp/test/win/gyptest-cl-buffer-security-check.py +53 -0
  1387. data/ext/gyp/test/win/gyptest-cl-calling-convention.py +22 -0
  1388. data/ext/gyp/test/win/gyptest-cl-character-set.py +22 -0
  1389. data/ext/gyp/test/win/gyptest-cl-compile-as-managed.py +24 -0
  1390. data/ext/gyp/test/win/gyptest-cl-compile-as-winrt.py +20 -0
  1391. data/ext/gyp/test/win/gyptest-cl-debug-format.py +43 -0
  1392. data/ext/gyp/test/win/gyptest-cl-default-char-is-unsigned.py +22 -0
  1393. data/ext/gyp/test/win/gyptest-cl-disable-specific-warnings.py +32 -0
  1394. data/ext/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py +49 -0
  1395. data/ext/gyp/test/win/gyptest-cl-exception-handling.py +33 -0
  1396. data/ext/gyp/test/win/gyptest-cl-floating-point-model.py +22 -0
  1397. data/ext/gyp/test/win/gyptest-cl-force-include-files.py +22 -0
  1398. data/ext/gyp/test/win/gyptest-cl-function-level-linking.py +54 -0
  1399. data/ext/gyp/test/win/gyptest-cl-optimizations.py +105 -0
  1400. data/ext/gyp/test/win/gyptest-cl-pdbname-override.py +27 -0
  1401. data/ext/gyp/test/win/gyptest-cl-pdbname.py +30 -0
  1402. data/ext/gyp/test/win/gyptest-cl-rtti.py +30 -0
  1403. data/ext/gyp/test/win/gyptest-cl-runtime-checks.py +30 -0
  1404. data/ext/gyp/test/win/gyptest-cl-runtime-library.py +22 -0
  1405. data/ext/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py +22 -0
  1406. data/ext/gyp/test/win/gyptest-cl-warning-as-error.py +30 -0
  1407. data/ext/gyp/test/win/gyptest-cl-warning-level.py +41 -0
  1408. data/ext/gyp/test/win/gyptest-command-quote.py +42 -0
  1409. data/ext/gyp/test/win/gyptest-crosscompile-ar.py +29 -0
  1410. data/ext/gyp/test/win/gyptest-lib-ltcg.py +22 -0
  1411. data/ext/gyp/test/win/gyptest-link-additional-deps.py +22 -0
  1412. data/ext/gyp/test/win/gyptest-link-additional-options.py +22 -0
  1413. data/ext/gyp/test/win/gyptest-link-aslr.py +35 -0
  1414. data/ext/gyp/test/win/gyptest-link-base-address.py +62 -0
  1415. data/ext/gyp/test/win/gyptest-link-debug-info.py +26 -0
  1416. data/ext/gyp/test/win/gyptest-link-default-libs.py +22 -0
  1417. data/ext/gyp/test/win/gyptest-link-deffile.py +43 -0
  1418. data/ext/gyp/test/win/gyptest-link-defrelink.py +56 -0
  1419. data/ext/gyp/test/win/gyptest-link-delay-load-dlls.py +35 -0
  1420. data/ext/gyp/test/win/gyptest-link-embed-manifest.py +100 -0
  1421. data/ext/gyp/test/win/gyptest-link-enable-uac.py +104 -0
  1422. data/ext/gyp/test/win/gyptest-link-enable-winrt-app-revision.py +43 -0
  1423. data/ext/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py +47 -0
  1424. data/ext/gyp/test/win/gyptest-link-enable-winrt.py +37 -0
  1425. data/ext/gyp/test/win/gyptest-link-entrypointsymbol.py +24 -0
  1426. data/ext/gyp/test/win/gyptest-link-fixed-base.py +40 -0
  1427. data/ext/gyp/test/win/gyptest-link-force-symbol-reference.py +26 -0
  1428. data/ext/gyp/test/win/gyptest-link-generate-manifest.py +127 -0
  1429. data/ext/gyp/test/win/gyptest-link-incremental.py +37 -0
  1430. data/ext/gyp/test/win/gyptest-link-large-address-aware.py +35 -0
  1431. data/ext/gyp/test/win/gyptest-link-large-pdb.py +76 -0
  1432. data/ext/gyp/test/win/gyptest-link-library-adjust.py +21 -0
  1433. data/ext/gyp/test/win/gyptest-link-library-directories.py +35 -0
  1434. data/ext/gyp/test/win/gyptest-link-ltcg.py +44 -0
  1435. data/ext/gyp/test/win/gyptest-link-mapfile.py +44 -0
  1436. data/ext/gyp/test/win/gyptest-link-nodefaultlib.py +24 -0
  1437. data/ext/gyp/test/win/gyptest-link-noimportlib.py +30 -0
  1438. data/ext/gyp/test/win/gyptest-link-nxcompat.py +37 -0
  1439. data/ext/gyp/test/win/gyptest-link-opt-icf.py +41 -0
  1440. data/ext/gyp/test/win/gyptest-link-opt-ref.py +40 -0
  1441. data/ext/gyp/test/win/gyptest-link-ordering.py +103 -0
  1442. data/ext/gyp/test/win/gyptest-link-outputfile.py +28 -0
  1443. data/ext/gyp/test/win/gyptest-link-pdb-no-output.py +25 -0
  1444. data/ext/gyp/test/win/gyptest-link-pdb-output.py +33 -0
  1445. data/ext/gyp/test/win/gyptest-link-pdb.py +35 -0
  1446. data/ext/gyp/test/win/gyptest-link-pgo.py +75 -0
  1447. data/ext/gyp/test/win/gyptest-link-profile.py +37 -0
  1448. data/ext/gyp/test/win/gyptest-link-restat-importlib.py +47 -0
  1449. data/ext/gyp/test/win/gyptest-link-safeseh.py +46 -0
  1450. data/ext/gyp/test/win/gyptest-link-shard.py +30 -0
  1451. data/ext/gyp/test/win/gyptest-link-stacksize.py +62 -0
  1452. data/ext/gyp/test/win/gyptest-link-subsystem.py +38 -0
  1453. data/ext/gyp/test/win/gyptest-link-target-machine.py +28 -0
  1454. data/ext/gyp/test/win/gyptest-link-tsaware.py +33 -0
  1455. data/ext/gyp/test/win/gyptest-link-uldi-depending-on-module.py +24 -0
  1456. data/ext/gyp/test/win/gyptest-link-uldi.py +28 -0
  1457. data/ext/gyp/test/win/gyptest-link-unsupported-manifest.py +27 -0
  1458. data/ext/gyp/test/win/gyptest-link-update-manifest.py +104 -0
  1459. data/ext/gyp/test/win/gyptest-link-warnings-as-errors.py +24 -0
  1460. data/ext/gyp/test/win/gyptest-long-command-line.py +23 -0
  1461. data/ext/gyp/test/win/gyptest-macro-projectname.py +24 -0
  1462. data/ext/gyp/test/win/gyptest-macro-targetext.py +26 -0
  1463. data/ext/gyp/test/win/gyptest-macro-targetfilename.py +37 -0
  1464. data/ext/gyp/test/win/gyptest-macro-targetname.py +29 -0
  1465. data/ext/gyp/test/win/gyptest-macro-targetpath.py +30 -0
  1466. data/ext/gyp/test/win/gyptest-macro-vcinstalldir.py +24 -0
  1467. data/ext/gyp/test/win/gyptest-macros-containing-gyp.py +21 -0
  1468. data/ext/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py +27 -0
  1469. data/ext/gyp/test/win/gyptest-midl-excluded.py +22 -0
  1470. data/ext/gyp/test/win/gyptest-midl-includedirs.py +21 -0
  1471. data/ext/gyp/test/win/gyptest-midl-rules.py +28 -0
  1472. data/ext/gyp/test/win/gyptest-ml-safeseh.py +22 -0
  1473. data/ext/gyp/test/win/gyptest-quoting-commands.py +25 -0
  1474. data/ext/gyp/test/win/gyptest-rc-build.py +29 -0
  1475. data/ext/gyp/test/win/gyptest-sys.py +27 -0
  1476. data/ext/gyp/test/win/gyptest-system-include.py +21 -0
  1477. data/ext/gyp/test/win/idl-excluded/bad.idl +6 -0
  1478. data/ext/gyp/test/win/idl-excluded/copy-file.py +11 -0
  1479. data/ext/gyp/test/win/idl-excluded/idl-excluded.gyp +58 -0
  1480. data/ext/gyp/test/win/idl-excluded/program.cc +7 -0
  1481. data/ext/gyp/test/win/idl-includedirs/hello.cc +7 -0
  1482. data/ext/gyp/test/win/idl-includedirs/idl-includedirs.gyp +26 -0
  1483. data/ext/gyp/test/win/idl-includedirs/subdir/bar.idl +13 -0
  1484. data/ext/gyp/test/win/idl-includedirs/subdir/foo.idl +14 -0
  1485. data/ext/gyp/test/win/idl-rules/Window.idl +9 -0
  1486. data/ext/gyp/test/win/idl-rules/basic-idl.gyp +67 -0
  1487. data/ext/gyp/test/win/idl-rules/history_indexer.idl +17 -0
  1488. data/ext/gyp/test/win/idl-rules/history_indexer_user.cc +15 -0
  1489. data/ext/gyp/test/win/idl-rules/idl_compiler.py +17 -0
  1490. data/ext/gyp/test/win/importlib/dll_no_exports.cc +9 -0
  1491. data/ext/gyp/test/win/importlib/has-exports.cc +10 -0
  1492. data/ext/gyp/test/win/importlib/hello.cc +9 -0
  1493. data/ext/gyp/test/win/importlib/importlib.gyp +30 -0
  1494. data/ext/gyp/test/win/importlib/noimplib.gyp +16 -0
  1495. data/ext/gyp/test/win/large-pdb/dllmain.cc +9 -0
  1496. data/ext/gyp/test/win/large-pdb/large-pdb.gyp +98 -0
  1497. data/ext/gyp/test/win/large-pdb/main.cc +7 -0
  1498. data/ext/gyp/test/win/lib-crosscompile/answer.cc +9 -0
  1499. data/ext/gyp/test/win/lib-crosscompile/answer.h +5 -0
  1500. data/ext/gyp/test/win/lib-crosscompile/use_host_ar.gyp +17 -0
  1501. data/ext/gyp/test/win/lib-flags/answer.cc +9 -0
  1502. data/ext/gyp/test/win/lib-flags/answer.h +5 -0
  1503. data/ext/gyp/test/win/lib-flags/ltcg.gyp +21 -0
  1504. data/ext/gyp/test/win/linker-flags/a/x.cc +7 -0
  1505. data/ext/gyp/test/win/linker-flags/a/z.cc +7 -0
  1506. data/ext/gyp/test/win/linker-flags/additional-deps.cc +10 -0
  1507. data/ext/gyp/test/win/linker-flags/additional-deps.gyp +30 -0
  1508. data/ext/gyp/test/win/linker-flags/additional-options.gyp +29 -0
  1509. data/ext/gyp/test/win/linker-flags/aslr.gyp +35 -0
  1510. data/ext/gyp/test/win/linker-flags/b/y.cc +7 -0
  1511. data/ext/gyp/test/win/linker-flags/base-address.gyp +38 -0
  1512. data/ext/gyp/test/win/linker-flags/debug-info.gyp +28 -0
  1513. data/ext/gyp/test/win/linker-flags/deffile-multiple.gyp +17 -0
  1514. data/ext/gyp/test/win/linker-flags/deffile.cc +13 -0
  1515. data/ext/gyp/test/win/linker-flags/deffile.def +8 -0
  1516. data/ext/gyp/test/win/linker-flags/deffile.gyp +38 -0
  1517. data/ext/gyp/test/win/linker-flags/delay-load-dlls.gyp +35 -0
  1518. data/ext/gyp/test/win/linker-flags/delay-load.cc +10 -0
  1519. data/ext/gyp/test/win/linker-flags/embed-manifest.gyp +109 -0
  1520. data/ext/gyp/test/win/linker-flags/enable-uac.gyp +45 -0
  1521. data/ext/gyp/test/win/linker-flags/entrypointsymbol.cc +13 -0
  1522. data/ext/gyp/test/win/linker-flags/entrypointsymbol.gyp +28 -0
  1523. data/ext/gyp/test/win/linker-flags/extra.manifest +11 -0
  1524. data/ext/gyp/test/win/linker-flags/extra2.manifest +11 -0
  1525. data/ext/gyp/test/win/linker-flags/fixed-base.gyp +52 -0
  1526. data/ext/gyp/test/win/linker-flags/force-symbol-reference.gyp +39 -0
  1527. data/ext/gyp/test/win/linker-flags/generate-manifest.gyp +166 -0
  1528. data/ext/gyp/test/win/linker-flags/hello.cc +7 -0
  1529. data/ext/gyp/test/win/linker-flags/incremental.gyp +65 -0
  1530. data/ext/gyp/test/win/linker-flags/inline_test.cc +12 -0
  1531. data/ext/gyp/test/win/linker-flags/inline_test.h +5 -0
  1532. data/ext/gyp/test/win/linker-flags/inline_test_main.cc +15 -0
  1533. data/ext/gyp/test/win/linker-flags/large-address-aware.gyp +28 -0
  1534. data/ext/gyp/test/win/linker-flags/library-adjust.cc +10 -0
  1535. data/ext/gyp/test/win/linker-flags/library-adjust.gyp +16 -0
  1536. data/ext/gyp/test/win/linker-flags/library-directories-define.cc +7 -0
  1537. data/ext/gyp/test/win/linker-flags/library-directories-reference.cc +10 -0
  1538. data/ext/gyp/test/win/linker-flags/library-directories.gyp +42 -0
  1539. data/ext/gyp/test/win/linker-flags/link-ordering.gyp +95 -0
  1540. data/ext/gyp/test/win/linker-flags/link-warning.cc +10 -0
  1541. data/ext/gyp/test/win/linker-flags/ltcg.gyp +42 -0
  1542. data/ext/gyp/test/win/linker-flags/main-crt.c +8 -0
  1543. data/ext/gyp/test/win/linker-flags/manifest-in-comment.cc +13 -0
  1544. data/ext/gyp/test/win/linker-flags/mapfile.cc +12 -0
  1545. data/ext/gyp/test/win/linker-flags/mapfile.gyp +45 -0
  1546. data/ext/gyp/test/win/linker-flags/no-default-libs.cc +18 -0
  1547. data/ext/gyp/test/win/linker-flags/no-default-libs.gyp +13 -0
  1548. data/ext/gyp/test/win/linker-flags/nodefaultlib.cc +13 -0
  1549. data/ext/gyp/test/win/linker-flags/nodefaultlib.gyp +30 -0
  1550. data/ext/gyp/test/win/linker-flags/nxcompat.gyp +35 -0
  1551. data/ext/gyp/test/win/linker-flags/opt-icf.cc +29 -0
  1552. data/ext/gyp/test/win/linker-flags/opt-icf.gyp +63 -0
  1553. data/ext/gyp/test/win/linker-flags/opt-ref.cc +11 -0
  1554. data/ext/gyp/test/win/linker-flags/opt-ref.gyp +56 -0
  1555. data/ext/gyp/test/win/linker-flags/outputfile.gyp +58 -0
  1556. data/ext/gyp/test/win/linker-flags/pdb-output.gyp +49 -0
  1557. data/ext/gyp/test/win/linker-flags/pgo.gyp +143 -0
  1558. data/ext/gyp/test/win/linker-flags/profile.gyp +50 -0
  1559. data/ext/gyp/test/win/linker-flags/program-database.gyp +40 -0
  1560. data/ext/gyp/test/win/linker-flags/safeseh.gyp +79 -0
  1561. data/ext/gyp/test/win/linker-flags/safeseh_hello.cc +11 -0
  1562. data/ext/gyp/test/win/linker-flags/safeseh_zero.asm +10 -0
  1563. data/ext/gyp/test/win/linker-flags/safeseh_zero64.asm +9 -0
  1564. data/ext/gyp/test/win/linker-flags/stacksize.gyp +44 -0
  1565. data/ext/gyp/test/win/linker-flags/subdir/library.gyp +13 -0
  1566. data/ext/gyp/test/win/linker-flags/subsystem-windows.cc +9 -0
  1567. data/ext/gyp/test/win/linker-flags/subsystem.gyp +70 -0
  1568. data/ext/gyp/test/win/linker-flags/target-machine.gyp +48 -0
  1569. data/ext/gyp/test/win/linker-flags/tsaware.gyp +28 -0
  1570. data/ext/gyp/test/win/linker-flags/unsupported-manifest.gyp +13 -0
  1571. data/ext/gyp/test/win/linker-flags/update_pgd.py +35 -0
  1572. data/ext/gyp/test/win/linker-flags/warn-as-error.gyp +33 -0
  1573. data/ext/gyp/test/win/linker-flags/x.cc +7 -0
  1574. data/ext/gyp/test/win/linker-flags/y.cc +7 -0
  1575. data/ext/gyp/test/win/linker-flags/z.cc +7 -0
  1576. data/ext/gyp/test/win/long-command-line/function.cc +7 -0
  1577. data/ext/gyp/test/win/long-command-line/hello.cc +7 -0
  1578. data/ext/gyp/test/win/long-command-line/long-command-line.gyp +54 -0
  1579. data/ext/gyp/test/win/ml-safeseh/a.asm +10 -0
  1580. data/ext/gyp/test/win/ml-safeseh/hello.cc +11 -0
  1581. data/ext/gyp/test/win/ml-safeseh/ml-safeseh.gyp +24 -0
  1582. data/ext/gyp/test/win/precompiled/gyptest-all.py +21 -0
  1583. data/ext/gyp/test/win/precompiled/hello.c +14 -0
  1584. data/ext/gyp/test/win/precompiled/hello.gyp +28 -0
  1585. data/ext/gyp/test/win/precompiled/hello2.c +13 -0
  1586. data/ext/gyp/test/win/precompiled/precomp.c +8 -0
  1587. data/ext/gyp/test/win/rc-build/Resource.h +26 -0
  1588. data/ext/gyp/test/win/rc-build/hello.cpp +30 -0
  1589. data/ext/gyp/test/win/rc-build/hello.gyp +92 -0
  1590. data/ext/gyp/test/win/rc-build/hello.h +3 -0
  1591. data/ext/gyp/test/win/rc-build/hello.ico +0 -0
  1592. data/ext/gyp/test/win/rc-build/hello.rc +86 -0
  1593. data/ext/gyp/test/win/rc-build/hello3.rc +87 -0
  1594. data/ext/gyp/test/win/rc-build/small.ico +0 -0
  1595. data/ext/gyp/test/win/rc-build/subdir/hello2.rc +87 -0
  1596. data/ext/gyp/test/win/rc-build/subdir/include.h +1 -0
  1597. data/ext/gyp/test/win/rc-build/targetver.h +24 -0
  1598. data/ext/gyp/test/win/shard/hello.cc +7 -0
  1599. data/ext/gyp/test/win/shard/hello1.cc +7 -0
  1600. data/ext/gyp/test/win/shard/hello2.cc +7 -0
  1601. data/ext/gyp/test/win/shard/hello3.cc +7 -0
  1602. data/ext/gyp/test/win/shard/hello4.cc +7 -0
  1603. data/ext/gyp/test/win/shard/shard.gyp +31 -0
  1604. data/ext/gyp/test/win/shard/shard_ref.gyp +41 -0
  1605. data/ext/gyp/test/win/system-include/bar/header.h +0 -0
  1606. data/ext/gyp/test/win/system-include/common/commonheader.h +0 -0
  1607. data/ext/gyp/test/win/system-include/foo/header.h +0 -0
  1608. data/ext/gyp/test/win/system-include/main.cc +4 -0
  1609. data/ext/gyp/test/win/system-include/test.gyp +26 -0
  1610. data/ext/gyp/test/win/uldi/a.cc +7 -0
  1611. data/ext/gyp/test/win/uldi/b.cc +7 -0
  1612. data/ext/gyp/test/win/uldi/dll.cc +6 -0
  1613. data/ext/gyp/test/win/uldi/exe.cc +7 -0
  1614. data/ext/gyp/test/win/uldi/main.cc +10 -0
  1615. data/ext/gyp/test/win/uldi/uldi-depending-on-module.gyp +42 -0
  1616. data/ext/gyp/test/win/uldi/uldi.gyp +45 -0
  1617. data/ext/gyp/test/win/vs-macros/as.py +20 -0
  1618. data/ext/gyp/test/win/vs-macros/containing-gyp.gyp +39 -0
  1619. data/ext/gyp/test/win/vs-macros/do_stuff.py +8 -0
  1620. data/ext/gyp/test/win/vs-macros/hello.cc +7 -0
  1621. data/ext/gyp/test/win/vs-macros/input-output-macros.gyp +32 -0
  1622. data/ext/gyp/test/win/vs-macros/input.S +0 -0
  1623. data/ext/gyp/test/win/vs-macros/projectname.gyp +29 -0
  1624. data/ext/gyp/test/win/vs-macros/stuff.blah +1 -0
  1625. data/ext/gyp/test/win/vs-macros/targetext.gyp +59 -0
  1626. data/ext/gyp/test/win/vs-macros/targetfilename.gyp +59 -0
  1627. data/ext/gyp/test/win/vs-macros/targetname.gyp +52 -0
  1628. data/ext/gyp/test/win/vs-macros/targetpath.gyp +59 -0
  1629. data/ext/gyp/test/win/vs-macros/test_exists.py +10 -0
  1630. data/ext/gyp/test/win/vs-macros/vcinstalldir.gyp +41 -0
  1631. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.c +10 -0
  1632. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp +32 -0
  1633. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.h +13 -0
  1634. data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.rc +14 -0
  1635. data/ext/gyp/test/win/win-tool/copies_readonly_files.gyp +29 -0
  1636. data/ext/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py +55 -0
  1637. data/ext/gyp/test/win/winrt-app-type-revision/dllmain.cc +30 -0
  1638. data/ext/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp +43 -0
  1639. data/ext/gyp/test/win/winrt-target-platform-version/dllmain.cc +30 -0
  1640. data/ext/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp +49 -0
  1641. data/ext/gyp/test/xcode-ninja/list_excluded/gyptest-all.py +49 -0
  1642. data/ext/gyp/test/xcode-ninja/list_excluded/hello.cpp +7 -0
  1643. data/ext/gyp/test/xcode-ninja/list_excluded/hello_exclude.gyp +19 -0
  1644. data/ext/gyp/test/xcode-ninja/list_excluded/hello_excluded.cpp +7 -0
  1645. data/ext/gyp/tools/README +15 -0
  1646. data/ext/gyp/tools/Xcode/README +5 -0
  1647. data/ext/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
  1648. data/ext/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
  1649. data/ext/gyp/tools/emacs/README +12 -0
  1650. data/ext/gyp/tools/emacs/gyp-tests.el +63 -0
  1651. data/ext/gyp/tools/emacs/gyp.el +275 -0
  1652. data/ext/gyp/tools/emacs/run-unit-tests.sh +7 -0
  1653. data/ext/gyp/tools/emacs/testdata/media.gyp +1105 -0
  1654. data/ext/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
  1655. data/ext/gyp/tools/graphviz.py +102 -0
  1656. data/ext/gyp/tools/pretty_gyp.py +156 -0
  1657. data/ext/gyp/tools/pretty_sln.py +171 -0
  1658. data/ext/gyp/tools/pretty_vcproj.py +337 -0
  1659. data/ext/libuv/.gitattributes +1 -0
  1660. data/ext/libuv/.github/ISSUE_TEMPLATE.md +13 -0
  1661. data/ext/libuv/.github/stale.yml +22 -0
  1662. data/ext/libuv/.gitignore +80 -0
  1663. data/ext/libuv/.mailmap +50 -0
  1664. data/ext/libuv/AUTHORS +415 -0
  1665. data/ext/libuv/CMakeLists.txt +430 -0
  1666. data/ext/libuv/CONTRIBUTING.md +172 -0
  1667. data/ext/libuv/ChangeLog +4548 -0
  1668. data/ext/libuv/LICENSE +70 -0
  1669. data/ext/libuv/LICENSE-docs +396 -0
  1670. data/ext/libuv/MAINTAINERS.md +48 -0
  1671. data/ext/libuv/Makefile.am +548 -0
  1672. data/ext/libuv/README.md +431 -0
  1673. data/ext/libuv/SUPPORTED_PLATFORMS.md +68 -0
  1674. data/ext/libuv/android-configure-arm +23 -0
  1675. data/ext/libuv/android-configure-arm64 +23 -0
  1676. data/ext/libuv/android-configure-x86 +23 -0
  1677. data/ext/libuv/android-configure-x86_64 +25 -0
  1678. data/ext/libuv/appveyor.yml +32 -0
  1679. data/ext/libuv/autogen.sh +46 -0
  1680. data/ext/libuv/common.gypi +213 -0
  1681. data/ext/libuv/configure.ac +82 -0
  1682. data/ext/libuv/docs/Makefile +183 -0
  1683. data/ext/libuv/docs/code/cgi/main.c +81 -0
  1684. data/ext/libuv/docs/code/cgi/tick.c +13 -0
  1685. data/ext/libuv/docs/code/detach/main.c +31 -0
  1686. data/ext/libuv/docs/code/dns/main.c +80 -0
  1687. data/ext/libuv/docs/code/helloworld/main.c +15 -0
  1688. data/ext/libuv/docs/code/idle-basic/main.c +24 -0
  1689. data/ext/libuv/docs/code/idle-compute/main.c +43 -0
  1690. data/ext/libuv/docs/code/interfaces/main.c +33 -0
  1691. data/ext/libuv/docs/code/locks/main.c +57 -0
  1692. data/ext/libuv/docs/code/multi-echo-server/hammer.js +20 -0
  1693. data/ext/libuv/docs/code/multi-echo-server/main.c +114 -0
  1694. data/ext/libuv/docs/code/multi-echo-server/worker.c +88 -0
  1695. data/ext/libuv/docs/code/onchange/main.c +44 -0
  1696. data/ext/libuv/docs/code/pipe-echo-server/main.c +94 -0
  1697. data/ext/libuv/docs/code/plugin/hello.c +5 -0
  1698. data/ext/libuv/docs/code/plugin/main.c +39 -0
  1699. data/ext/libuv/docs/code/plugin/plugin.h +7 -0
  1700. data/ext/libuv/docs/code/proc-streams/main.c +49 -0
  1701. data/ext/libuv/docs/code/proc-streams/test.c +8 -0
  1702. data/ext/libuv/docs/code/progress/main.c +47 -0
  1703. data/ext/libuv/docs/code/queue-cancel/main.c +59 -0
  1704. data/ext/libuv/docs/code/queue-work/main.c +44 -0
  1705. data/ext/libuv/docs/code/ref-timer/main.c +29 -0
  1706. data/ext/libuv/docs/code/signal/main.c +66 -0
  1707. data/ext/libuv/docs/code/spawn/main.c +36 -0
  1708. data/ext/libuv/docs/code/tcp-echo-server/main.c +87 -0
  1709. data/ext/libuv/docs/code/thread-create/main.c +36 -0
  1710. data/ext/libuv/docs/code/tty/main.c +29 -0
  1711. data/ext/libuv/docs/code/tty-gravity/main.c +48 -0
  1712. data/ext/libuv/docs/code/udp-dhcp/main.c +127 -0
  1713. data/ext/libuv/docs/code/uvcat/main.c +63 -0
  1714. data/ext/libuv/docs/code/uvstop/main.c +33 -0
  1715. data/ext/libuv/docs/code/uvtee/main.c +80 -0
  1716. data/ext/libuv/docs/code/uvwget/main.c +166 -0
  1717. data/ext/libuv/docs/make.bat +243 -0
  1718. data/ext/libuv/docs/src/api.rst +35 -0
  1719. data/ext/libuv/docs/src/async.rst +65 -0
  1720. data/ext/libuv/docs/src/check.rst +46 -0
  1721. data/ext/libuv/docs/src/conf.py +348 -0
  1722. data/ext/libuv/docs/src/design.rst +140 -0
  1723. data/ext/libuv/docs/src/dll.rst +44 -0
  1724. data/ext/libuv/docs/src/dns.rst +108 -0
  1725. data/ext/libuv/docs/src/errors.rst +365 -0
  1726. data/ext/libuv/docs/src/fs.rst +689 -0
  1727. data/ext/libuv/docs/src/fs_event.rst +132 -0
  1728. data/ext/libuv/docs/src/fs_poll.rst +77 -0
  1729. data/ext/libuv/docs/src/guide/about.rst +22 -0
  1730. data/ext/libuv/docs/src/guide/basics.rst +219 -0
  1731. data/ext/libuv/docs/src/guide/eventloops.rst +48 -0
  1732. data/ext/libuv/docs/src/guide/filesystem.rst +330 -0
  1733. data/ext/libuv/docs/src/guide/introduction.rst +75 -0
  1734. data/ext/libuv/docs/src/guide/networking.rst +250 -0
  1735. data/ext/libuv/docs/src/guide/processes.rst +406 -0
  1736. data/ext/libuv/docs/src/guide/threads.rst +385 -0
  1737. data/ext/libuv/docs/src/guide/utilities.rst +437 -0
  1738. data/ext/libuv/docs/src/guide.rst +22 -0
  1739. data/ext/libuv/docs/src/handle.rst +283 -0
  1740. data/ext/libuv/docs/src/idle.rst +54 -0
  1741. data/ext/libuv/docs/src/index.rst +62 -0
  1742. data/ext/libuv/docs/src/loop.rst +238 -0
  1743. data/ext/libuv/docs/src/migration_010_100.rst +244 -0
  1744. data/ext/libuv/docs/src/misc.rst +702 -0
  1745. data/ext/libuv/docs/src/pipe.rst +116 -0
  1746. data/ext/libuv/docs/src/poll.rst +121 -0
  1747. data/ext/libuv/docs/src/prepare.rst +46 -0
  1748. data/ext/libuv/docs/src/process.rst +250 -0
  1749. data/ext/libuv/docs/src/request.rst +116 -0
  1750. data/ext/libuv/docs/src/signal.rst +101 -0
  1751. data/ext/libuv/docs/src/sphinx-plugins/manpage.py +45 -0
  1752. data/ext/libuv/docs/src/static/architecture.png +0 -0
  1753. data/ext/libuv/docs/src/static/diagrams.key/Data/st0-311.jpg +0 -0
  1754. data/ext/libuv/docs/src/static/diagrams.key/Data/st1-475.jpg +0 -0
  1755. data/ext/libuv/docs/src/static/diagrams.key/Index.zip +0 -0
  1756. data/ext/libuv/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist +8 -0
  1757. data/ext/libuv/docs/src/static/diagrams.key/Metadata/DocumentIdentifier +1 -0
  1758. data/ext/libuv/docs/src/static/diagrams.key/Metadata/Properties.plist +0 -0
  1759. data/ext/libuv/docs/src/static/diagrams.key/preview-micro.jpg +0 -0
  1760. data/ext/libuv/docs/src/static/diagrams.key/preview-web.jpg +0 -0
  1761. data/ext/libuv/docs/src/static/diagrams.key/preview.jpg +0 -0
  1762. data/ext/libuv/docs/src/static/favicon.ico +0 -0
  1763. data/ext/libuv/docs/src/static/logo.png +0 -0
  1764. data/ext/libuv/docs/src/static/loop_iteration.png +0 -0
  1765. data/ext/libuv/docs/src/stream.rst +237 -0
  1766. data/ext/libuv/docs/src/tcp.rst +125 -0
  1767. data/ext/libuv/docs/src/threading.rst +197 -0
  1768. data/ext/libuv/docs/src/threadpool.rst +69 -0
  1769. data/ext/libuv/docs/src/timer.rst +81 -0
  1770. data/ext/libuv/docs/src/tty.rst +139 -0
  1771. data/ext/libuv/docs/src/udp.rst +390 -0
  1772. data/ext/libuv/docs/src/upgrading.rst +11 -0
  1773. data/ext/libuv/docs/src/version.rst +60 -0
  1774. data/ext/libuv/gyp_uv.py +73 -0
  1775. data/ext/libuv/img/banner.png +0 -0
  1776. data/ext/libuv/img/logos.svg +152 -0
  1777. data/ext/libuv/include/uv/aix.h +32 -0
  1778. data/ext/libuv/include/uv/android-ifaddrs.h +54 -0
  1779. data/ext/libuv/include/uv/bsd.h +34 -0
  1780. data/ext/libuv/include/uv/darwin.h +61 -0
  1781. data/ext/libuv/include/uv/errno.h +448 -0
  1782. data/ext/libuv/include/uv/linux.h +34 -0
  1783. data/ext/libuv/include/uv/os390.h +33 -0
  1784. data/ext/libuv/include/uv/posix.h +31 -0
  1785. data/ext/libuv/include/uv/stdint-msvc2008.h +247 -0
  1786. data/ext/libuv/include/uv/sunos.h +44 -0
  1787. data/ext/libuv/include/uv/threadpool.h +37 -0
  1788. data/ext/libuv/include/uv/tree.h +768 -0
  1789. data/ext/libuv/include/uv/unix.h +505 -0
  1790. data/ext/libuv/include/uv/version.h +43 -0
  1791. data/ext/libuv/include/uv/win.h +691 -0
  1792. data/ext/libuv/include/uv.h +1782 -0
  1793. data/ext/libuv/libuv.pc.in +12 -0
  1794. data/ext/libuv/m4/.gitignore +4 -0
  1795. data/ext/libuv/m4/as_case.m4 +21 -0
  1796. data/ext/libuv/m4/libuv-check-flags.m4 +319 -0
  1797. data/ext/libuv/src/fs-poll.c +287 -0
  1798. data/ext/libuv/src/heap-inl.h +245 -0
  1799. data/ext/libuv/src/idna.c +291 -0
  1800. data/ext/libuv/src/idna.h +31 -0
  1801. data/ext/libuv/src/inet.c +302 -0
  1802. data/ext/libuv/src/queue.h +108 -0
  1803. data/ext/libuv/src/random.c +123 -0
  1804. data/ext/libuv/src/strscpy.c +17 -0
  1805. data/ext/libuv/src/strscpy.h +18 -0
  1806. data/ext/libuv/src/threadpool.c +388 -0
  1807. data/ext/libuv/src/timer.c +181 -0
  1808. data/ext/libuv/src/unix/aix-common.c +337 -0
  1809. data/ext/libuv/src/unix/aix.c +1066 -0
  1810. data/ext/libuv/src/unix/android-ifaddrs.c +712 -0
  1811. data/ext/libuv/src/unix/async.c +298 -0
  1812. data/ext/libuv/src/unix/atomic-ops.h +59 -0
  1813. data/ext/libuv/src/unix/bsd-ifaddrs.c +161 -0
  1814. data/ext/libuv/src/unix/bsd-proctitle.c +93 -0
  1815. data/ext/libuv/src/unix/core.c +1571 -0
  1816. data/ext/libuv/src/unix/cygwin.c +53 -0
  1817. data/ext/libuv/src/unix/darwin-proctitle.c +202 -0
  1818. data/ext/libuv/src/unix/darwin.c +225 -0
  1819. data/ext/libuv/src/unix/dl.c +80 -0
  1820. data/ext/libuv/src/unix/freebsd.c +290 -0
  1821. data/ext/libuv/src/unix/fs.c +2044 -0
  1822. data/ext/libuv/src/unix/fsevents.c +924 -0
  1823. data/ext/libuv/src/unix/getaddrinfo.c +255 -0
  1824. data/ext/libuv/src/unix/getnameinfo.c +121 -0
  1825. data/ext/libuv/src/unix/haiku.c +167 -0
  1826. data/ext/libuv/src/unix/ibmi.c +249 -0
  1827. data/ext/libuv/src/unix/internal.h +331 -0
  1828. data/ext/libuv/src/unix/kqueue.c +544 -0
  1829. data/ext/libuv/src/unix/linux-core.c +1091 -0
  1830. data/ext/libuv/src/unix/linux-inotify.c +354 -0
  1831. data/ext/libuv/src/unix/linux-syscalls.c +394 -0
  1832. data/ext/libuv/src/unix/linux-syscalls.h +153 -0
  1833. data/ext/libuv/src/unix/loop-watcher.c +68 -0
  1834. data/ext/libuv/src/unix/loop.c +194 -0
  1835. data/ext/libuv/src/unix/netbsd.c +259 -0
  1836. data/ext/libuv/src/unix/no-fsevents.c +42 -0
  1837. data/ext/libuv/src/unix/no-proctitle.c +42 -0
  1838. data/ext/libuv/src/unix/openbsd.c +244 -0
  1839. data/ext/libuv/src/unix/os390-syscalls.c +519 -0
  1840. data/ext/libuv/src/unix/os390-syscalls.h +68 -0
  1841. data/ext/libuv/src/unix/os390.c +1003 -0
  1842. data/ext/libuv/src/unix/pipe.c +377 -0
  1843. data/ext/libuv/src/unix/poll.c +150 -0
  1844. data/ext/libuv/src/unix/posix-hrtime.c +35 -0
  1845. data/ext/libuv/src/unix/posix-poll.c +336 -0
  1846. data/ext/libuv/src/unix/process.c +603 -0
  1847. data/ext/libuv/src/unix/procfs-exepath.c +45 -0
  1848. data/ext/libuv/src/unix/proctitle.c +132 -0
  1849. data/ext/libuv/src/unix/pthread-fixes.c +56 -0
  1850. data/ext/libuv/src/unix/random-devurandom.c +93 -0
  1851. data/ext/libuv/src/unix/random-getentropy.c +57 -0
  1852. data/ext/libuv/src/unix/random-getrandom.c +88 -0
  1853. data/ext/libuv/src/unix/random-sysctl-linux.c +99 -0
  1854. data/ext/libuv/src/unix/signal.c +577 -0
  1855. data/ext/libuv/src/unix/spinlock.h +53 -0
  1856. data/ext/libuv/src/unix/stream.c +1697 -0
  1857. data/ext/libuv/src/unix/sunos.c +836 -0
  1858. data/ext/libuv/src/unix/sysinfo-loadavg.c +36 -0
  1859. data/ext/libuv/src/unix/sysinfo-memory.c +42 -0
  1860. data/ext/libuv/src/unix/tcp.c +450 -0
  1861. data/ext/libuv/src/unix/thread.c +852 -0
  1862. data/ext/libuv/src/unix/tty.c +381 -0
  1863. data/ext/libuv/src/unix/udp.c +1136 -0
  1864. data/ext/libuv/src/uv-common.c +812 -0
  1865. data/ext/libuv/src/uv-common.h +326 -0
  1866. data/ext/libuv/src/uv-data-getter-setters.c +98 -0
  1867. data/ext/libuv/src/version.c +45 -0
  1868. data/ext/libuv/src/win/async.c +98 -0
  1869. data/ext/libuv/src/win/atomicops-inl.h +57 -0
  1870. data/ext/libuv/src/win/core.c +657 -0
  1871. data/ext/libuv/src/win/detect-wakeup.c +35 -0
  1872. data/ext/libuv/src/win/dl.c +136 -0
  1873. data/ext/libuv/src/win/error.c +172 -0
  1874. data/ext/libuv/src/win/fs-event.c +589 -0
  1875. data/ext/libuv/src/win/fs-fd-hash-inl.h +178 -0
  1876. data/ext/libuv/src/win/fs.c +3238 -0
  1877. data/ext/libuv/src/win/getaddrinfo.c +463 -0
  1878. data/ext/libuv/src/win/getnameinfo.c +157 -0
  1879. data/ext/libuv/src/win/handle-inl.h +180 -0
  1880. data/ext/libuv/src/win/handle.c +162 -0
  1881. data/ext/libuv/src/win/internal.h +344 -0
  1882. data/ext/libuv/src/win/loop-watcher.c +122 -0
  1883. data/ext/libuv/src/win/pipe.c +2386 -0
  1884. data/ext/libuv/src/win/poll.c +643 -0
  1885. data/ext/libuv/src/win/process-stdio.c +512 -0
  1886. data/ext/libuv/src/win/process.c +1282 -0
  1887. data/ext/libuv/src/win/req-inl.h +221 -0
  1888. data/ext/libuv/src/win/signal.c +277 -0
  1889. data/ext/libuv/src/win/snprintf.c +42 -0
  1890. data/ext/libuv/src/win/stream-inl.h +54 -0
  1891. data/ext/libuv/src/win/stream.c +243 -0
  1892. data/ext/libuv/src/win/tcp.c +1520 -0
  1893. data/ext/libuv/src/win/thread.c +520 -0
  1894. data/ext/libuv/src/win/tty.c +2348 -0
  1895. data/ext/libuv/src/win/udp.c +1185 -0
  1896. data/ext/libuv/src/win/util.c +1879 -0
  1897. data/ext/libuv/src/win/winapi.c +149 -0
  1898. data/ext/libuv/src/win/winapi.h +4751 -0
  1899. data/ext/libuv/src/win/winsock.c +575 -0
  1900. data/ext/libuv/src/win/winsock.h +201 -0
  1901. data/ext/libuv/test/benchmark-async-pummel.c +119 -0
  1902. data/ext/libuv/test/benchmark-async.c +141 -0
  1903. data/ext/libuv/test/benchmark-fs-stat.c +136 -0
  1904. data/ext/libuv/test/benchmark-getaddrinfo.c +92 -0
  1905. data/ext/libuv/test/benchmark-list.h +163 -0
  1906. data/ext/libuv/test/benchmark-loop-count.c +92 -0
  1907. data/ext/libuv/test/benchmark-million-async.c +112 -0
  1908. data/ext/libuv/test/benchmark-million-timers.c +86 -0
  1909. data/ext/libuv/test/benchmark-multi-accept.c +447 -0
  1910. data/ext/libuv/test/benchmark-ping-pongs.c +221 -0
  1911. data/ext/libuv/test/benchmark-pound.c +351 -0
  1912. data/ext/libuv/test/benchmark-pump.c +476 -0
  1913. data/ext/libuv/test/benchmark-sizes.c +46 -0
  1914. data/ext/libuv/test/benchmark-spawn.c +164 -0
  1915. data/ext/libuv/test/benchmark-tcp-write-batch.c +144 -0
  1916. data/ext/libuv/test/benchmark-thread.c +64 -0
  1917. data/ext/libuv/test/benchmark-udp-pummel.c +243 -0
  1918. data/ext/libuv/test/blackhole-server.c +121 -0
  1919. data/ext/libuv/test/dns-server.c +340 -0
  1920. data/ext/libuv/test/echo-server.c +382 -0
  1921. data/ext/libuv/test/fixtures/empty_file +0 -0
  1922. data/ext/libuv/test/fixtures/load_error.node +1 -0
  1923. data/ext/libuv/test/fixtures/lorem_ipsum.txt +1 -0
  1924. data/ext/libuv/test/run-benchmarks.c +65 -0
  1925. data/ext/libuv/test/run-tests.c +239 -0
  1926. data/ext/libuv/test/runner-unix.c +450 -0
  1927. data/ext/libuv/test/runner-unix.h +36 -0
  1928. data/ext/libuv/test/runner-win.c +357 -0
  1929. data/ext/libuv/test/runner-win.h +41 -0
  1930. data/ext/libuv/test/runner.c +431 -0
  1931. data/ext/libuv/test/runner.h +176 -0
  1932. data/ext/libuv/test/task.h +238 -0
  1933. data/ext/libuv/test/test-active.c +84 -0
  1934. data/ext/libuv/test/test-async-null-cb.c +64 -0
  1935. data/ext/libuv/test/test-async.c +134 -0
  1936. data/ext/libuv/test/test-barrier.c +148 -0
  1937. data/ext/libuv/test/test-callback-order.c +77 -0
  1938. data/ext/libuv/test/test-callback-stack.c +204 -0
  1939. data/ext/libuv/test/test-close-fd.c +80 -0
  1940. data/ext/libuv/test/test-close-order.c +80 -0
  1941. data/ext/libuv/test/test-condvar.c +267 -0
  1942. data/ext/libuv/test/test-connect-unspecified.c +63 -0
  1943. data/ext/libuv/test/test-connection-fail.c +151 -0
  1944. data/ext/libuv/test/test-cwd-and-chdir.c +58 -0
  1945. data/ext/libuv/test/test-default-loop-close.c +59 -0
  1946. data/ext/libuv/test/test-delayed-accept.c +189 -0
  1947. data/ext/libuv/test/test-dlerror.c +61 -0
  1948. data/ext/libuv/test/test-eintr-handling.c +94 -0
  1949. data/ext/libuv/test/test-embed.c +139 -0
  1950. data/ext/libuv/test/test-emfile.c +121 -0
  1951. data/ext/libuv/test/test-env-vars.c +140 -0
  1952. data/ext/libuv/test/test-error.c +79 -0
  1953. data/ext/libuv/test/test-fail-always.c +29 -0
  1954. data/ext/libuv/test/test-fork.c +683 -0
  1955. data/ext/libuv/test/test-fs-copyfile.c +209 -0
  1956. data/ext/libuv/test/test-fs-event.c +1165 -0
  1957. data/ext/libuv/test/test-fs-fd-hash.c +133 -0
  1958. data/ext/libuv/test/test-fs-open-flags.c +435 -0
  1959. data/ext/libuv/test/test-fs-poll.c +300 -0
  1960. data/ext/libuv/test/test-fs-readdir.c +462 -0
  1961. data/ext/libuv/test/test-fs.c +4238 -0
  1962. data/ext/libuv/test/test-get-currentexe.c +86 -0
  1963. data/ext/libuv/test/test-get-loadavg.c +35 -0
  1964. data/ext/libuv/test/test-get-memory.c +40 -0
  1965. data/ext/libuv/test/test-get-passwd.c +86 -0
  1966. data/ext/libuv/test/test-getaddrinfo.c +191 -0
  1967. data/ext/libuv/test/test-gethostname.c +58 -0
  1968. data/ext/libuv/test/test-getnameinfo.c +101 -0
  1969. data/ext/libuv/test/test-getsockname.c +361 -0
  1970. data/ext/libuv/test/test-getters-setters.c +88 -0
  1971. data/ext/libuv/test/test-gettimeofday.c +39 -0
  1972. data/ext/libuv/test/test-handle-fileno.c +125 -0
  1973. data/ext/libuv/test/test-homedir.c +72 -0
  1974. data/ext/libuv/test/test-hrtime.c +52 -0
  1975. data/ext/libuv/test/test-idle.c +99 -0
  1976. data/ext/libuv/test/test-idna.c +195 -0
  1977. data/ext/libuv/test/test-ip4-addr.c +55 -0
  1978. data/ext/libuv/test/test-ip6-addr.c +171 -0
  1979. data/ext/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c +159 -0
  1980. data/ext/libuv/test/test-ipc-send-recv.c +429 -0
  1981. data/ext/libuv/test/test-ipc.c +974 -0
  1982. data/ext/libuv/test/test-list.h +1064 -0
  1983. data/ext/libuv/test/test-loop-alive.c +67 -0
  1984. data/ext/libuv/test/test-loop-close.c +75 -0
  1985. data/ext/libuv/test/test-loop-configure.c +38 -0
  1986. data/ext/libuv/test/test-loop-handles.c +337 -0
  1987. data/ext/libuv/test/test-loop-stop.c +71 -0
  1988. data/ext/libuv/test/test-loop-time.c +63 -0
  1989. data/ext/libuv/test/test-multiple-listen.c +109 -0
  1990. data/ext/libuv/test/test-mutexes.c +182 -0
  1991. data/ext/libuv/test/test-osx-select.c +140 -0
  1992. data/ext/libuv/test/test-pass-always.c +28 -0
  1993. data/ext/libuv/test/test-ping-pong.c +301 -0
  1994. data/ext/libuv/test/test-pipe-bind-error.c +139 -0
  1995. data/ext/libuv/test/test-pipe-close-stdout-read-stdin.c +112 -0
  1996. data/ext/libuv/test/test-pipe-connect-error.c +95 -0
  1997. data/ext/libuv/test/test-pipe-connect-multiple.c +107 -0
  1998. data/ext/libuv/test/test-pipe-connect-prepare.c +83 -0
  1999. data/ext/libuv/test/test-pipe-getsockname.c +266 -0
  2000. data/ext/libuv/test/test-pipe-pending-instances.c +59 -0
  2001. data/ext/libuv/test/test-pipe-sendmsg.c +172 -0
  2002. data/ext/libuv/test/test-pipe-server-close.c +94 -0
  2003. data/ext/libuv/test/test-pipe-set-fchmod.c +90 -0
  2004. data/ext/libuv/test/test-pipe-set-non-blocking.c +99 -0
  2005. data/ext/libuv/test/test-platform-output.c +170 -0
  2006. data/ext/libuv/test/test-poll-close-doesnt-corrupt-stack.c +114 -0
  2007. data/ext/libuv/test/test-poll-close.c +73 -0
  2008. data/ext/libuv/test/test-poll-closesocket.c +92 -0
  2009. data/ext/libuv/test/test-poll-oob.c +210 -0
  2010. data/ext/libuv/test/test-poll.c +668 -0
  2011. data/ext/libuv/test/test-process-priority.c +83 -0
  2012. data/ext/libuv/test/test-process-title-threadsafe.c +89 -0
  2013. data/ext/libuv/test/test-process-title.c +76 -0
  2014. data/ext/libuv/test/test-queue-foreach-delete.c +204 -0
  2015. data/ext/libuv/test/test-random.c +94 -0
  2016. data/ext/libuv/test/test-ref.c +445 -0
  2017. data/ext/libuv/test/test-run-nowait.c +45 -0
  2018. data/ext/libuv/test/test-run-once.c +48 -0
  2019. data/ext/libuv/test/test-semaphore.c +111 -0
  2020. data/ext/libuv/test/test-shutdown-close.c +108 -0
  2021. data/ext/libuv/test/test-shutdown-eof.c +182 -0
  2022. data/ext/libuv/test/test-shutdown-twice.c +85 -0
  2023. data/ext/libuv/test/test-signal-multiple-loops.c +302 -0
  2024. data/ext/libuv/test/test-signal-pending-on-close.c +94 -0
  2025. data/ext/libuv/test/test-signal.c +325 -0
  2026. data/ext/libuv/test/test-socket-buffer-size.c +77 -0
  2027. data/ext/libuv/test/test-spawn.c +1924 -0
  2028. data/ext/libuv/test/test-stdio-over-pipes.c +256 -0
  2029. data/ext/libuv/test/test-strscpy.c +53 -0
  2030. data/ext/libuv/test/test-tcp-alloc-cb-fail.c +123 -0
  2031. data/ext/libuv/test/test-tcp-bind-error.c +254 -0
  2032. data/ext/libuv/test/test-tcp-bind6-error.c +176 -0
  2033. data/ext/libuv/test/test-tcp-close-accept.c +198 -0
  2034. data/ext/libuv/test/test-tcp-close-reset.c +290 -0
  2035. data/ext/libuv/test/test-tcp-close-while-connecting.c +97 -0
  2036. data/ext/libuv/test/test-tcp-close.c +136 -0
  2037. data/ext/libuv/test/test-tcp-connect-error-after-write.c +98 -0
  2038. data/ext/libuv/test/test-tcp-connect-error.c +73 -0
  2039. data/ext/libuv/test/test-tcp-connect-timeout.c +91 -0
  2040. data/ext/libuv/test/test-tcp-connect6-error.c +71 -0
  2041. data/ext/libuv/test/test-tcp-create-socket-early.c +209 -0
  2042. data/ext/libuv/test/test-tcp-flags.c +52 -0
  2043. data/ext/libuv/test/test-tcp-oob.c +146 -0
  2044. data/ext/libuv/test/test-tcp-open.c +400 -0
  2045. data/ext/libuv/test/test-tcp-read-stop.c +76 -0
  2046. data/ext/libuv/test/test-tcp-shutdown-after-write.c +138 -0
  2047. data/ext/libuv/test/test-tcp-try-write-error.c +109 -0
  2048. data/ext/libuv/test/test-tcp-try-write.c +135 -0
  2049. data/ext/libuv/test/test-tcp-unexpected-read.c +117 -0
  2050. data/ext/libuv/test/test-tcp-write-after-connect.c +72 -0
  2051. data/ext/libuv/test/test-tcp-write-fail.c +115 -0
  2052. data/ext/libuv/test/test-tcp-write-queue-order.c +139 -0
  2053. data/ext/libuv/test/test-tcp-write-to-half-open-connection.c +141 -0
  2054. data/ext/libuv/test/test-tcp-writealot.c +180 -0
  2055. data/ext/libuv/test/test-thread-equal.c +45 -0
  2056. data/ext/libuv/test/test-thread.c +286 -0
  2057. data/ext/libuv/test/test-threadpool-cancel.c +349 -0
  2058. data/ext/libuv/test/test-threadpool.c +76 -0
  2059. data/ext/libuv/test/test-timer-again.c +141 -0
  2060. data/ext/libuv/test/test-timer-from-check.c +80 -0
  2061. data/ext/libuv/test/test-timer.c +343 -0
  2062. data/ext/libuv/test/test-tmpdir.c +82 -0
  2063. data/ext/libuv/test/test-tty-duplicate-key.c +321 -0
  2064. data/ext/libuv/test/test-tty.c +464 -0
  2065. data/ext/libuv/test/test-udp-alloc-cb-fail.c +196 -0
  2066. data/ext/libuv/test/test-udp-bind.c +93 -0
  2067. data/ext/libuv/test/test-udp-connect.c +182 -0
  2068. data/ext/libuv/test/test-udp-create-socket-early.c +135 -0
  2069. data/ext/libuv/test/test-udp-dgram-too-big.c +91 -0
  2070. data/ext/libuv/test/test-udp-ipv6.c +200 -0
  2071. data/ext/libuv/test/test-udp-multicast-interface.c +99 -0
  2072. data/ext/libuv/test/test-udp-multicast-interface6.c +103 -0
  2073. data/ext/libuv/test/test-udp-multicast-join.c +181 -0
  2074. data/ext/libuv/test/test-udp-multicast-join6.c +215 -0
  2075. data/ext/libuv/test/test-udp-multicast-ttl.c +94 -0
  2076. data/ext/libuv/test/test-udp-open.c +350 -0
  2077. data/ext/libuv/test/test-udp-options.c +156 -0
  2078. data/ext/libuv/test/test-udp-send-and-recv.c +212 -0
  2079. data/ext/libuv/test/test-udp-send-hang-loop.c +99 -0
  2080. data/ext/libuv/test/test-udp-send-immediate.c +148 -0
  2081. data/ext/libuv/test/test-udp-send-unreachable.c +150 -0
  2082. data/ext/libuv/test/test-udp-try-send.c +121 -0
  2083. data/ext/libuv/test/test-uname.c +69 -0
  2084. data/ext/libuv/test/test-walk-handles.c +77 -0
  2085. data/ext/libuv/test/test-watcher-cross-stop.c +111 -0
  2086. data/ext/libuv/test/test.gyp +293 -0
  2087. data/ext/libuv/tools/make_dist_html.py +124 -0
  2088. data/ext/libuv/tools/vswhere_usability_wrapper.cmd +33 -0
  2089. data/ext/libuv/uv.gyp +368 -0
  2090. data/ext/libuv/vcbuild.bat +184 -0
  2091. data/lib/mt-libuv/tcp.rb +2 -2
  2092. data/lib/mt-libuv/version.rb +1 -1
  2093. data/mt-libuv.gemspec +26 -26
  2094. metadata +2089 -2
@@ -0,0 +1,2386 @@
1
+ /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2
+ *
3
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ * of this software and associated documentation files (the "Software"), to
5
+ * deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ * sell copies of the Software, and to permit persons to whom the Software is
8
+ * furnished to do so, subject to the following conditions:
9
+ *
10
+ * The above copyright notice and this permission notice shall be included in
11
+ * all copies or substantial portions of the Software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ * IN THE SOFTWARE.
20
+ */
21
+
22
+ #include <assert.h>
23
+ #include <io.h>
24
+ #include <stdio.h>
25
+ #include <stdlib.h>
26
+ #include <string.h>
27
+
28
+ #include "handle-inl.h"
29
+ #include "internal.h"
30
+ #include "req-inl.h"
31
+ #include "stream-inl.h"
32
+ #include "uv-common.h"
33
+ #include "uv.h"
34
+
35
+ #include <aclapi.h>
36
+ #include <accctrl.h>
37
+
38
+ /* A zero-size buffer for use by uv_pipe_read */
39
+ static char uv_zero_[] = "";
40
+
41
+ /* Null uv_buf_t */
42
+ static const uv_buf_t uv_null_buf_ = { 0, NULL };
43
+
44
+ /* The timeout that the pipe will wait for the remote end to write data when
45
+ * the local ends wants to shut it down. */
46
+ static const int64_t eof_timeout = 50; /* ms */
47
+
48
+ static const int default_pending_pipe_instances = 4;
49
+
50
+ /* Pipe prefix */
51
+ static char pipe_prefix[] = "\\\\?\\pipe";
52
+ static const int pipe_prefix_len = sizeof(pipe_prefix) - 1;
53
+
54
+ /* IPC incoming xfer queue item. */
55
+ typedef struct {
56
+ uv__ipc_socket_xfer_type_t xfer_type;
57
+ uv__ipc_socket_xfer_info_t xfer_info;
58
+ QUEUE member;
59
+ } uv__ipc_xfer_queue_item_t;
60
+
61
+ /* IPC frame header flags. */
62
+ /* clang-format off */
63
+ enum {
64
+ UV__IPC_FRAME_HAS_DATA = 0x01,
65
+ UV__IPC_FRAME_HAS_SOCKET_XFER = 0x02,
66
+ UV__IPC_FRAME_XFER_IS_TCP_CONNECTION = 0x04,
67
+ /* These are combinations of the flags above. */
68
+ UV__IPC_FRAME_XFER_FLAGS = 0x06,
69
+ UV__IPC_FRAME_VALID_FLAGS = 0x07
70
+ };
71
+ /* clang-format on */
72
+
73
+ /* IPC frame header. */
74
+ typedef struct {
75
+ uint32_t flags;
76
+ uint32_t reserved1; /* Ignored. */
77
+ uint32_t data_length; /* Must be zero if there is no data. */
78
+ uint32_t reserved2; /* Must be zero. */
79
+ } uv__ipc_frame_header_t;
80
+
81
+ /* To implement the IPC protocol correctly, these structures must have exactly
82
+ * the right size. */
83
+ STATIC_ASSERT(sizeof(uv__ipc_frame_header_t) == 16);
84
+ STATIC_ASSERT(sizeof(uv__ipc_socket_xfer_info_t) == 632);
85
+
86
+ /* Coalesced write request. */
87
+ typedef struct {
88
+ uv_write_t req; /* Internal heap-allocated write request. */
89
+ uv_write_t* user_req; /* Pointer to user-specified uv_write_t. */
90
+ } uv__coalesced_write_t;
91
+
92
+
93
+ static void eof_timer_init(uv_pipe_t* pipe);
94
+ static void eof_timer_start(uv_pipe_t* pipe);
95
+ static void eof_timer_stop(uv_pipe_t* pipe);
96
+ static void eof_timer_cb(uv_timer_t* timer);
97
+ static void eof_timer_destroy(uv_pipe_t* pipe);
98
+ static void eof_timer_close_cb(uv_handle_t* handle);
99
+
100
+
101
+ static void uv_unique_pipe_name(char* ptr, char* name, size_t size) {
102
+ snprintf(name, size, "\\\\?\\pipe\\uv\\%p-%lu", ptr, GetCurrentProcessId());
103
+ }
104
+
105
+
106
+ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
107
+ uv_stream_init(loop, (uv_stream_t*)handle, UV_NAMED_PIPE);
108
+
109
+ handle->reqs_pending = 0;
110
+ handle->handle = INVALID_HANDLE_VALUE;
111
+ handle->name = NULL;
112
+ handle->pipe.conn.ipc_remote_pid = 0;
113
+ handle->pipe.conn.ipc_data_frame.payload_remaining = 0;
114
+ QUEUE_INIT(&handle->pipe.conn.ipc_xfer_queue);
115
+ handle->pipe.conn.ipc_xfer_queue_length = 0;
116
+ handle->ipc = ipc;
117
+ handle->pipe.conn.non_overlapped_writes_tail = NULL;
118
+
119
+ return 0;
120
+ }
121
+
122
+
123
+ static void uv_pipe_connection_init(uv_pipe_t* handle) {
124
+ uv_connection_init((uv_stream_t*) handle);
125
+ handle->read_req.data = handle;
126
+ handle->pipe.conn.eof_timer = NULL;
127
+ assert(!(handle->flags & UV_HANDLE_PIPESERVER));
128
+ if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
129
+ handle->pipe.conn.readfile_thread_handle = NULL;
130
+ InitializeCriticalSection(&handle->pipe.conn.readfile_thread_lock);
131
+ }
132
+ }
133
+
134
+
135
+ static HANDLE open_named_pipe(const WCHAR* name, DWORD* duplex_flags) {
136
+ HANDLE pipeHandle;
137
+
138
+ /*
139
+ * Assume that we have a duplex pipe first, so attempt to
140
+ * connect with GENERIC_READ | GENERIC_WRITE.
141
+ */
142
+ pipeHandle = CreateFileW(name,
143
+ GENERIC_READ | GENERIC_WRITE,
144
+ 0,
145
+ NULL,
146
+ OPEN_EXISTING,
147
+ FILE_FLAG_OVERLAPPED,
148
+ NULL);
149
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
150
+ *duplex_flags = UV_HANDLE_READABLE | UV_HANDLE_WRITABLE;
151
+ return pipeHandle;
152
+ }
153
+
154
+ /*
155
+ * If the pipe is not duplex CreateFileW fails with
156
+ * ERROR_ACCESS_DENIED. In that case try to connect
157
+ * as a read-only or write-only.
158
+ */
159
+ if (GetLastError() == ERROR_ACCESS_DENIED) {
160
+ pipeHandle = CreateFileW(name,
161
+ GENERIC_READ | FILE_WRITE_ATTRIBUTES,
162
+ 0,
163
+ NULL,
164
+ OPEN_EXISTING,
165
+ FILE_FLAG_OVERLAPPED,
166
+ NULL);
167
+
168
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
169
+ *duplex_flags = UV_HANDLE_READABLE;
170
+ return pipeHandle;
171
+ }
172
+ }
173
+
174
+ if (GetLastError() == ERROR_ACCESS_DENIED) {
175
+ pipeHandle = CreateFileW(name,
176
+ GENERIC_WRITE | FILE_READ_ATTRIBUTES,
177
+ 0,
178
+ NULL,
179
+ OPEN_EXISTING,
180
+ FILE_FLAG_OVERLAPPED,
181
+ NULL);
182
+
183
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
184
+ *duplex_flags = UV_HANDLE_WRITABLE;
185
+ return pipeHandle;
186
+ }
187
+ }
188
+
189
+ return INVALID_HANDLE_VALUE;
190
+ }
191
+
192
+
193
+ static void close_pipe(uv_pipe_t* pipe) {
194
+ assert(pipe->u.fd == -1 || pipe->u.fd > 2);
195
+ if (pipe->u.fd == -1)
196
+ CloseHandle(pipe->handle);
197
+ else
198
+ close(pipe->u.fd);
199
+
200
+ pipe->u.fd = -1;
201
+ pipe->handle = INVALID_HANDLE_VALUE;
202
+ }
203
+
204
+
205
+ int uv_stdio_pipe_server(uv_loop_t* loop, uv_pipe_t* handle, DWORD access,
206
+ char* name, size_t nameSize) {
207
+ HANDLE pipeHandle;
208
+ int err;
209
+ char* ptr = (char*)handle;
210
+
211
+ for (;;) {
212
+ uv_unique_pipe_name(ptr, name, nameSize);
213
+
214
+ pipeHandle = CreateNamedPipeA(name,
215
+ access | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC,
216
+ PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 65536, 65536, 0,
217
+ NULL);
218
+
219
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
220
+ /* No name collisions. We're done. */
221
+ break;
222
+ }
223
+
224
+ err = GetLastError();
225
+ if (err != ERROR_PIPE_BUSY && err != ERROR_ACCESS_DENIED) {
226
+ goto error;
227
+ }
228
+
229
+ /* Pipe name collision. Increment the pointer and try again. */
230
+ ptr++;
231
+ }
232
+
233
+ if (CreateIoCompletionPort(pipeHandle,
234
+ loop->iocp,
235
+ (ULONG_PTR)handle,
236
+ 0) == NULL) {
237
+ err = GetLastError();
238
+ goto error;
239
+ }
240
+
241
+ uv_pipe_connection_init(handle);
242
+ handle->handle = pipeHandle;
243
+
244
+ return 0;
245
+
246
+ error:
247
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
248
+ CloseHandle(pipeHandle);
249
+ }
250
+
251
+ return err;
252
+ }
253
+
254
+
255
+ static int uv_set_pipe_handle(uv_loop_t* loop,
256
+ uv_pipe_t* handle,
257
+ HANDLE pipeHandle,
258
+ int fd,
259
+ DWORD duplex_flags) {
260
+ NTSTATUS nt_status;
261
+ IO_STATUS_BLOCK io_status;
262
+ FILE_MODE_INFORMATION mode_info;
263
+ DWORD mode = PIPE_READMODE_BYTE | PIPE_WAIT;
264
+ DWORD current_mode = 0;
265
+ DWORD err = 0;
266
+
267
+ if (!(handle->flags & UV_HANDLE_PIPESERVER) &&
268
+ handle->handle != INVALID_HANDLE_VALUE)
269
+ return UV_EBUSY;
270
+
271
+ if (!SetNamedPipeHandleState(pipeHandle, &mode, NULL, NULL)) {
272
+ err = GetLastError();
273
+ if (err == ERROR_ACCESS_DENIED) {
274
+ /*
275
+ * SetNamedPipeHandleState can fail if the handle doesn't have either
276
+ * GENERIC_WRITE or FILE_WRITE_ATTRIBUTES.
277
+ * But if the handle already has the desired wait and blocking modes
278
+ * we can continue.
279
+ */
280
+ if (!GetNamedPipeHandleState(pipeHandle, &current_mode, NULL, NULL,
281
+ NULL, NULL, 0)) {
282
+ return -1;
283
+ } else if (current_mode & PIPE_NOWAIT) {
284
+ SetLastError(ERROR_ACCESS_DENIED);
285
+ return -1;
286
+ }
287
+ } else {
288
+ /* If this returns ERROR_INVALID_PARAMETER we probably opened
289
+ * something that is not a pipe. */
290
+ if (err == ERROR_INVALID_PARAMETER) {
291
+ SetLastError(WSAENOTSOCK);
292
+ }
293
+ return -1;
294
+ }
295
+ }
296
+
297
+ /* Check if the pipe was created with FILE_FLAG_OVERLAPPED. */
298
+ nt_status = pNtQueryInformationFile(pipeHandle,
299
+ &io_status,
300
+ &mode_info,
301
+ sizeof(mode_info),
302
+ FileModeInformation);
303
+ if (nt_status != STATUS_SUCCESS) {
304
+ return -1;
305
+ }
306
+
307
+ if (mode_info.Mode & FILE_SYNCHRONOUS_IO_ALERT ||
308
+ mode_info.Mode & FILE_SYNCHRONOUS_IO_NONALERT) {
309
+ /* Non-overlapped pipe. */
310
+ handle->flags |= UV_HANDLE_NON_OVERLAPPED_PIPE;
311
+ } else {
312
+ /* Overlapped pipe. Try to associate with IOCP. */
313
+ if (CreateIoCompletionPort(pipeHandle,
314
+ loop->iocp,
315
+ (ULONG_PTR)handle,
316
+ 0) == NULL) {
317
+ handle->flags |= UV_HANDLE_EMULATE_IOCP;
318
+ }
319
+ }
320
+
321
+ handle->handle = pipeHandle;
322
+ handle->u.fd = fd;
323
+ handle->flags |= duplex_flags;
324
+
325
+ return 0;
326
+ }
327
+
328
+
329
+ static DWORD WINAPI pipe_shutdown_thread_proc(void* parameter) {
330
+ uv_loop_t* loop;
331
+ uv_pipe_t* handle;
332
+ uv_shutdown_t* req;
333
+
334
+ req = (uv_shutdown_t*) parameter;
335
+ assert(req);
336
+ handle = (uv_pipe_t*) req->handle;
337
+ assert(handle);
338
+ loop = handle->loop;
339
+ assert(loop);
340
+
341
+ FlushFileBuffers(handle->handle);
342
+
343
+ /* Post completed */
344
+ POST_COMPLETION_FOR_REQ(loop, req);
345
+
346
+ return 0;
347
+ }
348
+
349
+
350
+ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
351
+ int err;
352
+ DWORD result;
353
+ uv_shutdown_t* req;
354
+ NTSTATUS nt_status;
355
+ IO_STATUS_BLOCK io_status;
356
+ FILE_PIPE_LOCAL_INFORMATION pipe_info;
357
+ uv__ipc_xfer_queue_item_t* xfer_queue_item;
358
+
359
+ if ((handle->flags & UV_HANDLE_CONNECTION) &&
360
+ handle->stream.conn.shutdown_req != NULL &&
361
+ handle->stream.conn.write_reqs_pending == 0) {
362
+ req = handle->stream.conn.shutdown_req;
363
+
364
+ /* Clear the shutdown_req field so we don't go here again. */
365
+ handle->stream.conn.shutdown_req = NULL;
366
+
367
+ if (handle->flags & UV_HANDLE_CLOSING) {
368
+ UNREGISTER_HANDLE_REQ(loop, handle, req);
369
+
370
+ /* Already closing. Cancel the shutdown. */
371
+ if (req->cb) {
372
+ req->cb(req, UV_ECANCELED);
373
+ }
374
+
375
+ DECREASE_PENDING_REQ_COUNT(handle);
376
+ return;
377
+ }
378
+
379
+ /* Try to avoid flushing the pipe buffer in the thread pool. */
380
+ nt_status = pNtQueryInformationFile(handle->handle,
381
+ &io_status,
382
+ &pipe_info,
383
+ sizeof pipe_info,
384
+ FilePipeLocalInformation);
385
+
386
+ if (nt_status != STATUS_SUCCESS) {
387
+ /* Failure */
388
+ UNREGISTER_HANDLE_REQ(loop, handle, req);
389
+
390
+ handle->flags |= UV_HANDLE_WRITABLE; /* Questionable */
391
+ if (req->cb) {
392
+ err = pRtlNtStatusToDosError(nt_status);
393
+ req->cb(req, uv_translate_sys_error(err));
394
+ }
395
+
396
+ DECREASE_PENDING_REQ_COUNT(handle);
397
+ return;
398
+ }
399
+
400
+ if (pipe_info.OutboundQuota == pipe_info.WriteQuotaAvailable) {
401
+ /* Short-circuit, no need to call FlushFileBuffers. */
402
+ uv_insert_pending_req(loop, (uv_req_t*) req);
403
+ return;
404
+ }
405
+
406
+ /* Run FlushFileBuffers in the thread pool. */
407
+ result = QueueUserWorkItem(pipe_shutdown_thread_proc,
408
+ req,
409
+ WT_EXECUTELONGFUNCTION);
410
+ if (result) {
411
+ return;
412
+
413
+ } else {
414
+ /* Failure. */
415
+ UNREGISTER_HANDLE_REQ(loop, handle, req);
416
+
417
+ handle->flags |= UV_HANDLE_WRITABLE; /* Questionable */
418
+ if (req->cb) {
419
+ err = GetLastError();
420
+ req->cb(req, uv_translate_sys_error(err));
421
+ }
422
+
423
+ DECREASE_PENDING_REQ_COUNT(handle);
424
+ return;
425
+ }
426
+ }
427
+
428
+ if (handle->flags & UV_HANDLE_CLOSING &&
429
+ handle->reqs_pending == 0) {
430
+ assert(!(handle->flags & UV_HANDLE_CLOSED));
431
+
432
+ if (handle->flags & UV_HANDLE_CONNECTION) {
433
+ /* Free pending sockets */
434
+ while (!QUEUE_EMPTY(&handle->pipe.conn.ipc_xfer_queue)) {
435
+ QUEUE* q;
436
+ SOCKET socket;
437
+
438
+ q = QUEUE_HEAD(&handle->pipe.conn.ipc_xfer_queue);
439
+ QUEUE_REMOVE(q);
440
+ xfer_queue_item = QUEUE_DATA(q, uv__ipc_xfer_queue_item_t, member);
441
+
442
+ /* Materialize socket and close it */
443
+ socket = WSASocketW(FROM_PROTOCOL_INFO,
444
+ FROM_PROTOCOL_INFO,
445
+ FROM_PROTOCOL_INFO,
446
+ &xfer_queue_item->xfer_info.socket_info,
447
+ 0,
448
+ WSA_FLAG_OVERLAPPED);
449
+ uv__free(xfer_queue_item);
450
+
451
+ if (socket != INVALID_SOCKET)
452
+ closesocket(socket);
453
+ }
454
+ handle->pipe.conn.ipc_xfer_queue_length = 0;
455
+
456
+ if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
457
+ if (handle->read_req.wait_handle != INVALID_HANDLE_VALUE) {
458
+ UnregisterWait(handle->read_req.wait_handle);
459
+ handle->read_req.wait_handle = INVALID_HANDLE_VALUE;
460
+ }
461
+ if (handle->read_req.event_handle) {
462
+ CloseHandle(handle->read_req.event_handle);
463
+ handle->read_req.event_handle = NULL;
464
+ }
465
+ }
466
+
467
+ if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE)
468
+ DeleteCriticalSection(&handle->pipe.conn.readfile_thread_lock);
469
+ }
470
+
471
+ if (handle->flags & UV_HANDLE_PIPESERVER) {
472
+ assert(handle->pipe.serv.accept_reqs);
473
+ uv__free(handle->pipe.serv.accept_reqs);
474
+ handle->pipe.serv.accept_reqs = NULL;
475
+ }
476
+
477
+ uv__handle_close(handle);
478
+ }
479
+ }
480
+
481
+
482
+ void uv_pipe_pending_instances(uv_pipe_t* handle, int count) {
483
+ if (handle->flags & UV_HANDLE_BOUND)
484
+ return;
485
+ handle->pipe.serv.pending_instances = count;
486
+ handle->flags |= UV_HANDLE_PIPESERVER;
487
+ }
488
+
489
+
490
+ /* Creates a pipe server. */
491
+ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
492
+ uv_loop_t* loop = handle->loop;
493
+ int i, err, nameSize;
494
+ uv_pipe_accept_t* req;
495
+
496
+ if (handle->flags & UV_HANDLE_BOUND) {
497
+ return UV_EINVAL;
498
+ }
499
+
500
+ if (!name) {
501
+ return UV_EINVAL;
502
+ }
503
+
504
+ if (!(handle->flags & UV_HANDLE_PIPESERVER)) {
505
+ handle->pipe.serv.pending_instances = default_pending_pipe_instances;
506
+ }
507
+
508
+ handle->pipe.serv.accept_reqs = (uv_pipe_accept_t*)
509
+ uv__malloc(sizeof(uv_pipe_accept_t) * handle->pipe.serv.pending_instances);
510
+ if (!handle->pipe.serv.accept_reqs) {
511
+ uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
512
+ }
513
+
514
+ for (i = 0; i < handle->pipe.serv.pending_instances; i++) {
515
+ req = &handle->pipe.serv.accept_reqs[i];
516
+ UV_REQ_INIT(req, UV_ACCEPT);
517
+ req->data = handle;
518
+ req->pipeHandle = INVALID_HANDLE_VALUE;
519
+ req->next_pending = NULL;
520
+ }
521
+
522
+ /* Convert name to UTF16. */
523
+ nameSize = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0) * sizeof(WCHAR);
524
+ handle->name = (WCHAR*)uv__malloc(nameSize);
525
+ if (!handle->name) {
526
+ uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
527
+ }
528
+
529
+ if (!MultiByteToWideChar(CP_UTF8,
530
+ 0,
531
+ name,
532
+ -1,
533
+ handle->name,
534
+ nameSize / sizeof(WCHAR))) {
535
+ err = GetLastError();
536
+ goto error;
537
+ }
538
+
539
+ /*
540
+ * Attempt to create the first pipe with FILE_FLAG_FIRST_PIPE_INSTANCE.
541
+ * If this fails then there's already a pipe server for the given pipe name.
542
+ */
543
+ handle->pipe.serv.accept_reqs[0].pipeHandle = CreateNamedPipeW(handle->name,
544
+ PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED |
545
+ FILE_FLAG_FIRST_PIPE_INSTANCE | WRITE_DAC,
546
+ PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
547
+ PIPE_UNLIMITED_INSTANCES, 65536, 65536, 0, NULL);
548
+
549
+ if (handle->pipe.serv.accept_reqs[0].pipeHandle == INVALID_HANDLE_VALUE) {
550
+ err = GetLastError();
551
+ if (err == ERROR_ACCESS_DENIED) {
552
+ err = WSAEADDRINUSE; /* Translates to UV_EADDRINUSE. */
553
+ } else if (err == ERROR_PATH_NOT_FOUND || err == ERROR_INVALID_NAME) {
554
+ err = WSAEACCES; /* Translates to UV_EACCES. */
555
+ }
556
+ goto error;
557
+ }
558
+
559
+ if (uv_set_pipe_handle(loop,
560
+ handle,
561
+ handle->pipe.serv.accept_reqs[0].pipeHandle,
562
+ -1,
563
+ 0)) {
564
+ err = GetLastError();
565
+ goto error;
566
+ }
567
+
568
+ handle->pipe.serv.pending_accepts = NULL;
569
+ handle->flags |= UV_HANDLE_PIPESERVER;
570
+ handle->flags |= UV_HANDLE_BOUND;
571
+
572
+ return 0;
573
+
574
+ error:
575
+ if (handle->name) {
576
+ uv__free(handle->name);
577
+ handle->name = NULL;
578
+ }
579
+
580
+ if (handle->pipe.serv.accept_reqs[0].pipeHandle != INVALID_HANDLE_VALUE) {
581
+ CloseHandle(handle->pipe.serv.accept_reqs[0].pipeHandle);
582
+ handle->pipe.serv.accept_reqs[0].pipeHandle = INVALID_HANDLE_VALUE;
583
+ }
584
+
585
+ return uv_translate_sys_error(err);
586
+ }
587
+
588
+
589
+ static DWORD WINAPI pipe_connect_thread_proc(void* parameter) {
590
+ uv_loop_t* loop;
591
+ uv_pipe_t* handle;
592
+ uv_connect_t* req;
593
+ HANDLE pipeHandle = INVALID_HANDLE_VALUE;
594
+ DWORD duplex_flags;
595
+
596
+ req = (uv_connect_t*) parameter;
597
+ assert(req);
598
+ handle = (uv_pipe_t*) req->handle;
599
+ assert(handle);
600
+ loop = handle->loop;
601
+ assert(loop);
602
+
603
+ /* We're here because CreateFile on a pipe returned ERROR_PIPE_BUSY. We wait
604
+ * for the pipe to become available with WaitNamedPipe. */
605
+ while (WaitNamedPipeW(handle->name, 30000)) {
606
+ /* The pipe is now available, try to connect. */
607
+ pipeHandle = open_named_pipe(handle->name, &duplex_flags);
608
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
609
+ break;
610
+ }
611
+
612
+ SwitchToThread();
613
+ }
614
+
615
+ if (pipeHandle != INVALID_HANDLE_VALUE &&
616
+ !uv_set_pipe_handle(loop, handle, pipeHandle, -1, duplex_flags)) {
617
+ SET_REQ_SUCCESS(req);
618
+ } else {
619
+ SET_REQ_ERROR(req, GetLastError());
620
+ }
621
+
622
+ /* Post completed */
623
+ POST_COMPLETION_FOR_REQ(loop, req);
624
+
625
+ return 0;
626
+ }
627
+
628
+
629
+ void uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle,
630
+ const char* name, uv_connect_cb cb) {
631
+ uv_loop_t* loop = handle->loop;
632
+ int err, nameSize;
633
+ HANDLE pipeHandle = INVALID_HANDLE_VALUE;
634
+ DWORD duplex_flags;
635
+
636
+ UV_REQ_INIT(req, UV_CONNECT);
637
+ req->handle = (uv_stream_t*) handle;
638
+ req->cb = cb;
639
+
640
+ /* Convert name to UTF16. */
641
+ nameSize = MultiByteToWideChar(CP_UTF8, 0, name, -1, NULL, 0) * sizeof(WCHAR);
642
+ handle->name = (WCHAR*)uv__malloc(nameSize);
643
+ if (!handle->name) {
644
+ uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
645
+ }
646
+
647
+ if (!MultiByteToWideChar(CP_UTF8,
648
+ 0,
649
+ name,
650
+ -1,
651
+ handle->name,
652
+ nameSize / sizeof(WCHAR))) {
653
+ err = GetLastError();
654
+ goto error;
655
+ }
656
+
657
+ pipeHandle = open_named_pipe(handle->name, &duplex_flags);
658
+ if (pipeHandle == INVALID_HANDLE_VALUE) {
659
+ if (GetLastError() == ERROR_PIPE_BUSY) {
660
+ /* Wait for the server to make a pipe instance available. */
661
+ if (!QueueUserWorkItem(&pipe_connect_thread_proc,
662
+ req,
663
+ WT_EXECUTELONGFUNCTION)) {
664
+ err = GetLastError();
665
+ goto error;
666
+ }
667
+
668
+ REGISTER_HANDLE_REQ(loop, handle, req);
669
+ handle->reqs_pending++;
670
+
671
+ return;
672
+ }
673
+
674
+ err = GetLastError();
675
+ goto error;
676
+ }
677
+
678
+ assert(pipeHandle != INVALID_HANDLE_VALUE);
679
+
680
+ if (uv_set_pipe_handle(loop,
681
+ (uv_pipe_t*) req->handle,
682
+ pipeHandle,
683
+ -1,
684
+ duplex_flags)) {
685
+ err = GetLastError();
686
+ goto error;
687
+ }
688
+
689
+ SET_REQ_SUCCESS(req);
690
+ uv_insert_pending_req(loop, (uv_req_t*) req);
691
+ handle->reqs_pending++;
692
+ REGISTER_HANDLE_REQ(loop, handle, req);
693
+ return;
694
+
695
+ error:
696
+ if (handle->name) {
697
+ uv__free(handle->name);
698
+ handle->name = NULL;
699
+ }
700
+
701
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
702
+ CloseHandle(pipeHandle);
703
+ }
704
+
705
+ /* Make this req pending reporting an error. */
706
+ SET_REQ_ERROR(req, err);
707
+ uv_insert_pending_req(loop, (uv_req_t*) req);
708
+ handle->reqs_pending++;
709
+ REGISTER_HANDLE_REQ(loop, handle, req);
710
+ return;
711
+ }
712
+
713
+
714
+ void uv__pipe_interrupt_read(uv_pipe_t* handle) {
715
+ BOOL r;
716
+
717
+ if (!(handle->flags & UV_HANDLE_READ_PENDING))
718
+ return; /* No pending reads. */
719
+ if (handle->flags & UV_HANDLE_CANCELLATION_PENDING)
720
+ return; /* Already cancelled. */
721
+ if (handle->handle == INVALID_HANDLE_VALUE)
722
+ return; /* Pipe handle closed. */
723
+
724
+ if (!(handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE)) {
725
+ /* Cancel asynchronous read. */
726
+ r = CancelIoEx(handle->handle, &handle->read_req.u.io.overlapped);
727
+ assert(r || GetLastError() == ERROR_NOT_FOUND);
728
+
729
+ } else {
730
+ /* Cancel synchronous read (which is happening in the thread pool). */
731
+ HANDLE thread;
732
+ volatile HANDLE* thread_ptr = &handle->pipe.conn.readfile_thread_handle;
733
+
734
+ EnterCriticalSection(&handle->pipe.conn.readfile_thread_lock);
735
+
736
+ thread = *thread_ptr;
737
+ if (thread == NULL) {
738
+ /* The thread pool thread has not yet reached the point of blocking, we
739
+ * can pre-empt it by setting thread_handle to INVALID_HANDLE_VALUE. */
740
+ *thread_ptr = INVALID_HANDLE_VALUE;
741
+
742
+ } else {
743
+ /* Spin until the thread has acknowledged (by setting the thread to
744
+ * INVALID_HANDLE_VALUE) that it is past the point of blocking. */
745
+ while (thread != INVALID_HANDLE_VALUE) {
746
+ r = CancelSynchronousIo(thread);
747
+ assert(r || GetLastError() == ERROR_NOT_FOUND);
748
+ SwitchToThread(); /* Yield thread. */
749
+ thread = *thread_ptr;
750
+ }
751
+ }
752
+
753
+ LeaveCriticalSection(&handle->pipe.conn.readfile_thread_lock);
754
+ }
755
+
756
+ /* Set flag to indicate that read has been cancelled. */
757
+ handle->flags |= UV_HANDLE_CANCELLATION_PENDING;
758
+ }
759
+
760
+
761
+ void uv__pipe_read_stop(uv_pipe_t* handle) {
762
+ handle->flags &= ~UV_HANDLE_READING;
763
+ DECREASE_ACTIVE_COUNT(handle->loop, handle);
764
+
765
+ uv__pipe_interrupt_read(handle);
766
+ }
767
+
768
+
769
+ /* Cleans up uv_pipe_t (server or connection) and all resources associated with
770
+ * it. */
771
+ void uv_pipe_cleanup(uv_loop_t* loop, uv_pipe_t* handle) {
772
+ int i;
773
+ HANDLE pipeHandle;
774
+
775
+ uv__pipe_interrupt_read(handle);
776
+
777
+ if (handle->name) {
778
+ uv__free(handle->name);
779
+ handle->name = NULL;
780
+ }
781
+
782
+ if (handle->flags & UV_HANDLE_PIPESERVER) {
783
+ for (i = 0; i < handle->pipe.serv.pending_instances; i++) {
784
+ pipeHandle = handle->pipe.serv.accept_reqs[i].pipeHandle;
785
+ if (pipeHandle != INVALID_HANDLE_VALUE) {
786
+ CloseHandle(pipeHandle);
787
+ handle->pipe.serv.accept_reqs[i].pipeHandle = INVALID_HANDLE_VALUE;
788
+ }
789
+ }
790
+ handle->handle = INVALID_HANDLE_VALUE;
791
+ }
792
+
793
+ if (handle->flags & UV_HANDLE_CONNECTION) {
794
+ handle->flags &= ~UV_HANDLE_WRITABLE;
795
+ eof_timer_destroy(handle);
796
+ }
797
+
798
+ if ((handle->flags & UV_HANDLE_CONNECTION)
799
+ && handle->handle != INVALID_HANDLE_VALUE)
800
+ close_pipe(handle);
801
+ }
802
+
803
+
804
+ void uv_pipe_close(uv_loop_t* loop, uv_pipe_t* handle) {
805
+ if (handle->flags & UV_HANDLE_READING) {
806
+ handle->flags &= ~UV_HANDLE_READING;
807
+ DECREASE_ACTIVE_COUNT(loop, handle);
808
+ }
809
+
810
+ if (handle->flags & UV_HANDLE_LISTENING) {
811
+ handle->flags &= ~UV_HANDLE_LISTENING;
812
+ DECREASE_ACTIVE_COUNT(loop, handle);
813
+ }
814
+
815
+ uv_pipe_cleanup(loop, handle);
816
+
817
+ if (handle->reqs_pending == 0) {
818
+ uv_want_endgame(loop, (uv_handle_t*) handle);
819
+ }
820
+
821
+ handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
822
+ uv__handle_closing(handle);
823
+ }
824
+
825
+
826
+ static void uv_pipe_queue_accept(uv_loop_t* loop, uv_pipe_t* handle,
827
+ uv_pipe_accept_t* req, BOOL firstInstance) {
828
+ assert(handle->flags & UV_HANDLE_LISTENING);
829
+
830
+ if (!firstInstance) {
831
+ assert(req->pipeHandle == INVALID_HANDLE_VALUE);
832
+
833
+ req->pipeHandle = CreateNamedPipeW(handle->name,
834
+ PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | WRITE_DAC,
835
+ PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
836
+ PIPE_UNLIMITED_INSTANCES, 65536, 65536, 0, NULL);
837
+
838
+ if (req->pipeHandle == INVALID_HANDLE_VALUE) {
839
+ SET_REQ_ERROR(req, GetLastError());
840
+ uv_insert_pending_req(loop, (uv_req_t*) req);
841
+ handle->reqs_pending++;
842
+ return;
843
+ }
844
+
845
+ if (uv_set_pipe_handle(loop, handle, req->pipeHandle, -1, 0)) {
846
+ CloseHandle(req->pipeHandle);
847
+ req->pipeHandle = INVALID_HANDLE_VALUE;
848
+ SET_REQ_ERROR(req, GetLastError());
849
+ uv_insert_pending_req(loop, (uv_req_t*) req);
850
+ handle->reqs_pending++;
851
+ return;
852
+ }
853
+ }
854
+
855
+ assert(req->pipeHandle != INVALID_HANDLE_VALUE);
856
+
857
+ /* Prepare the overlapped structure. */
858
+ memset(&(req->u.io.overlapped), 0, sizeof(req->u.io.overlapped));
859
+
860
+ if (!ConnectNamedPipe(req->pipeHandle, &req->u.io.overlapped) &&
861
+ GetLastError() != ERROR_IO_PENDING) {
862
+ if (GetLastError() == ERROR_PIPE_CONNECTED) {
863
+ SET_REQ_SUCCESS(req);
864
+ } else {
865
+ CloseHandle(req->pipeHandle);
866
+ req->pipeHandle = INVALID_HANDLE_VALUE;
867
+ /* Make this req pending reporting an error. */
868
+ SET_REQ_ERROR(req, GetLastError());
869
+ }
870
+ uv_insert_pending_req(loop, (uv_req_t*) req);
871
+ handle->reqs_pending++;
872
+ return;
873
+ }
874
+
875
+ /* Wait for completion via IOCP */
876
+ handle->reqs_pending++;
877
+ }
878
+
879
+
880
+ int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client) {
881
+ uv_loop_t* loop = server->loop;
882
+ uv_pipe_t* pipe_client;
883
+ uv_pipe_accept_t* req;
884
+ QUEUE* q;
885
+ uv__ipc_xfer_queue_item_t* item;
886
+ int err;
887
+
888
+ if (server->ipc) {
889
+ if (QUEUE_EMPTY(&server->pipe.conn.ipc_xfer_queue)) {
890
+ /* No valid pending sockets. */
891
+ return WSAEWOULDBLOCK;
892
+ }
893
+
894
+ q = QUEUE_HEAD(&server->pipe.conn.ipc_xfer_queue);
895
+ QUEUE_REMOVE(q);
896
+ server->pipe.conn.ipc_xfer_queue_length--;
897
+ item = QUEUE_DATA(q, uv__ipc_xfer_queue_item_t, member);
898
+
899
+ err = uv__tcp_xfer_import(
900
+ (uv_tcp_t*) client, item->xfer_type, &item->xfer_info);
901
+ if (err != 0)
902
+ return err;
903
+
904
+ uv__free(item);
905
+
906
+ } else {
907
+ pipe_client = (uv_pipe_t*)client;
908
+
909
+ /* Find a connection instance that has been connected, but not yet
910
+ * accepted. */
911
+ req = server->pipe.serv.pending_accepts;
912
+
913
+ if (!req) {
914
+ /* No valid connections found, so we error out. */
915
+ return WSAEWOULDBLOCK;
916
+ }
917
+
918
+ /* Initialize the client handle and copy the pipeHandle to the client */
919
+ uv_pipe_connection_init(pipe_client);
920
+ pipe_client->handle = req->pipeHandle;
921
+ pipe_client->flags |= UV_HANDLE_READABLE | UV_HANDLE_WRITABLE;
922
+
923
+ /* Prepare the req to pick up a new connection */
924
+ server->pipe.serv.pending_accepts = req->next_pending;
925
+ req->next_pending = NULL;
926
+ req->pipeHandle = INVALID_HANDLE_VALUE;
927
+
928
+ if (!(server->flags & UV_HANDLE_CLOSING)) {
929
+ uv_pipe_queue_accept(loop, server, req, FALSE);
930
+ }
931
+ }
932
+
933
+ return 0;
934
+ }
935
+
936
+
937
+ /* Starts listening for connections for the given pipe. */
938
+ int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb) {
939
+ uv_loop_t* loop = handle->loop;
940
+ int i;
941
+
942
+ if (handle->flags & UV_HANDLE_LISTENING) {
943
+ handle->stream.serv.connection_cb = cb;
944
+ }
945
+
946
+ if (!(handle->flags & UV_HANDLE_BOUND)) {
947
+ return WSAEINVAL;
948
+ }
949
+
950
+ if (handle->flags & UV_HANDLE_READING) {
951
+ return WSAEISCONN;
952
+ }
953
+
954
+ if (!(handle->flags & UV_HANDLE_PIPESERVER)) {
955
+ return ERROR_NOT_SUPPORTED;
956
+ }
957
+
958
+ handle->flags |= UV_HANDLE_LISTENING;
959
+ INCREASE_ACTIVE_COUNT(loop, handle);
960
+ handle->stream.serv.connection_cb = cb;
961
+
962
+ /* First pipe handle should have already been created in uv_pipe_bind */
963
+ assert(handle->pipe.serv.accept_reqs[0].pipeHandle != INVALID_HANDLE_VALUE);
964
+
965
+ for (i = 0; i < handle->pipe.serv.pending_instances; i++) {
966
+ uv_pipe_queue_accept(loop, handle, &handle->pipe.serv.accept_reqs[i], i == 0);
967
+ }
968
+
969
+ return 0;
970
+ }
971
+
972
+
973
+ static DWORD WINAPI uv_pipe_zero_readfile_thread_proc(void* arg) {
974
+ uv_read_t* req = (uv_read_t*) arg;
975
+ uv_pipe_t* handle = (uv_pipe_t*) req->data;
976
+ uv_loop_t* loop = handle->loop;
977
+ volatile HANDLE* thread_ptr = &handle->pipe.conn.readfile_thread_handle;
978
+ CRITICAL_SECTION* lock = &handle->pipe.conn.readfile_thread_lock;
979
+ HANDLE thread;
980
+ DWORD bytes;
981
+ DWORD err;
982
+
983
+ assert(req->type == UV_READ);
984
+ assert(handle->type == UV_NAMED_PIPE);
985
+
986
+ err = 0;
987
+
988
+ /* Create a handle to the current thread. */
989
+ if (!DuplicateHandle(GetCurrentProcess(),
990
+ GetCurrentThread(),
991
+ GetCurrentProcess(),
992
+ &thread,
993
+ 0,
994
+ FALSE,
995
+ DUPLICATE_SAME_ACCESS)) {
996
+ err = GetLastError();
997
+ goto out1;
998
+ }
999
+
1000
+ /* The lock needs to be held when thread handle is modified. */
1001
+ EnterCriticalSection(lock);
1002
+ if (*thread_ptr == INVALID_HANDLE_VALUE) {
1003
+ /* uv__pipe_interrupt_read() cancelled reading before we got here. */
1004
+ err = ERROR_OPERATION_ABORTED;
1005
+ } else {
1006
+ /* Let main thread know which worker thread is doing the blocking read. */
1007
+ assert(*thread_ptr == NULL);
1008
+ *thread_ptr = thread;
1009
+ }
1010
+ LeaveCriticalSection(lock);
1011
+
1012
+ if (err)
1013
+ goto out2;
1014
+
1015
+ /* Block the thread until data is available on the pipe, or the read is
1016
+ * cancelled. */
1017
+ if (!ReadFile(handle->handle, &uv_zero_, 0, &bytes, NULL))
1018
+ err = GetLastError();
1019
+
1020
+ /* Let the main thread know the worker is past the point of blocking. */
1021
+ assert(thread == *thread_ptr);
1022
+ *thread_ptr = INVALID_HANDLE_VALUE;
1023
+
1024
+ /* Briefly acquire the mutex. Since the main thread holds the lock while it
1025
+ * is spinning trying to cancel this thread's I/O, we will block here until
1026
+ * it stops doing that. */
1027
+ EnterCriticalSection(lock);
1028
+ LeaveCriticalSection(lock);
1029
+
1030
+ out2:
1031
+ /* Close the handle to the current thread. */
1032
+ CloseHandle(thread);
1033
+
1034
+ out1:
1035
+ /* Set request status and post a completion record to the IOCP. */
1036
+ if (err)
1037
+ SET_REQ_ERROR(req, err);
1038
+ else
1039
+ SET_REQ_SUCCESS(req);
1040
+ POST_COMPLETION_FOR_REQ(loop, req);
1041
+
1042
+ return 0;
1043
+ }
1044
+
1045
+
1046
+ static DWORD WINAPI uv_pipe_writefile_thread_proc(void* parameter) {
1047
+ int result;
1048
+ DWORD bytes;
1049
+ uv_write_t* req = (uv_write_t*) parameter;
1050
+ uv_pipe_t* handle = (uv_pipe_t*) req->handle;
1051
+ uv_loop_t* loop = handle->loop;
1052
+
1053
+ assert(req != NULL);
1054
+ assert(req->type == UV_WRITE);
1055
+ assert(handle->type == UV_NAMED_PIPE);
1056
+ assert(req->write_buffer.base);
1057
+
1058
+ result = WriteFile(handle->handle,
1059
+ req->write_buffer.base,
1060
+ req->write_buffer.len,
1061
+ &bytes,
1062
+ NULL);
1063
+
1064
+ if (!result) {
1065
+ SET_REQ_ERROR(req, GetLastError());
1066
+ }
1067
+
1068
+ POST_COMPLETION_FOR_REQ(loop, req);
1069
+ return 0;
1070
+ }
1071
+
1072
+
1073
+ static void CALLBACK post_completion_read_wait(void* context, BOOLEAN timed_out) {
1074
+ uv_read_t* req;
1075
+ uv_tcp_t* handle;
1076
+
1077
+ req = (uv_read_t*) context;
1078
+ assert(req != NULL);
1079
+ handle = (uv_tcp_t*)req->data;
1080
+ assert(handle != NULL);
1081
+ assert(!timed_out);
1082
+
1083
+ if (!PostQueuedCompletionStatus(handle->loop->iocp,
1084
+ req->u.io.overlapped.InternalHigh,
1085
+ 0,
1086
+ &req->u.io.overlapped)) {
1087
+ uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus");
1088
+ }
1089
+ }
1090
+
1091
+
1092
+ static void CALLBACK post_completion_write_wait(void* context, BOOLEAN timed_out) {
1093
+ uv_write_t* req;
1094
+ uv_tcp_t* handle;
1095
+
1096
+ req = (uv_write_t*) context;
1097
+ assert(req != NULL);
1098
+ handle = (uv_tcp_t*)req->handle;
1099
+ assert(handle != NULL);
1100
+ assert(!timed_out);
1101
+
1102
+ if (!PostQueuedCompletionStatus(handle->loop->iocp,
1103
+ req->u.io.overlapped.InternalHigh,
1104
+ 0,
1105
+ &req->u.io.overlapped)) {
1106
+ uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus");
1107
+ }
1108
+ }
1109
+
1110
+
1111
+ static void uv_pipe_queue_read(uv_loop_t* loop, uv_pipe_t* handle) {
1112
+ uv_read_t* req;
1113
+ int result;
1114
+
1115
+ assert(handle->flags & UV_HANDLE_READING);
1116
+ assert(!(handle->flags & UV_HANDLE_READ_PENDING));
1117
+
1118
+ assert(handle->handle != INVALID_HANDLE_VALUE);
1119
+
1120
+ req = &handle->read_req;
1121
+
1122
+ if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
1123
+ handle->pipe.conn.readfile_thread_handle = NULL; /* Reset cancellation. */
1124
+ if (!QueueUserWorkItem(&uv_pipe_zero_readfile_thread_proc,
1125
+ req,
1126
+ WT_EXECUTELONGFUNCTION)) {
1127
+ /* Make this req pending reporting an error. */
1128
+ SET_REQ_ERROR(req, GetLastError());
1129
+ goto error;
1130
+ }
1131
+ } else {
1132
+ memset(&req->u.io.overlapped, 0, sizeof(req->u.io.overlapped));
1133
+ if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
1134
+ req->u.io.overlapped.hEvent = (HANDLE) ((uintptr_t) req->event_handle | 1);
1135
+ }
1136
+
1137
+ /* Do 0-read */
1138
+ result = ReadFile(handle->handle,
1139
+ &uv_zero_,
1140
+ 0,
1141
+ NULL,
1142
+ &req->u.io.overlapped);
1143
+
1144
+ if (!result && GetLastError() != ERROR_IO_PENDING) {
1145
+ /* Make this req pending reporting an error. */
1146
+ SET_REQ_ERROR(req, GetLastError());
1147
+ goto error;
1148
+ }
1149
+
1150
+ if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
1151
+ if (!req->event_handle) {
1152
+ req->event_handle = CreateEvent(NULL, 0, 0, NULL);
1153
+ if (!req->event_handle) {
1154
+ uv_fatal_error(GetLastError(), "CreateEvent");
1155
+ }
1156
+ }
1157
+ if (req->wait_handle == INVALID_HANDLE_VALUE) {
1158
+ if (!RegisterWaitForSingleObject(&req->wait_handle,
1159
+ req->u.io.overlapped.hEvent, post_completion_read_wait, (void*) req,
1160
+ INFINITE, WT_EXECUTEINWAITTHREAD)) {
1161
+ SET_REQ_ERROR(req, GetLastError());
1162
+ goto error;
1163
+ }
1164
+ }
1165
+ }
1166
+ }
1167
+
1168
+ /* Start the eof timer if there is one */
1169
+ eof_timer_start(handle);
1170
+ handle->flags |= UV_HANDLE_READ_PENDING;
1171
+ handle->reqs_pending++;
1172
+ return;
1173
+
1174
+ error:
1175
+ uv_insert_pending_req(loop, (uv_req_t*)req);
1176
+ handle->flags |= UV_HANDLE_READ_PENDING;
1177
+ handle->reqs_pending++;
1178
+ }
1179
+
1180
+
1181
+ int uv_pipe_read_start(uv_pipe_t* handle,
1182
+ uv_alloc_cb alloc_cb,
1183
+ uv_read_cb read_cb) {
1184
+ uv_loop_t* loop = handle->loop;
1185
+
1186
+ handle->flags |= UV_HANDLE_READING;
1187
+ INCREASE_ACTIVE_COUNT(loop, handle);
1188
+ handle->read_cb = read_cb;
1189
+ handle->alloc_cb = alloc_cb;
1190
+
1191
+ /* If reading was stopped and then started again, there could still be a read
1192
+ * request pending. */
1193
+ if (!(handle->flags & UV_HANDLE_READ_PENDING))
1194
+ uv_pipe_queue_read(loop, handle);
1195
+
1196
+ return 0;
1197
+ }
1198
+
1199
+
1200
+ static void uv_insert_non_overlapped_write_req(uv_pipe_t* handle,
1201
+ uv_write_t* req) {
1202
+ req->next_req = NULL;
1203
+ if (handle->pipe.conn.non_overlapped_writes_tail) {
1204
+ req->next_req =
1205
+ handle->pipe.conn.non_overlapped_writes_tail->next_req;
1206
+ handle->pipe.conn.non_overlapped_writes_tail->next_req = (uv_req_t*)req;
1207
+ handle->pipe.conn.non_overlapped_writes_tail = req;
1208
+ } else {
1209
+ req->next_req = (uv_req_t*)req;
1210
+ handle->pipe.conn.non_overlapped_writes_tail = req;
1211
+ }
1212
+ }
1213
+
1214
+
1215
+ static uv_write_t* uv_remove_non_overlapped_write_req(uv_pipe_t* handle) {
1216
+ uv_write_t* req;
1217
+
1218
+ if (handle->pipe.conn.non_overlapped_writes_tail) {
1219
+ req = (uv_write_t*)handle->pipe.conn.non_overlapped_writes_tail->next_req;
1220
+
1221
+ if (req == handle->pipe.conn.non_overlapped_writes_tail) {
1222
+ handle->pipe.conn.non_overlapped_writes_tail = NULL;
1223
+ } else {
1224
+ handle->pipe.conn.non_overlapped_writes_tail->next_req =
1225
+ req->next_req;
1226
+ }
1227
+
1228
+ return req;
1229
+ } else {
1230
+ /* queue empty */
1231
+ return NULL;
1232
+ }
1233
+ }
1234
+
1235
+
1236
+ static void uv_queue_non_overlapped_write(uv_pipe_t* handle) {
1237
+ uv_write_t* req = uv_remove_non_overlapped_write_req(handle);
1238
+ if (req) {
1239
+ if (!QueueUserWorkItem(&uv_pipe_writefile_thread_proc,
1240
+ req,
1241
+ WT_EXECUTELONGFUNCTION)) {
1242
+ uv_fatal_error(GetLastError(), "QueueUserWorkItem");
1243
+ }
1244
+ }
1245
+ }
1246
+
1247
+
1248
+ static int uv__build_coalesced_write_req(uv_write_t* user_req,
1249
+ const uv_buf_t bufs[],
1250
+ size_t nbufs,
1251
+ uv_write_t** req_out,
1252
+ uv_buf_t* write_buf_out) {
1253
+ /* Pack into a single heap-allocated buffer:
1254
+ * (a) a uv_write_t structure where libuv stores the actual state.
1255
+ * (b) a pointer to the original uv_write_t.
1256
+ * (c) data from all `bufs` entries.
1257
+ */
1258
+ char* heap_buffer;
1259
+ size_t heap_buffer_length, heap_buffer_offset;
1260
+ uv__coalesced_write_t* coalesced_write_req; /* (a) + (b) */
1261
+ char* data_start; /* (c) */
1262
+ size_t data_length;
1263
+ unsigned int i;
1264
+
1265
+ /* Compute combined size of all combined buffers from `bufs`. */
1266
+ data_length = 0;
1267
+ for (i = 0; i < nbufs; i++)
1268
+ data_length += bufs[i].len;
1269
+
1270
+ /* The total combined size of data buffers should not exceed UINT32_MAX,
1271
+ * because WriteFile() won't accept buffers larger than that. */
1272
+ if (data_length > UINT32_MAX)
1273
+ return WSAENOBUFS; /* Maps to UV_ENOBUFS. */
1274
+
1275
+ /* Compute heap buffer size. */
1276
+ heap_buffer_length = sizeof *coalesced_write_req + /* (a) + (b) */
1277
+ data_length; /* (c) */
1278
+
1279
+ /* Allocate buffer. */
1280
+ heap_buffer = uv__malloc(heap_buffer_length);
1281
+ if (heap_buffer == NULL)
1282
+ return ERROR_NOT_ENOUGH_MEMORY; /* Maps to UV_ENOMEM. */
1283
+
1284
+ /* Copy uv_write_t information to the buffer. */
1285
+ coalesced_write_req = (uv__coalesced_write_t*) heap_buffer;
1286
+ coalesced_write_req->req = *user_req; /* copy (a) */
1287
+ coalesced_write_req->req.coalesced = 1;
1288
+ coalesced_write_req->user_req = user_req; /* copy (b) */
1289
+ heap_buffer_offset = sizeof *coalesced_write_req; /* offset (a) + (b) */
1290
+
1291
+ /* Copy data buffers to the heap buffer. */
1292
+ data_start = &heap_buffer[heap_buffer_offset];
1293
+ for (i = 0; i < nbufs; i++) {
1294
+ memcpy(&heap_buffer[heap_buffer_offset],
1295
+ bufs[i].base,
1296
+ bufs[i].len); /* copy (c) */
1297
+ heap_buffer_offset += bufs[i].len; /* offset (c) */
1298
+ }
1299
+ assert(heap_buffer_offset == heap_buffer_length);
1300
+
1301
+ /* Set out arguments and return. */
1302
+ *req_out = &coalesced_write_req->req;
1303
+ *write_buf_out = uv_buf_init(data_start, (unsigned int) data_length);
1304
+ return 0;
1305
+ }
1306
+
1307
+
1308
+ static int uv__pipe_write_data(uv_loop_t* loop,
1309
+ uv_write_t* req,
1310
+ uv_pipe_t* handle,
1311
+ const uv_buf_t bufs[],
1312
+ size_t nbufs,
1313
+ uv_write_cb cb,
1314
+ int copy_always) {
1315
+ int err;
1316
+ int result;
1317
+ uv_buf_t write_buf;
1318
+
1319
+ assert(handle->handle != INVALID_HANDLE_VALUE);
1320
+
1321
+ UV_REQ_INIT(req, UV_WRITE);
1322
+ req->handle = (uv_stream_t*) handle;
1323
+ req->send_handle = NULL;
1324
+ req->cb = cb;
1325
+ /* Private fields. */
1326
+ req->coalesced = 0;
1327
+ req->event_handle = NULL;
1328
+ req->wait_handle = INVALID_HANDLE_VALUE;
1329
+ memset(&req->u.io.overlapped, 0, sizeof(req->u.io.overlapped));
1330
+ req->write_buffer = uv_null_buf_;
1331
+
1332
+ if (nbufs == 0) {
1333
+ /* Write empty buffer. */
1334
+ write_buf = uv_null_buf_;
1335
+ } else if (nbufs == 1 && !copy_always) {
1336
+ /* Write directly from bufs[0]. */
1337
+ write_buf = bufs[0];
1338
+ } else {
1339
+ /* Coalesce all `bufs` into one big buffer. This also creates a new
1340
+ * write-request structure that replaces the old one. */
1341
+ err = uv__build_coalesced_write_req(req, bufs, nbufs, &req, &write_buf);
1342
+ if (err != 0)
1343
+ return err;
1344
+ }
1345
+
1346
+ if ((handle->flags &
1347
+ (UV_HANDLE_BLOCKING_WRITES | UV_HANDLE_NON_OVERLAPPED_PIPE)) ==
1348
+ (UV_HANDLE_BLOCKING_WRITES | UV_HANDLE_NON_OVERLAPPED_PIPE)) {
1349
+ DWORD bytes;
1350
+ result =
1351
+ WriteFile(handle->handle, write_buf.base, write_buf.len, &bytes, NULL);
1352
+
1353
+ if (!result) {
1354
+ err = GetLastError();
1355
+ return err;
1356
+ } else {
1357
+ /* Request completed immediately. */
1358
+ req->u.io.queued_bytes = 0;
1359
+ }
1360
+
1361
+ REGISTER_HANDLE_REQ(loop, handle, req);
1362
+ handle->reqs_pending++;
1363
+ handle->stream.conn.write_reqs_pending++;
1364
+ POST_COMPLETION_FOR_REQ(loop, req);
1365
+ return 0;
1366
+ } else if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
1367
+ req->write_buffer = write_buf;
1368
+ uv_insert_non_overlapped_write_req(handle, req);
1369
+ if (handle->stream.conn.write_reqs_pending == 0) {
1370
+ uv_queue_non_overlapped_write(handle);
1371
+ }
1372
+
1373
+ /* Request queued by the kernel. */
1374
+ req->u.io.queued_bytes = write_buf.len;
1375
+ handle->write_queue_size += req->u.io.queued_bytes;
1376
+ } else if (handle->flags & UV_HANDLE_BLOCKING_WRITES) {
1377
+ /* Using overlapped IO, but wait for completion before returning */
1378
+ req->u.io.overlapped.hEvent = CreateEvent(NULL, 1, 0, NULL);
1379
+ if (!req->u.io.overlapped.hEvent) {
1380
+ uv_fatal_error(GetLastError(), "CreateEvent");
1381
+ }
1382
+
1383
+ result = WriteFile(handle->handle,
1384
+ write_buf.base,
1385
+ write_buf.len,
1386
+ NULL,
1387
+ &req->u.io.overlapped);
1388
+
1389
+ if (!result && GetLastError() != ERROR_IO_PENDING) {
1390
+ err = GetLastError();
1391
+ CloseHandle(req->u.io.overlapped.hEvent);
1392
+ return err;
1393
+ }
1394
+
1395
+ if (result) {
1396
+ /* Request completed immediately. */
1397
+ req->u.io.queued_bytes = 0;
1398
+ } else {
1399
+ /* Request queued by the kernel. */
1400
+ req->u.io.queued_bytes = write_buf.len;
1401
+ handle->write_queue_size += req->u.io.queued_bytes;
1402
+ if (WaitForSingleObject(req->u.io.overlapped.hEvent, INFINITE) !=
1403
+ WAIT_OBJECT_0) {
1404
+ err = GetLastError();
1405
+ CloseHandle(req->u.io.overlapped.hEvent);
1406
+ return err;
1407
+ }
1408
+ }
1409
+ CloseHandle(req->u.io.overlapped.hEvent);
1410
+
1411
+ REGISTER_HANDLE_REQ(loop, handle, req);
1412
+ handle->reqs_pending++;
1413
+ handle->stream.conn.write_reqs_pending++;
1414
+ return 0;
1415
+ } else {
1416
+ result = WriteFile(handle->handle,
1417
+ write_buf.base,
1418
+ write_buf.len,
1419
+ NULL,
1420
+ &req->u.io.overlapped);
1421
+
1422
+ if (!result && GetLastError() != ERROR_IO_PENDING) {
1423
+ return GetLastError();
1424
+ }
1425
+
1426
+ if (result) {
1427
+ /* Request completed immediately. */
1428
+ req->u.io.queued_bytes = 0;
1429
+ } else {
1430
+ /* Request queued by the kernel. */
1431
+ req->u.io.queued_bytes = write_buf.len;
1432
+ handle->write_queue_size += req->u.io.queued_bytes;
1433
+ }
1434
+
1435
+ if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
1436
+ req->event_handle = CreateEvent(NULL, 0, 0, NULL);
1437
+ if (!req->event_handle) {
1438
+ uv_fatal_error(GetLastError(), "CreateEvent");
1439
+ }
1440
+ if (!RegisterWaitForSingleObject(&req->wait_handle,
1441
+ req->u.io.overlapped.hEvent, post_completion_write_wait, (void*) req,
1442
+ INFINITE, WT_EXECUTEINWAITTHREAD)) {
1443
+ return GetLastError();
1444
+ }
1445
+ }
1446
+ }
1447
+
1448
+ REGISTER_HANDLE_REQ(loop, handle, req);
1449
+ handle->reqs_pending++;
1450
+ handle->stream.conn.write_reqs_pending++;
1451
+
1452
+ return 0;
1453
+ }
1454
+
1455
+
1456
+ static DWORD uv__pipe_get_ipc_remote_pid(uv_pipe_t* handle) {
1457
+ DWORD* pid = &handle->pipe.conn.ipc_remote_pid;
1458
+
1459
+ /* If the both ends of the IPC pipe are owned by the same process,
1460
+ * the remote end pid may not yet be set. If so, do it here.
1461
+ * TODO: this is weird; it'd probably better to use a handshake. */
1462
+ if (*pid == 0)
1463
+ *pid = GetCurrentProcessId();
1464
+
1465
+ return *pid;
1466
+ }
1467
+
1468
+
1469
+ int uv__pipe_write_ipc(uv_loop_t* loop,
1470
+ uv_write_t* req,
1471
+ uv_pipe_t* handle,
1472
+ const uv_buf_t data_bufs[],
1473
+ size_t data_buf_count,
1474
+ uv_stream_t* send_handle,
1475
+ uv_write_cb cb) {
1476
+ uv_buf_t stack_bufs[6];
1477
+ uv_buf_t* bufs;
1478
+ size_t buf_count, buf_index;
1479
+ uv__ipc_frame_header_t frame_header;
1480
+ uv__ipc_socket_xfer_type_t xfer_type = UV__IPC_SOCKET_XFER_NONE;
1481
+ uv__ipc_socket_xfer_info_t xfer_info;
1482
+ uint64_t data_length;
1483
+ size_t i;
1484
+ int err;
1485
+
1486
+ /* Compute the combined size of data buffers. */
1487
+ data_length = 0;
1488
+ for (i = 0; i < data_buf_count; i++)
1489
+ data_length += data_bufs[i].len;
1490
+ if (data_length > UINT32_MAX)
1491
+ return WSAENOBUFS; /* Maps to UV_ENOBUFS. */
1492
+
1493
+ /* Prepare the frame's socket xfer payload. */
1494
+ if (send_handle != NULL) {
1495
+ uv_tcp_t* send_tcp_handle = (uv_tcp_t*) send_handle;
1496
+
1497
+ /* Verify that `send_handle` it is indeed a tcp handle. */
1498
+ if (send_tcp_handle->type != UV_TCP)
1499
+ return ERROR_NOT_SUPPORTED;
1500
+
1501
+ /* Export the tcp handle. */
1502
+ err = uv__tcp_xfer_export(send_tcp_handle,
1503
+ uv__pipe_get_ipc_remote_pid(handle),
1504
+ &xfer_type,
1505
+ &xfer_info);
1506
+ if (err != 0)
1507
+ return err;
1508
+ }
1509
+
1510
+ /* Compute the number of uv_buf_t's required. */
1511
+ buf_count = 1 + data_buf_count; /* Frame header and data buffers. */
1512
+ if (send_handle != NULL)
1513
+ buf_count += 1; /* One extra for the socket xfer information. */
1514
+
1515
+ /* Use the on-stack buffer array if it is big enough; otherwise allocate
1516
+ * space for it on the heap. */
1517
+ if (buf_count < ARRAY_SIZE(stack_bufs)) {
1518
+ /* Use on-stack buffer array. */
1519
+ bufs = stack_bufs;
1520
+ } else {
1521
+ /* Use heap-allocated buffer array. */
1522
+ bufs = uv__calloc(buf_count, sizeof(uv_buf_t));
1523
+ if (bufs == NULL)
1524
+ return ERROR_NOT_ENOUGH_MEMORY; /* Maps to UV_ENOMEM. */
1525
+ }
1526
+ buf_index = 0;
1527
+
1528
+ /* Initialize frame header and add it to the buffers list. */
1529
+ memset(&frame_header, 0, sizeof frame_header);
1530
+ bufs[buf_index++] = uv_buf_init((char*) &frame_header, sizeof frame_header);
1531
+
1532
+ if (send_handle != NULL) {
1533
+ /* Add frame header flags. */
1534
+ switch (xfer_type) {
1535
+ case UV__IPC_SOCKET_XFER_TCP_CONNECTION:
1536
+ frame_header.flags |= UV__IPC_FRAME_HAS_SOCKET_XFER |
1537
+ UV__IPC_FRAME_XFER_IS_TCP_CONNECTION;
1538
+ break;
1539
+ case UV__IPC_SOCKET_XFER_TCP_SERVER:
1540
+ frame_header.flags |= UV__IPC_FRAME_HAS_SOCKET_XFER;
1541
+ break;
1542
+ default:
1543
+ assert(0); /* Unreachable. */
1544
+ }
1545
+ /* Add xfer info buffer. */
1546
+ bufs[buf_index++] = uv_buf_init((char*) &xfer_info, sizeof xfer_info);
1547
+ }
1548
+
1549
+ if (data_length > 0) {
1550
+ /* Update frame header. */
1551
+ frame_header.flags |= UV__IPC_FRAME_HAS_DATA;
1552
+ frame_header.data_length = (uint32_t) data_length;
1553
+ /* Add data buffers to buffers list. */
1554
+ for (i = 0; i < data_buf_count; i++)
1555
+ bufs[buf_index++] = data_bufs[i];
1556
+ }
1557
+
1558
+ /* Write buffers. We set the `always_copy` flag, so it is not a problem that
1559
+ * some of the written data lives on the stack. */
1560
+ err = uv__pipe_write_data(loop, req, handle, bufs, buf_count, cb, 1);
1561
+
1562
+ /* If we had to heap-allocate the bufs array, free it now. */
1563
+ if (bufs != stack_bufs) {
1564
+ uv__free(bufs);
1565
+ }
1566
+
1567
+ return err;
1568
+ }
1569
+
1570
+
1571
+ int uv__pipe_write(uv_loop_t* loop,
1572
+ uv_write_t* req,
1573
+ uv_pipe_t* handle,
1574
+ const uv_buf_t bufs[],
1575
+ size_t nbufs,
1576
+ uv_stream_t* send_handle,
1577
+ uv_write_cb cb) {
1578
+ if (handle->ipc) {
1579
+ /* IPC pipe write: use framing protocol. */
1580
+ return uv__pipe_write_ipc(loop, req, handle, bufs, nbufs, send_handle, cb);
1581
+ } else {
1582
+ /* Non-IPC pipe write: put data on the wire directly. */
1583
+ assert(send_handle == NULL);
1584
+ return uv__pipe_write_data(loop, req, handle, bufs, nbufs, cb, 0);
1585
+ }
1586
+ }
1587
+
1588
+
1589
+ static void uv_pipe_read_eof(uv_loop_t* loop, uv_pipe_t* handle,
1590
+ uv_buf_t buf) {
1591
+ /* If there is an eof timer running, we don't need it any more, so discard
1592
+ * it. */
1593
+ eof_timer_destroy(handle);
1594
+
1595
+ handle->flags &= ~UV_HANDLE_READABLE;
1596
+ uv_read_stop((uv_stream_t*) handle);
1597
+
1598
+ handle->read_cb((uv_stream_t*) handle, UV_EOF, &buf);
1599
+ }
1600
+
1601
+
1602
+ static void uv_pipe_read_error(uv_loop_t* loop, uv_pipe_t* handle, int error,
1603
+ uv_buf_t buf) {
1604
+ /* If there is an eof timer running, we don't need it any more, so discard
1605
+ * it. */
1606
+ eof_timer_destroy(handle);
1607
+
1608
+ uv_read_stop((uv_stream_t*) handle);
1609
+
1610
+ handle->read_cb((uv_stream_t*)handle, uv_translate_sys_error(error), &buf);
1611
+ }
1612
+
1613
+
1614
+ static void uv_pipe_read_error_or_eof(uv_loop_t* loop, uv_pipe_t* handle,
1615
+ int error, uv_buf_t buf) {
1616
+ if (error == ERROR_BROKEN_PIPE) {
1617
+ uv_pipe_read_eof(loop, handle, buf);
1618
+ } else {
1619
+ uv_pipe_read_error(loop, handle, error, buf);
1620
+ }
1621
+ }
1622
+
1623
+
1624
+ static void uv__pipe_queue_ipc_xfer_info(
1625
+ uv_pipe_t* handle,
1626
+ uv__ipc_socket_xfer_type_t xfer_type,
1627
+ uv__ipc_socket_xfer_info_t* xfer_info) {
1628
+ uv__ipc_xfer_queue_item_t* item;
1629
+
1630
+ item = (uv__ipc_xfer_queue_item_t*) uv__malloc(sizeof(*item));
1631
+ if (item == NULL)
1632
+ uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
1633
+
1634
+ item->xfer_type = xfer_type;
1635
+ item->xfer_info = *xfer_info;
1636
+
1637
+ QUEUE_INSERT_TAIL(&handle->pipe.conn.ipc_xfer_queue, &item->member);
1638
+ handle->pipe.conn.ipc_xfer_queue_length++;
1639
+ }
1640
+
1641
+
1642
+ /* Read an exact number of bytes from a pipe. If an error or end-of-file is
1643
+ * encountered before the requested number of bytes are read, an error is
1644
+ * returned. */
1645
+ static int uv__pipe_read_exactly(HANDLE h, void* buffer, DWORD count) {
1646
+ DWORD bytes_read, bytes_read_now;
1647
+
1648
+ bytes_read = 0;
1649
+ while (bytes_read < count) {
1650
+ if (!ReadFile(h,
1651
+ (char*) buffer + bytes_read,
1652
+ count - bytes_read,
1653
+ &bytes_read_now,
1654
+ NULL)) {
1655
+ return GetLastError();
1656
+ }
1657
+
1658
+ bytes_read += bytes_read_now;
1659
+ }
1660
+
1661
+ assert(bytes_read == count);
1662
+ return 0;
1663
+ }
1664
+
1665
+
1666
+ static DWORD uv__pipe_read_data(uv_loop_t* loop,
1667
+ uv_pipe_t* handle,
1668
+ DWORD suggested_bytes,
1669
+ DWORD max_bytes) {
1670
+ DWORD bytes_read;
1671
+ uv_buf_t buf;
1672
+
1673
+ /* Ask the user for a buffer to read data into. */
1674
+ buf = uv_buf_init(NULL, 0);
1675
+ handle->alloc_cb((uv_handle_t*) handle, suggested_bytes, &buf);
1676
+ if (buf.base == NULL || buf.len == 0) {
1677
+ handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, &buf);
1678
+ return 0; /* Break out of read loop. */
1679
+ }
1680
+
1681
+ /* Ensure we read at most the smaller of:
1682
+ * (a) the length of the user-allocated buffer.
1683
+ * (b) the maximum data length as specified by the `max_bytes` argument.
1684
+ */
1685
+ if (max_bytes > buf.len)
1686
+ max_bytes = buf.len;
1687
+
1688
+ /* Read into the user buffer. */
1689
+ if (!ReadFile(handle->handle, buf.base, max_bytes, &bytes_read, NULL)) {
1690
+ uv_pipe_read_error_or_eof(loop, handle, GetLastError(), buf);
1691
+ return 0; /* Break out of read loop. */
1692
+ }
1693
+
1694
+ /* Call the read callback. */
1695
+ handle->read_cb((uv_stream_t*) handle, bytes_read, &buf);
1696
+
1697
+ return bytes_read;
1698
+ }
1699
+
1700
+
1701
+ static DWORD uv__pipe_read_ipc(uv_loop_t* loop, uv_pipe_t* handle) {
1702
+ uint32_t* data_remaining = &handle->pipe.conn.ipc_data_frame.payload_remaining;
1703
+ int err;
1704
+
1705
+ if (*data_remaining > 0) {
1706
+ /* Read frame data payload. */
1707
+ DWORD bytes_read =
1708
+ uv__pipe_read_data(loop, handle, *data_remaining, *data_remaining);
1709
+ *data_remaining -= bytes_read;
1710
+ return bytes_read;
1711
+
1712
+ } else {
1713
+ /* Start of a new IPC frame. */
1714
+ uv__ipc_frame_header_t frame_header;
1715
+ uint32_t xfer_flags;
1716
+ uv__ipc_socket_xfer_type_t xfer_type;
1717
+ uv__ipc_socket_xfer_info_t xfer_info;
1718
+
1719
+ /* Read the IPC frame header. */
1720
+ err = uv__pipe_read_exactly(
1721
+ handle->handle, &frame_header, sizeof frame_header);
1722
+ if (err)
1723
+ goto error;
1724
+
1725
+ /* Validate that flags are valid. */
1726
+ if ((frame_header.flags & ~UV__IPC_FRAME_VALID_FLAGS) != 0)
1727
+ goto invalid;
1728
+ /* Validate that reserved2 is zero. */
1729
+ if (frame_header.reserved2 != 0)
1730
+ goto invalid;
1731
+
1732
+ /* Parse xfer flags. */
1733
+ xfer_flags = frame_header.flags & UV__IPC_FRAME_XFER_FLAGS;
1734
+ if (xfer_flags & UV__IPC_FRAME_HAS_SOCKET_XFER) {
1735
+ /* Socket coming -- determine the type. */
1736
+ xfer_type = xfer_flags & UV__IPC_FRAME_XFER_IS_TCP_CONNECTION
1737
+ ? UV__IPC_SOCKET_XFER_TCP_CONNECTION
1738
+ : UV__IPC_SOCKET_XFER_TCP_SERVER;
1739
+ } else if (xfer_flags == 0) {
1740
+ /* No socket. */
1741
+ xfer_type = UV__IPC_SOCKET_XFER_NONE;
1742
+ } else {
1743
+ /* Invalid flags. */
1744
+ goto invalid;
1745
+ }
1746
+
1747
+ /* Parse data frame information. */
1748
+ if (frame_header.flags & UV__IPC_FRAME_HAS_DATA) {
1749
+ *data_remaining = frame_header.data_length;
1750
+ } else if (frame_header.data_length != 0) {
1751
+ /* Data length greater than zero but data flag not set -- invalid. */
1752
+ goto invalid;
1753
+ }
1754
+
1755
+ /* If no socket xfer info follows, return here. Data will be read in a
1756
+ * subsequent invocation of uv__pipe_read_ipc(). */
1757
+ if (xfer_type == UV__IPC_SOCKET_XFER_NONE)
1758
+ return sizeof frame_header; /* Number of bytes read. */
1759
+
1760
+ /* Read transferred socket information. */
1761
+ err = uv__pipe_read_exactly(handle->handle, &xfer_info, sizeof xfer_info);
1762
+ if (err)
1763
+ goto error;
1764
+
1765
+ /* Store the pending socket info. */
1766
+ uv__pipe_queue_ipc_xfer_info(handle, xfer_type, &xfer_info);
1767
+
1768
+ /* Return number of bytes read. */
1769
+ return sizeof frame_header + sizeof xfer_info;
1770
+ }
1771
+
1772
+ invalid:
1773
+ /* Invalid frame. */
1774
+ err = WSAECONNABORTED; /* Maps to UV_ECONNABORTED. */
1775
+
1776
+ error:
1777
+ uv_pipe_read_error_or_eof(loop, handle, err, uv_null_buf_);
1778
+ return 0; /* Break out of read loop. */
1779
+ }
1780
+
1781
+
1782
+ void uv_process_pipe_read_req(uv_loop_t* loop,
1783
+ uv_pipe_t* handle,
1784
+ uv_req_t* req) {
1785
+ assert(handle->type == UV_NAMED_PIPE);
1786
+
1787
+ handle->flags &= ~(UV_HANDLE_READ_PENDING | UV_HANDLE_CANCELLATION_PENDING);
1788
+ DECREASE_PENDING_REQ_COUNT(handle);
1789
+ eof_timer_stop(handle);
1790
+
1791
+ /* At this point, we're done with bookkeeping. If the user has stopped
1792
+ * reading the pipe in the meantime, there is nothing left to do, since there
1793
+ * is no callback that we can call. */
1794
+ if (!(handle->flags & UV_HANDLE_READING))
1795
+ return;
1796
+
1797
+ if (!REQ_SUCCESS(req)) {
1798
+ /* An error occurred doing the zero-read. */
1799
+ DWORD err = GET_REQ_ERROR(req);
1800
+
1801
+ /* If the read was cancelled by uv__pipe_interrupt_read(), the request may
1802
+ * indicate an ERROR_OPERATION_ABORTED error. This error isn't relevant to
1803
+ * the user; we'll start a new zero-read at the end of this function. */
1804
+ if (err != ERROR_OPERATION_ABORTED)
1805
+ uv_pipe_read_error_or_eof(loop, handle, err, uv_null_buf_);
1806
+
1807
+ } else {
1808
+ /* The zero-read completed without error, indicating there is data
1809
+ * available in the kernel buffer. */
1810
+ DWORD avail;
1811
+
1812
+ /* Get the number of bytes available. */
1813
+ avail = 0;
1814
+ if (!PeekNamedPipe(handle->handle, NULL, 0, NULL, &avail, NULL))
1815
+ uv_pipe_read_error_or_eof(loop, handle, GetLastError(), uv_null_buf_);
1816
+
1817
+ /* Read until we've either read all the bytes available, or the 'reading'
1818
+ * flag is cleared. */
1819
+ while (avail > 0 && handle->flags & UV_HANDLE_READING) {
1820
+ /* Depending on the type of pipe, read either IPC frames or raw data. */
1821
+ DWORD bytes_read =
1822
+ handle->ipc ? uv__pipe_read_ipc(loop, handle)
1823
+ : uv__pipe_read_data(loop, handle, avail, (DWORD) -1);
1824
+
1825
+ /* If no bytes were read, treat this as an indication that an error
1826
+ * occurred, and break out of the read loop. */
1827
+ if (bytes_read == 0)
1828
+ break;
1829
+
1830
+ /* It is possible that more bytes were read than we thought were
1831
+ * available. To prevent `avail` from underflowing, break out of the loop
1832
+ * if this is the case. */
1833
+ if (bytes_read > avail)
1834
+ break;
1835
+
1836
+ /* Recompute the number of bytes available. */
1837
+ avail -= bytes_read;
1838
+ }
1839
+ }
1840
+
1841
+ /* Start another zero-read request if necessary. */
1842
+ if ((handle->flags & UV_HANDLE_READING) &&
1843
+ !(handle->flags & UV_HANDLE_READ_PENDING)) {
1844
+ uv_pipe_queue_read(loop, handle);
1845
+ }
1846
+ }
1847
+
1848
+
1849
+ void uv_process_pipe_write_req(uv_loop_t* loop, uv_pipe_t* handle,
1850
+ uv_write_t* req) {
1851
+ int err;
1852
+
1853
+ assert(handle->type == UV_NAMED_PIPE);
1854
+
1855
+ assert(handle->write_queue_size >= req->u.io.queued_bytes);
1856
+ handle->write_queue_size -= req->u.io.queued_bytes;
1857
+
1858
+ UNREGISTER_HANDLE_REQ(loop, handle, req);
1859
+
1860
+ if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
1861
+ if (req->wait_handle != INVALID_HANDLE_VALUE) {
1862
+ UnregisterWait(req->wait_handle);
1863
+ req->wait_handle = INVALID_HANDLE_VALUE;
1864
+ }
1865
+ if (req->event_handle) {
1866
+ CloseHandle(req->event_handle);
1867
+ req->event_handle = NULL;
1868
+ }
1869
+ }
1870
+
1871
+ err = GET_REQ_ERROR(req);
1872
+
1873
+ /* If this was a coalesced write, extract pointer to the user_provided
1874
+ * uv_write_t structure so we can pass the expected pointer to the callback,
1875
+ * then free the heap-allocated write req. */
1876
+ if (req->coalesced) {
1877
+ uv__coalesced_write_t* coalesced_write =
1878
+ container_of(req, uv__coalesced_write_t, req);
1879
+ req = coalesced_write->user_req;
1880
+ uv__free(coalesced_write);
1881
+ }
1882
+ if (req->cb) {
1883
+ req->cb(req, uv_translate_sys_error(err));
1884
+ }
1885
+
1886
+ handle->stream.conn.write_reqs_pending--;
1887
+
1888
+ if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE &&
1889
+ handle->pipe.conn.non_overlapped_writes_tail) {
1890
+ assert(handle->stream.conn.write_reqs_pending > 0);
1891
+ uv_queue_non_overlapped_write(handle);
1892
+ }
1893
+
1894
+ if (handle->stream.conn.shutdown_req != NULL &&
1895
+ handle->stream.conn.write_reqs_pending == 0) {
1896
+ uv_want_endgame(loop, (uv_handle_t*)handle);
1897
+ }
1898
+
1899
+ DECREASE_PENDING_REQ_COUNT(handle);
1900
+ }
1901
+
1902
+
1903
+ void uv_process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle,
1904
+ uv_req_t* raw_req) {
1905
+ uv_pipe_accept_t* req = (uv_pipe_accept_t*) raw_req;
1906
+
1907
+ assert(handle->type == UV_NAMED_PIPE);
1908
+
1909
+ if (handle->flags & UV_HANDLE_CLOSING) {
1910
+ /* The req->pipeHandle should be freed already in uv_pipe_cleanup(). */
1911
+ assert(req->pipeHandle == INVALID_HANDLE_VALUE);
1912
+ DECREASE_PENDING_REQ_COUNT(handle);
1913
+ return;
1914
+ }
1915
+
1916
+ if (REQ_SUCCESS(req)) {
1917
+ assert(req->pipeHandle != INVALID_HANDLE_VALUE);
1918
+ req->next_pending = handle->pipe.serv.pending_accepts;
1919
+ handle->pipe.serv.pending_accepts = req;
1920
+
1921
+ if (handle->stream.serv.connection_cb) {
1922
+ handle->stream.serv.connection_cb((uv_stream_t*)handle, 0);
1923
+ }
1924
+ } else {
1925
+ if (req->pipeHandle != INVALID_HANDLE_VALUE) {
1926
+ CloseHandle(req->pipeHandle);
1927
+ req->pipeHandle = INVALID_HANDLE_VALUE;
1928
+ }
1929
+ if (!(handle->flags & UV_HANDLE_CLOSING)) {
1930
+ uv_pipe_queue_accept(loop, handle, req, FALSE);
1931
+ }
1932
+ }
1933
+
1934
+ DECREASE_PENDING_REQ_COUNT(handle);
1935
+ }
1936
+
1937
+
1938
+ void uv_process_pipe_connect_req(uv_loop_t* loop, uv_pipe_t* handle,
1939
+ uv_connect_t* req) {
1940
+ int err;
1941
+
1942
+ assert(handle->type == UV_NAMED_PIPE);
1943
+
1944
+ UNREGISTER_HANDLE_REQ(loop, handle, req);
1945
+
1946
+ if (req->cb) {
1947
+ err = 0;
1948
+ if (REQ_SUCCESS(req)) {
1949
+ uv_pipe_connection_init(handle);
1950
+ } else {
1951
+ err = GET_REQ_ERROR(req);
1952
+ }
1953
+ req->cb(req, uv_translate_sys_error(err));
1954
+ }
1955
+
1956
+ DECREASE_PENDING_REQ_COUNT(handle);
1957
+ }
1958
+
1959
+
1960
+ void uv_process_pipe_shutdown_req(uv_loop_t* loop, uv_pipe_t* handle,
1961
+ uv_shutdown_t* req) {
1962
+ assert(handle->type == UV_NAMED_PIPE);
1963
+
1964
+ UNREGISTER_HANDLE_REQ(loop, handle, req);
1965
+
1966
+ if (handle->flags & UV_HANDLE_READABLE) {
1967
+ /* Initialize and optionally start the eof timer. Only do this if the pipe
1968
+ * is readable and we haven't seen EOF come in ourselves. */
1969
+ eof_timer_init(handle);
1970
+
1971
+ /* If reading start the timer right now. Otherwise uv_pipe_queue_read will
1972
+ * start it. */
1973
+ if (handle->flags & UV_HANDLE_READ_PENDING) {
1974
+ eof_timer_start(handle);
1975
+ }
1976
+
1977
+ } else {
1978
+ /* This pipe is not readable. We can just close it to let the other end
1979
+ * know that we're done writing. */
1980
+ close_pipe(handle);
1981
+ }
1982
+
1983
+ if (req->cb) {
1984
+ req->cb(req, 0);
1985
+ }
1986
+
1987
+ DECREASE_PENDING_REQ_COUNT(handle);
1988
+ }
1989
+
1990
+
1991
+ static void eof_timer_init(uv_pipe_t* pipe) {
1992
+ int r;
1993
+
1994
+ assert(pipe->pipe.conn.eof_timer == NULL);
1995
+ assert(pipe->flags & UV_HANDLE_CONNECTION);
1996
+
1997
+ pipe->pipe.conn.eof_timer = (uv_timer_t*) uv__malloc(sizeof *pipe->pipe.conn.eof_timer);
1998
+
1999
+ r = uv_timer_init(pipe->loop, pipe->pipe.conn.eof_timer);
2000
+ assert(r == 0); /* timers can't fail */
2001
+ pipe->pipe.conn.eof_timer->data = pipe;
2002
+ uv_unref((uv_handle_t*) pipe->pipe.conn.eof_timer);
2003
+ }
2004
+
2005
+
2006
+ static void eof_timer_start(uv_pipe_t* pipe) {
2007
+ assert(pipe->flags & UV_HANDLE_CONNECTION);
2008
+
2009
+ if (pipe->pipe.conn.eof_timer != NULL) {
2010
+ uv_timer_start(pipe->pipe.conn.eof_timer, eof_timer_cb, eof_timeout, 0);
2011
+ }
2012
+ }
2013
+
2014
+
2015
+ static void eof_timer_stop(uv_pipe_t* pipe) {
2016
+ assert(pipe->flags & UV_HANDLE_CONNECTION);
2017
+
2018
+ if (pipe->pipe.conn.eof_timer != NULL) {
2019
+ uv_timer_stop(pipe->pipe.conn.eof_timer);
2020
+ }
2021
+ }
2022
+
2023
+
2024
+ static void eof_timer_cb(uv_timer_t* timer) {
2025
+ uv_pipe_t* pipe = (uv_pipe_t*) timer->data;
2026
+ uv_loop_t* loop = timer->loop;
2027
+
2028
+ assert(pipe->type == UV_NAMED_PIPE);
2029
+
2030
+ /* This should always be true, since we start the timer only in
2031
+ * uv_pipe_queue_read after successfully calling ReadFile, or in
2032
+ * uv_process_pipe_shutdown_req if a read is pending, and we always
2033
+ * immediately stop the timer in uv_process_pipe_read_req. */
2034
+ assert(pipe->flags & UV_HANDLE_READ_PENDING);
2035
+
2036
+ /* If there are many packets coming off the iocp then the timer callback may
2037
+ * be called before the read request is coming off the queue. Therefore we
2038
+ * check here if the read request has completed but will be processed later.
2039
+ */
2040
+ if ((pipe->flags & UV_HANDLE_READ_PENDING) &&
2041
+ HasOverlappedIoCompleted(&pipe->read_req.u.io.overlapped)) {
2042
+ return;
2043
+ }
2044
+
2045
+ /* Force both ends off the pipe. */
2046
+ close_pipe(pipe);
2047
+
2048
+ /* Stop reading, so the pending read that is going to fail will not be
2049
+ * reported to the user. */
2050
+ uv_read_stop((uv_stream_t*) pipe);
2051
+
2052
+ /* Report the eof and update flags. This will get reported even if the user
2053
+ * stopped reading in the meantime. TODO: is that okay? */
2054
+ uv_pipe_read_eof(loop, pipe, uv_null_buf_);
2055
+ }
2056
+
2057
+
2058
+ static void eof_timer_destroy(uv_pipe_t* pipe) {
2059
+ assert(pipe->flags & UV_HANDLE_CONNECTION);
2060
+
2061
+ if (pipe->pipe.conn.eof_timer) {
2062
+ uv_close((uv_handle_t*) pipe->pipe.conn.eof_timer, eof_timer_close_cb);
2063
+ pipe->pipe.conn.eof_timer = NULL;
2064
+ }
2065
+ }
2066
+
2067
+
2068
+ static void eof_timer_close_cb(uv_handle_t* handle) {
2069
+ assert(handle->type == UV_TIMER);
2070
+ uv__free(handle);
2071
+ }
2072
+
2073
+
2074
+ int uv_pipe_open(uv_pipe_t* pipe, uv_file file) {
2075
+ HANDLE os_handle = uv__get_osfhandle(file);
2076
+ NTSTATUS nt_status;
2077
+ IO_STATUS_BLOCK io_status;
2078
+ FILE_ACCESS_INFORMATION access;
2079
+ DWORD duplex_flags = 0;
2080
+
2081
+ if (os_handle == INVALID_HANDLE_VALUE)
2082
+ return UV_EBADF;
2083
+
2084
+ uv__once_init();
2085
+ /* In order to avoid closing a stdio file descriptor 0-2, duplicate the
2086
+ * underlying OS handle and forget about the original fd.
2087
+ * We could also opt to use the original OS handle and just never close it,
2088
+ * but then there would be no reliable way to cancel pending read operations
2089
+ * upon close.
2090
+ */
2091
+ if (file <= 2) {
2092
+ if (!DuplicateHandle(INVALID_HANDLE_VALUE,
2093
+ os_handle,
2094
+ INVALID_HANDLE_VALUE,
2095
+ &os_handle,
2096
+ 0,
2097
+ FALSE,
2098
+ DUPLICATE_SAME_ACCESS))
2099
+ return uv_translate_sys_error(GetLastError());
2100
+ file = -1;
2101
+ }
2102
+
2103
+ /* Determine what kind of permissions we have on this handle.
2104
+ * Cygwin opens the pipe in message mode, but we can support it,
2105
+ * just query the access flags and set the stream flags accordingly.
2106
+ */
2107
+ nt_status = pNtQueryInformationFile(os_handle,
2108
+ &io_status,
2109
+ &access,
2110
+ sizeof(access),
2111
+ FileAccessInformation);
2112
+ if (nt_status != STATUS_SUCCESS)
2113
+ return UV_EINVAL;
2114
+
2115
+ if (pipe->ipc) {
2116
+ if (!(access.AccessFlags & FILE_WRITE_DATA) ||
2117
+ !(access.AccessFlags & FILE_READ_DATA)) {
2118
+ return UV_EINVAL;
2119
+ }
2120
+ }
2121
+
2122
+ if (access.AccessFlags & FILE_WRITE_DATA)
2123
+ duplex_flags |= UV_HANDLE_WRITABLE;
2124
+ if (access.AccessFlags & FILE_READ_DATA)
2125
+ duplex_flags |= UV_HANDLE_READABLE;
2126
+
2127
+ if (os_handle == INVALID_HANDLE_VALUE ||
2128
+ uv_set_pipe_handle(pipe->loop,
2129
+ pipe,
2130
+ os_handle,
2131
+ file,
2132
+ duplex_flags) == -1) {
2133
+ return UV_EINVAL;
2134
+ }
2135
+
2136
+ uv_pipe_connection_init(pipe);
2137
+
2138
+ if (pipe->ipc) {
2139
+ assert(!(pipe->flags & UV_HANDLE_NON_OVERLAPPED_PIPE));
2140
+ pipe->pipe.conn.ipc_remote_pid = uv_os_getppid();
2141
+ assert(pipe->pipe.conn.ipc_remote_pid != (DWORD) -1);
2142
+ }
2143
+ return 0;
2144
+ }
2145
+
2146
+
2147
+ static int uv__pipe_getname(const uv_pipe_t* handle, char* buffer, size_t* size) {
2148
+ NTSTATUS nt_status;
2149
+ IO_STATUS_BLOCK io_status;
2150
+ FILE_NAME_INFORMATION tmp_name_info;
2151
+ FILE_NAME_INFORMATION* name_info;
2152
+ WCHAR* name_buf;
2153
+ unsigned int addrlen;
2154
+ unsigned int name_size;
2155
+ unsigned int name_len;
2156
+ int err;
2157
+
2158
+ uv__once_init();
2159
+ name_info = NULL;
2160
+
2161
+ if (handle->handle == INVALID_HANDLE_VALUE) {
2162
+ *size = 0;
2163
+ return UV_EINVAL;
2164
+ }
2165
+
2166
+ /* NtQueryInformationFile will block if another thread is performing a
2167
+ * blocking operation on the queried handle. If the pipe handle is
2168
+ * synchronous, there may be a worker thread currently calling ReadFile() on
2169
+ * the pipe handle, which could cause a deadlock. To avoid this, interrupt
2170
+ * the read. */
2171
+ if (handle->flags & UV_HANDLE_CONNECTION &&
2172
+ handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
2173
+ uv__pipe_interrupt_read((uv_pipe_t*) handle); /* cast away const warning */
2174
+ }
2175
+
2176
+ nt_status = pNtQueryInformationFile(handle->handle,
2177
+ &io_status,
2178
+ &tmp_name_info,
2179
+ sizeof tmp_name_info,
2180
+ FileNameInformation);
2181
+ if (nt_status == STATUS_BUFFER_OVERFLOW) {
2182
+ name_size = sizeof(*name_info) + tmp_name_info.FileNameLength;
2183
+ name_info = uv__malloc(name_size);
2184
+ if (!name_info) {
2185
+ *size = 0;
2186
+ err = UV_ENOMEM;
2187
+ goto cleanup;
2188
+ }
2189
+
2190
+ nt_status = pNtQueryInformationFile(handle->handle,
2191
+ &io_status,
2192
+ name_info,
2193
+ name_size,
2194
+ FileNameInformation);
2195
+ }
2196
+
2197
+ if (nt_status != STATUS_SUCCESS) {
2198
+ *size = 0;
2199
+ err = uv_translate_sys_error(pRtlNtStatusToDosError(nt_status));
2200
+ goto error;
2201
+ }
2202
+
2203
+ if (!name_info) {
2204
+ /* the struct on stack was used */
2205
+ name_buf = tmp_name_info.FileName;
2206
+ name_len = tmp_name_info.FileNameLength;
2207
+ } else {
2208
+ name_buf = name_info->FileName;
2209
+ name_len = name_info->FileNameLength;
2210
+ }
2211
+
2212
+ if (name_len == 0) {
2213
+ *size = 0;
2214
+ err = 0;
2215
+ goto error;
2216
+ }
2217
+
2218
+ name_len /= sizeof(WCHAR);
2219
+
2220
+ /* check how much space we need */
2221
+ addrlen = WideCharToMultiByte(CP_UTF8,
2222
+ 0,
2223
+ name_buf,
2224
+ name_len,
2225
+ NULL,
2226
+ 0,
2227
+ NULL,
2228
+ NULL);
2229
+ if (!addrlen) {
2230
+ *size = 0;
2231
+ err = uv_translate_sys_error(GetLastError());
2232
+ goto error;
2233
+ } else if (pipe_prefix_len + addrlen >= *size) {
2234
+ /* "\\\\.\\pipe" + name */
2235
+ *size = pipe_prefix_len + addrlen + 1;
2236
+ err = UV_ENOBUFS;
2237
+ goto error;
2238
+ }
2239
+
2240
+ memcpy(buffer, pipe_prefix, pipe_prefix_len);
2241
+ addrlen = WideCharToMultiByte(CP_UTF8,
2242
+ 0,
2243
+ name_buf,
2244
+ name_len,
2245
+ buffer+pipe_prefix_len,
2246
+ *size-pipe_prefix_len,
2247
+ NULL,
2248
+ NULL);
2249
+ if (!addrlen) {
2250
+ *size = 0;
2251
+ err = uv_translate_sys_error(GetLastError());
2252
+ goto error;
2253
+ }
2254
+
2255
+ addrlen += pipe_prefix_len;
2256
+ *size = addrlen;
2257
+ buffer[addrlen] = '\0';
2258
+
2259
+ err = 0;
2260
+
2261
+ error:
2262
+ uv__free(name_info);
2263
+
2264
+ cleanup:
2265
+ return err;
2266
+ }
2267
+
2268
+
2269
+ int uv_pipe_pending_count(uv_pipe_t* handle) {
2270
+ if (!handle->ipc)
2271
+ return 0;
2272
+ return handle->pipe.conn.ipc_xfer_queue_length;
2273
+ }
2274
+
2275
+
2276
+ int uv_pipe_getsockname(const uv_pipe_t* handle, char* buffer, size_t* size) {
2277
+ if (handle->flags & UV_HANDLE_BOUND)
2278
+ return uv__pipe_getname(handle, buffer, size);
2279
+
2280
+ if (handle->flags & UV_HANDLE_CONNECTION ||
2281
+ handle->handle != INVALID_HANDLE_VALUE) {
2282
+ *size = 0;
2283
+ return 0;
2284
+ }
2285
+
2286
+ return UV_EBADF;
2287
+ }
2288
+
2289
+
2290
+ int uv_pipe_getpeername(const uv_pipe_t* handle, char* buffer, size_t* size) {
2291
+ /* emulate unix behaviour */
2292
+ if (handle->flags & UV_HANDLE_BOUND)
2293
+ return UV_ENOTCONN;
2294
+
2295
+ if (handle->handle != INVALID_HANDLE_VALUE)
2296
+ return uv__pipe_getname(handle, buffer, size);
2297
+
2298
+ return UV_EBADF;
2299
+ }
2300
+
2301
+
2302
+ uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle) {
2303
+ if (!handle->ipc)
2304
+ return UV_UNKNOWN_HANDLE;
2305
+ if (handle->pipe.conn.ipc_xfer_queue_length == 0)
2306
+ return UV_UNKNOWN_HANDLE;
2307
+ else
2308
+ return UV_TCP;
2309
+ }
2310
+
2311
+ int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
2312
+ SID_IDENTIFIER_AUTHORITY sid_world = { SECURITY_WORLD_SID_AUTHORITY };
2313
+ PACL old_dacl, new_dacl;
2314
+ PSECURITY_DESCRIPTOR sd;
2315
+ EXPLICIT_ACCESS ea;
2316
+ PSID everyone;
2317
+ int error;
2318
+
2319
+ if (handle == NULL || handle->handle == INVALID_HANDLE_VALUE)
2320
+ return UV_EBADF;
2321
+
2322
+ if (mode != UV_READABLE &&
2323
+ mode != UV_WRITABLE &&
2324
+ mode != (UV_WRITABLE | UV_READABLE))
2325
+ return UV_EINVAL;
2326
+
2327
+ if (!AllocateAndInitializeSid(&sid_world,
2328
+ 1,
2329
+ SECURITY_WORLD_RID,
2330
+ 0, 0, 0, 0, 0, 0, 0,
2331
+ &everyone)) {
2332
+ error = GetLastError();
2333
+ goto done;
2334
+ }
2335
+
2336
+ if (GetSecurityInfo(handle->handle,
2337
+ SE_KERNEL_OBJECT,
2338
+ DACL_SECURITY_INFORMATION,
2339
+ NULL,
2340
+ NULL,
2341
+ &old_dacl,
2342
+ NULL,
2343
+ &sd)) {
2344
+ error = GetLastError();
2345
+ goto clean_sid;
2346
+ }
2347
+
2348
+ memset(&ea, 0, sizeof(EXPLICIT_ACCESS));
2349
+ if (mode & UV_READABLE)
2350
+ ea.grfAccessPermissions |= GENERIC_READ | FILE_WRITE_ATTRIBUTES;
2351
+ if (mode & UV_WRITABLE)
2352
+ ea.grfAccessPermissions |= GENERIC_WRITE | FILE_READ_ATTRIBUTES;
2353
+ ea.grfAccessPermissions |= SYNCHRONIZE;
2354
+ ea.grfAccessMode = SET_ACCESS;
2355
+ ea.grfInheritance = NO_INHERITANCE;
2356
+ ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
2357
+ ea.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
2358
+ ea.Trustee.ptstrName = (LPTSTR)everyone;
2359
+
2360
+ if (SetEntriesInAcl(1, &ea, old_dacl, &new_dacl)) {
2361
+ error = GetLastError();
2362
+ goto clean_sd;
2363
+ }
2364
+
2365
+ if (SetSecurityInfo(handle->handle,
2366
+ SE_KERNEL_OBJECT,
2367
+ DACL_SECURITY_INFORMATION,
2368
+ NULL,
2369
+ NULL,
2370
+ new_dacl,
2371
+ NULL)) {
2372
+ error = GetLastError();
2373
+ goto clean_dacl;
2374
+ }
2375
+
2376
+ error = 0;
2377
+
2378
+ clean_dacl:
2379
+ LocalFree((HLOCAL) new_dacl);
2380
+ clean_sd:
2381
+ LocalFree((HLOCAL) sd);
2382
+ clean_sid:
2383
+ FreeSid(everyone);
2384
+ done:
2385
+ return uv_translate_sys_error(error);
2386
+ }