mt-libuv 4.1.01 → 4.1.02
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gyp/.gitignore +1 -0
- data/ext/gyp/AUTHORS +17 -0
- data/ext/gyp/DEPS +23 -0
- data/ext/gyp/LICENSE +27 -0
- data/ext/gyp/OWNERS +1 -0
- data/ext/gyp/PRESUBMIT.py +125 -0
- data/ext/gyp/README.md +5 -0
- data/ext/gyp/buildbot/buildbot_run.py +138 -0
- data/ext/gyp/buildbot/commit_queue/OWNERS +6 -0
- data/ext/gyp/buildbot/commit_queue/README +3 -0
- data/ext/gyp/buildbot/commit_queue/cq_config.json +15 -0
- data/ext/gyp/buildbot/travis-checkout.sh +27 -0
- data/ext/gyp/buildbot/travis-test.sh +12 -0
- data/ext/gyp/codereview.settings +6 -0
- data/ext/gyp/data/win/large-pdb-shim.cc +12 -0
- data/ext/gyp/gyp +8 -0
- data/ext/gyp/gyp.bat +5 -0
- data/ext/gyp/gyp_main.py +16 -0
- data/ext/gyp/gyptest.py +243 -0
- data/ext/gyp/pylib/gyp/MSVSNew.py +353 -0
- data/ext/gyp/pylib/gyp/MSVSProject.py +208 -0
- data/ext/gyp/pylib/gyp/MSVSSettings.py +1106 -0
- data/ext/gyp/pylib/gyp/MSVSSettings_test.py +1486 -0
- data/ext/gyp/pylib/gyp/MSVSToolFile.py +58 -0
- data/ext/gyp/pylib/gyp/MSVSUserFile.py +147 -0
- data/ext/gyp/pylib/gyp/MSVSUtil.py +271 -0
- data/ext/gyp/pylib/gyp/MSVSVersion.py +504 -0
- data/ext/gyp/pylib/gyp/__init__.py +555 -0
- data/ext/gyp/pylib/gyp/common.py +619 -0
- data/ext/gyp/pylib/gyp/common_test.py +73 -0
- data/ext/gyp/pylib/gyp/easy_xml.py +170 -0
- data/ext/gyp/pylib/gyp/easy_xml_test.py +106 -0
- data/ext/gyp/pylib/gyp/flock_tool.py +54 -0
- data/ext/gyp/pylib/gyp/generator/__init__.py +0 -0
- data/ext/gyp/pylib/gyp/generator/analyzer.py +744 -0
- data/ext/gyp/pylib/gyp/generator/cmake.py +1256 -0
- data/ext/gyp/pylib/gyp/generator/dump_dependency_json.py +101 -0
- data/ext/gyp/pylib/gyp/generator/eclipse.py +425 -0
- data/ext/gyp/pylib/gyp/generator/gypd.py +94 -0
- data/ext/gyp/pylib/gyp/generator/gypsh.py +56 -0
- data/ext/gyp/pylib/gyp/generator/make.py +2260 -0
- data/ext/gyp/pylib/gyp/generator/msvs.py +3537 -0
- data/ext/gyp/pylib/gyp/generator/msvs_test.py +40 -0
- data/ext/gyp/pylib/gyp/generator/ninja.py +2500 -0
- data/ext/gyp/pylib/gyp/generator/ninja_test.py +46 -0
- data/ext/gyp/pylib/gyp/generator/xcode.py +1302 -0
- data/ext/gyp/pylib/gyp/generator/xcode_test.py +23 -0
- data/ext/gyp/pylib/gyp/input.py +2908 -0
- data/ext/gyp/pylib/gyp/input_test.py +90 -0
- data/ext/gyp/pylib/gyp/mac_tool.py +721 -0
- data/ext/gyp/pylib/gyp/msvs_emulation.py +1112 -0
- data/ext/gyp/pylib/gyp/ninja_syntax.py +168 -0
- data/ext/gyp/pylib/gyp/simple_copy.py +57 -0
- data/ext/gyp/pylib/gyp/win_tool.py +326 -0
- data/ext/gyp/pylib/gyp/xcode_emulation.py +1800 -0
- data/ext/gyp/pylib/gyp/xcode_ninja.py +289 -0
- data/ext/gyp/pylib/gyp/xcodeproj_file.py +2995 -0
- data/ext/gyp/pylib/gyp/xml_fix.py +68 -0
- data/ext/gyp/samples/samples +83 -0
- data/ext/gyp/samples/samples.bat +5 -0
- data/ext/gyp/setup.py +19 -0
- data/ext/gyp/test/actions/generated-header/action.py +11 -0
- data/ext/gyp/test/actions/generated-header/main.cc +7 -0
- data/ext/gyp/test/actions/generated-header/test.gyp +34 -0
- data/ext/gyp/test/actions/gyptest-all.py +101 -0
- data/ext/gyp/test/actions/gyptest-default.py +68 -0
- data/ext/gyp/test/actions/gyptest-errors.py +24 -0
- data/ext/gyp/test/actions/gyptest-generated-header.py +38 -0
- data/ext/gyp/test/actions/src/action_missing_name.gyp +24 -0
- data/ext/gyp/test/actions/src/actions.gyp +114 -0
- data/ext/gyp/test/actions/src/confirm-dep-files.py +21 -0
- data/ext/gyp/test/actions/src/subdir1/counter.py +44 -0
- data/ext/gyp/test/actions/src/subdir1/executable.gyp +74 -0
- data/ext/gyp/test/actions/src/subdir1/make-prog1.py +20 -0
- data/ext/gyp/test/actions/src/subdir1/make-prog2.py +20 -0
- data/ext/gyp/test/actions/src/subdir1/program.c +12 -0
- data/ext/gyp/test/actions/src/subdir2/make-file.py +11 -0
- data/ext/gyp/test/actions/src/subdir2/none.gyp +33 -0
- data/ext/gyp/test/actions/src/subdir3/generate_main.py +21 -0
- data/ext/gyp/test/actions/src/subdir3/null_input.gyp +29 -0
- data/ext/gyp/test/actions-bare/gyptest-bare.py +24 -0
- data/ext/gyp/test/actions-bare/src/bare.gyp +25 -0
- data/ext/gyp/test/actions-bare/src/bare.py +11 -0
- data/ext/gyp/test/actions-depfile/depfile.gyp +42 -0
- data/ext/gyp/test/actions-depfile/gyptest-all.py +30 -0
- data/ext/gyp/test/actions-depfile/input.txt +1 -0
- data/ext/gyp/test/actions-depfile/touch.py +18 -0
- data/ext/gyp/test/actions-multiple/gyptest-all.py +72 -0
- data/ext/gyp/test/actions-multiple/src/actions.gyp +226 -0
- data/ext/gyp/test/actions-multiple/src/copyfile.py +9 -0
- data/ext/gyp/test/actions-multiple/src/filter.py +12 -0
- data/ext/gyp/test/actions-multiple/src/foo.c +11 -0
- data/ext/gyp/test/actions-multiple/src/input.txt +1 -0
- data/ext/gyp/test/actions-multiple/src/main.c +22 -0
- data/ext/gyp/test/actions-multiple-outputs/gyptest-multiple-outputs.py +45 -0
- data/ext/gyp/test/actions-multiple-outputs/src/multiple-outputs.gyp +23 -0
- data/ext/gyp/test/actions-multiple-outputs/src/touch.py +16 -0
- data/ext/gyp/test/actions-multiple-outputs-with-dependencies/gyptest-action.py +45 -0
- data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/action.gyp +28 -0
- data/ext/gyp/test/actions-multiple-outputs-with-dependencies/src/rcopy.py +20 -0
- data/ext/gyp/test/actions-none/gyptest-none.py +24 -0
- data/ext/gyp/test/actions-none/src/fake_cross.py +12 -0
- data/ext/gyp/test/actions-none/src/foo.cc +1 -0
- data/ext/gyp/test/actions-none/src/none_with_source_files.gyp +35 -0
- data/ext/gyp/test/actions-subdir/gyptest-action.py +26 -0
- data/ext/gyp/test/actions-subdir/src/make-file.py +11 -0
- data/ext/gyp/test/actions-subdir/src/none.gyp +31 -0
- data/ext/gyp/test/actions-subdir/src/subdir/make-subdir-file.py +11 -0
- data/ext/gyp/test/actions-subdir/src/subdir/subdir.gyp +28 -0
- data/ext/gyp/test/additional-targets/gyptest-additional.py +63 -0
- data/ext/gyp/test/additional-targets/src/all.gyp +13 -0
- data/ext/gyp/test/additional-targets/src/dir1/actions.gyp +56 -0
- data/ext/gyp/test/additional-targets/src/dir1/emit.py +11 -0
- data/ext/gyp/test/additional-targets/src/dir1/lib1.c +6 -0
- data/ext/gyp/test/analyzer/common.gypi +6 -0
- data/ext/gyp/test/analyzer/gyptest-analyzer.py +427 -0
- data/ext/gyp/test/analyzer/static_library_test.gyp +34 -0
- data/ext/gyp/test/analyzer/subdir/subdir.gyp +36 -0
- data/ext/gyp/test/analyzer/subdir/subdir2/subdir2.gyp +15 -0
- data/ext/gyp/test/analyzer/subdir2/subdir.gyp +18 -0
- data/ext/gyp/test/analyzer/subdir2/subdir.includes.gypi +9 -0
- data/ext/gyp/test/analyzer/test.gyp +114 -0
- data/ext/gyp/test/analyzer/test2.gyp +25 -0
- data/ext/gyp/test/analyzer/test2.includes.gypi +13 -0
- data/ext/gyp/test/analyzer/test2.includes.includes.gypi +9 -0
- data/ext/gyp/test/analyzer/test2.toplevel_includes.gypi +15 -0
- data/ext/gyp/test/analyzer/test3.gyp +77 -0
- data/ext/gyp/test/analyzer/test4.gyp +80 -0
- data/ext/gyp/test/analyzer/test5.gyp +25 -0
- data/ext/gyp/test/arflags/gyptest-arflags.py +26 -0
- data/ext/gyp/test/arflags/lib.cc +0 -0
- data/ext/gyp/test/arflags/test.gyp +10 -0
- data/ext/gyp/test/assembly/gyptest-assembly.py +31 -0
- data/ext/gyp/test/assembly/gyptest-override.py +24 -0
- data/ext/gyp/test/assembly/src/as.bat +4 -0
- data/ext/gyp/test/assembly/src/assembly.gyp +62 -0
- data/ext/gyp/test/assembly/src/lib1.S +15 -0
- data/ext/gyp/test/assembly/src/lib1.c +3 -0
- data/ext/gyp/test/assembly/src/override.gyp +34 -0
- data/ext/gyp/test/assembly/src/override_asm.asm +8 -0
- data/ext/gyp/test/assembly/src/program.c +12 -0
- data/ext/gyp/test/build-option/gyptest-build.py +27 -0
- data/ext/gyp/test/build-option/hello.c +13 -0
- data/ext/gyp/test/build-option/hello.gyp +15 -0
- data/ext/gyp/test/builddir/gyptest-all.py +85 -0
- data/ext/gyp/test/builddir/gyptest-default.py +85 -0
- data/ext/gyp/test/builddir/src/builddir.gypi +18 -0
- data/ext/gyp/test/builddir/src/func1.c +6 -0
- data/ext/gyp/test/builddir/src/func2.c +6 -0
- data/ext/gyp/test/builddir/src/func3.c +6 -0
- data/ext/gyp/test/builddir/src/func4.c +6 -0
- data/ext/gyp/test/builddir/src/func5.c +6 -0
- data/ext/gyp/test/builddir/src/prog1.c +10 -0
- data/ext/gyp/test/builddir/src/prog1.gyp +30 -0
- data/ext/gyp/test/builddir/src/subdir2/prog2.c +10 -0
- data/ext/gyp/test/builddir/src/subdir2/prog2.gyp +19 -0
- data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.c +10 -0
- data/ext/gyp/test/builddir/src/subdir2/subdir3/prog3.gyp +19 -0
- data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c +10 -0
- data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.gyp +19 -0
- data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c +10 -0
- data/ext/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.gyp +19 -0
- data/ext/gyp/test/cflags/cflags.c +15 -0
- data/ext/gyp/test/cflags/cflags.gyp +23 -0
- data/ext/gyp/test/cflags/gyptest-cflags.py +75 -0
- data/ext/gyp/test/compilable/gyptest-headers.py +29 -0
- data/ext/gyp/test/compilable/src/headers.gyp +26 -0
- data/ext/gyp/test/compilable/src/lib1.cpp +7 -0
- data/ext/gyp/test/compilable/src/lib1.hpp +6 -0
- data/ext/gyp/test/compilable/src/program.cpp +9 -0
- data/ext/gyp/test/compiler-override/compiler-exe.gyp +16 -0
- data/ext/gyp/test/compiler-override/compiler-global-settings.gyp.in +34 -0
- data/ext/gyp/test/compiler-override/compiler-host.gyp +17 -0
- data/ext/gyp/test/compiler-override/compiler-shared-lib.gyp +16 -0
- data/ext/gyp/test/compiler-override/cxxtest.cc +7 -0
- data/ext/gyp/test/compiler-override/gyptest-compiler-env-toolchain.py +78 -0
- data/ext/gyp/test/compiler-override/gyptest-compiler-env.py +110 -0
- data/ext/gyp/test/compiler-override/gyptest-compiler-global-settings.py +82 -0
- data/ext/gyp/test/compiler-override/my_cc.py +7 -0
- data/ext/gyp/test/compiler-override/my_cxx.py +7 -0
- data/ext/gyp/test/compiler-override/my_ld.py +7 -0
- data/ext/gyp/test/compiler-override/my_nm.py +9 -0
- data/ext/gyp/test/compiler-override/my_readelf.py +9 -0
- data/ext/gyp/test/compiler-override/test.c +7 -0
- data/ext/gyp/test/conditions/elseif/elseif.gyp +43 -0
- data/ext/gyp/test/conditions/elseif/elseif_bad1.gyp +20 -0
- data/ext/gyp/test/conditions/elseif/elseif_bad2.gyp +22 -0
- data/ext/gyp/test/conditions/elseif/elseif_bad3.gyp +23 -0
- data/ext/gyp/test/conditions/elseif/elseif_conditions.gypi +15 -0
- data/ext/gyp/test/conditions/elseif/gyptest_elseif.py +33 -0
- data/ext/gyp/test/conditions/elseif/program.cc +10 -0
- data/ext/gyp/test/configurations/basics/configurations.c +15 -0
- data/ext/gyp/test/configurations/basics/configurations.gyp +32 -0
- data/ext/gyp/test/configurations/basics/gyptest-configurations.py +29 -0
- data/ext/gyp/test/configurations/inheritance/configurations.c +21 -0
- data/ext/gyp/test/configurations/inheritance/configurations.gyp +40 -0
- data/ext/gyp/test/configurations/inheritance/duplicates.gyp +27 -0
- data/ext/gyp/test/configurations/inheritance/duplicates.gypd.golden +12 -0
- data/ext/gyp/test/configurations/inheritance/gyptest-duplicates.py +36 -0
- data/ext/gyp/test/configurations/inheritance/gyptest-inheritance.py +33 -0
- data/ext/gyp/test/configurations/invalid/actions.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/all_dependent_settings.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/configurations.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/dependencies.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/direct_dependent_settings.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/gyptest-configurations.py +36 -0
- data/ext/gyp/test/configurations/invalid/libraries.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/link_settings.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/sources.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/standalone_static_library.gyp +17 -0
- data/ext/gyp/test/configurations/invalid/target_name.gyp +18 -0
- data/ext/gyp/test/configurations/invalid/type.gyp +18 -0
- data/ext/gyp/test/configurations/target_platform/configurations.gyp +58 -0
- data/ext/gyp/test/configurations/target_platform/front.c +8 -0
- data/ext/gyp/test/configurations/target_platform/gyptest-target_platform.py +40 -0
- data/ext/gyp/test/configurations/target_platform/left.c +3 -0
- data/ext/gyp/test/configurations/target_platform/right.c +3 -0
- data/ext/gyp/test/configurations/x64/configurations.c +12 -0
- data/ext/gyp/test/configurations/x64/configurations.gyp +38 -0
- data/ext/gyp/test/configurations/x64/gyptest-x86.py +31 -0
- data/ext/gyp/test/copies/gyptest-all.py +42 -0
- data/ext/gyp/test/copies/gyptest-attribs.py +41 -0
- data/ext/gyp/test/copies/gyptest-default.py +42 -0
- data/ext/gyp/test/copies/gyptest-samedir.py +28 -0
- data/ext/gyp/test/copies/gyptest-slash.py +39 -0
- data/ext/gyp/test/copies/gyptest-sourceless-shared-lib.py +20 -0
- data/ext/gyp/test/copies/gyptest-updir.py +32 -0
- data/ext/gyp/test/copies/src/copies-attribs.gyp +20 -0
- data/ext/gyp/test/copies/src/copies-samedir.gyp +37 -0
- data/ext/gyp/test/copies/src/copies-slash.gyp +36 -0
- data/ext/gyp/test/copies/src/copies-sourceless-shared-lib.gyp +27 -0
- data/ext/gyp/test/copies/src/copies-updir.gyp +21 -0
- data/ext/gyp/test/copies/src/copies.gyp +70 -0
- data/ext/gyp/test/copies/src/directory/file3 +1 -0
- data/ext/gyp/test/copies/src/directory/file4 +1 -0
- data/ext/gyp/test/copies/src/directory/subdir/file5 +1 -0
- data/ext/gyp/test/copies/src/executable-file.sh +3 -0
- data/ext/gyp/test/copies/src/file1 +1 -0
- data/ext/gyp/test/copies/src/file2 +1 -0
- data/ext/gyp/test/copies/src/foo.c +13 -0
- data/ext/gyp/test/copies/src/parentdir/subdir/file6 +1 -0
- data/ext/gyp/test/custom-generator/gyptest-custom-generator.py +18 -0
- data/ext/gyp/test/custom-generator/mygenerator.py +14 -0
- data/ext/gyp/test/custom-generator/test.gyp +15 -0
- data/ext/gyp/test/cxxflags/cxxflags.cc +15 -0
- data/ext/gyp/test/cxxflags/cxxflags.gyp +15 -0
- data/ext/gyp/test/cxxflags/gyptest-cxxflags.py +45 -0
- data/ext/gyp/test/defines/defines-env.gyp +22 -0
- data/ext/gyp/test/defines/defines.c +23 -0
- data/ext/gyp/test/defines/defines.gyp +38 -0
- data/ext/gyp/test/defines/gyptest-define-override.py +43 -0
- data/ext/gyp/test/defines/gyptest-defines-env-regyp.py +51 -0
- data/ext/gyp/test/defines/gyptest-defines-env.py +85 -0
- data/ext/gyp/test/defines/gyptest-defines.py +39 -0
- data/ext/gyp/test/defines-escaping/defines-escaping.c +11 -0
- data/ext/gyp/test/defines-escaping/defines-escaping.gyp +19 -0
- data/ext/gyp/test/defines-escaping/gyptest-defines-escaping.py +184 -0
- data/ext/gyp/test/dependencies/a.c +9 -0
- data/ext/gyp/test/dependencies/adso/all_dependent_settings_order.gyp +45 -0
- data/ext/gyp/test/dependencies/adso/write_args.py +11 -0
- data/ext/gyp/test/dependencies/b/b.c +3 -0
- data/ext/gyp/test/dependencies/b/b.gyp +22 -0
- data/ext/gyp/test/dependencies/b/b3.c +9 -0
- data/ext/gyp/test/dependencies/c/c.c +4 -0
- data/ext/gyp/test/dependencies/c/c.gyp +22 -0
- data/ext/gyp/test/dependencies/c/d.c +3 -0
- data/ext/gyp/test/dependencies/double_dependency.gyp +23 -0
- data/ext/gyp/test/dependencies/double_dependent.gyp +12 -0
- data/ext/gyp/test/dependencies/extra_targets.gyp +18 -0
- data/ext/gyp/test/dependencies/gyptest-all-dependent-settings-order.py +19 -0
- data/ext/gyp/test/dependencies/gyptest-double-dependency.py +19 -0
- data/ext/gyp/test/dependencies/gyptest-extra-targets.py +22 -0
- data/ext/gyp/test/dependencies/gyptest-indirect-module-dependency.py +22 -0
- data/ext/gyp/test/dependencies/gyptest-lib-only.py +39 -0
- data/ext/gyp/test/dependencies/gyptest-none-traversal.py +25 -0
- data/ext/gyp/test/dependencies/gyptest-sharedlib-linksettings.py +21 -0
- data/ext/gyp/test/dependencies/lib_only.gyp +16 -0
- data/ext/gyp/test/dependencies/main.c +14 -0
- data/ext/gyp/test/dependencies/module-dep/a.cc +7 -0
- data/ext/gyp/test/dependencies/module-dep/dll.cc +9 -0
- data/ext/gyp/test/dependencies/module-dep/exe.cc +7 -0
- data/ext/gyp/test/dependencies/module-dep/indirect-module-dependency.gyp +37 -0
- data/ext/gyp/test/dependencies/none_traversal.gyp +46 -0
- data/ext/gyp/test/dependencies/sharedlib-linksettings/program.c +25 -0
- data/ext/gyp/test/dependencies/sharedlib-linksettings/sharedlib.c +16 -0
- data/ext/gyp/test/dependencies/sharedlib-linksettings/staticlib.c +24 -0
- data/ext/gyp/test/dependencies/sharedlib-linksettings/test.gyp +37 -0
- data/ext/gyp/test/dependency-copy/gyptest-copy.py +26 -0
- data/ext/gyp/test/dependency-copy/src/copies.gyp +25 -0
- data/ext/gyp/test/dependency-copy/src/file1.c +7 -0
- data/ext/gyp/test/dependency-copy/src/file2.c +7 -0
- data/ext/gyp/test/dependent-settings/nested-dependent-settings/all-dependent-settings.gyp +19 -0
- data/ext/gyp/test/dependent-settings/nested-dependent-settings/direct-dependent-settings.gyp +19 -0
- data/ext/gyp/test/dependent-settings/nested-dependent-settings/gyptest-nested-dependent-settings.py +18 -0
- data/ext/gyp/test/determinism/determinism.gyp +59 -0
- data/ext/gyp/test/determinism/empty-targets.gyp +32 -0
- data/ext/gyp/test/determinism/gyptest-determinism.py +30 -0
- data/ext/gyp/test/determinism/gyptest-empty-target-names.py +30 -0
- data/ext/gyp/test/determinism/gyptest-needed-variables.py +30 -0
- data/ext/gyp/test/determinism/gyptest-solibs.py +37 -0
- data/ext/gyp/test/determinism/main.cc +5 -0
- data/ext/gyp/test/determinism/needed-variables.gyp +33 -0
- data/ext/gyp/test/determinism/rule.py +8 -0
- data/ext/gyp/test/determinism/solib.cc +8 -0
- data/ext/gyp/test/determinism/solibs.gyp +32 -0
- data/ext/gyp/test/empty-target/empty-target.gyp +12 -0
- data/ext/gyp/test/empty-target/gyptest-empty-target.py +18 -0
- data/ext/gyp/test/errors/dependency_cycle.gyp +23 -0
- data/ext/gyp/test/errors/duplicate_basenames.gyp +13 -0
- data/ext/gyp/test/errors/duplicate_node.gyp +12 -0
- data/ext/gyp/test/errors/duplicate_rule.gyp +22 -0
- data/ext/gyp/test/errors/duplicate_targets.gyp +14 -0
- data/ext/gyp/test/errors/error_command.gyp +12 -0
- data/ext/gyp/test/errors/file_cycle0.gyp +17 -0
- data/ext/gyp/test/errors/file_cycle1.gyp +13 -0
- data/ext/gyp/test/errors/gyptest-errors.py +80 -0
- data/ext/gyp/test/errors/missing_command.gyp +12 -0
- data/ext/gyp/test/errors/missing_dep.gyp +15 -0
- data/ext/gyp/test/errors/missing_targets.gyp +8 -0
- data/ext/gyp/test/escaping/colon/test.gyp +21 -0
- data/ext/gyp/test/escaping/gyptest-colon.py +51 -0
- data/ext/gyp/test/exclusion/exclusion.gyp +23 -0
- data/ext/gyp/test/exclusion/gyptest-exclusion.py +22 -0
- data/ext/gyp/test/exclusion/hello.c +15 -0
- data/ext/gyp/test/external-cross-compile/gyptest-cross.py +31 -0
- data/ext/gyp/test/external-cross-compile/src/bogus1.cc +1 -0
- data/ext/gyp/test/external-cross-compile/src/bogus2.c +1 -0
- data/ext/gyp/test/external-cross-compile/src/cross.gyp +83 -0
- data/ext/gyp/test/external-cross-compile/src/cross_compile.gypi +23 -0
- data/ext/gyp/test/external-cross-compile/src/fake_cross.py +18 -0
- data/ext/gyp/test/external-cross-compile/src/program.cc +16 -0
- data/ext/gyp/test/external-cross-compile/src/test1.cc +1 -0
- data/ext/gyp/test/external-cross-compile/src/test2.c +1 -0
- data/ext/gyp/test/external-cross-compile/src/test3.cc +1 -0
- data/ext/gyp/test/external-cross-compile/src/test4.c +1 -0
- data/ext/gyp/test/external-cross-compile/src/tochar.py +13 -0
- data/ext/gyp/test/generator-output/actions/actions.gyp +16 -0
- data/ext/gyp/test/generator-output/actions/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/actions/subdir1/actions-out/README.txt +4 -0
- data/ext/gyp/test/generator-output/actions/subdir1/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/actions/subdir1/executable.gyp +44 -0
- data/ext/gyp/test/generator-output/actions/subdir1/make-prog1.py +20 -0
- data/ext/gyp/test/generator-output/actions/subdir1/make-prog2.py +20 -0
- data/ext/gyp/test/generator-output/actions/subdir1/program.c +12 -0
- data/ext/gyp/test/generator-output/actions/subdir2/actions-out/README.txt +4 -0
- data/ext/gyp/test/generator-output/actions/subdir2/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/actions/subdir2/make-file.py +11 -0
- data/ext/gyp/test/generator-output/actions/subdir2/none.gyp +31 -0
- data/ext/gyp/test/generator-output/copies/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/copies/copies-out/README.txt +4 -0
- data/ext/gyp/test/generator-output/copies/copies.gyp +50 -0
- data/ext/gyp/test/generator-output/copies/file1 +1 -0
- data/ext/gyp/test/generator-output/copies/file2 +1 -0
- data/ext/gyp/test/generator-output/copies/subdir/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/copies/subdir/copies-out/README.txt +4 -0
- data/ext/gyp/test/generator-output/copies/subdir/file3 +1 -0
- data/ext/gyp/test/generator-output/copies/subdir/file4 +1 -0
- data/ext/gyp/test/generator-output/copies/subdir/subdir.gyp +32 -0
- data/ext/gyp/test/generator-output/gyptest-actions.py +57 -0
- data/ext/gyp/test/generator-output/gyptest-copies.py +59 -0
- data/ext/gyp/test/generator-output/gyptest-depth.py +58 -0
- data/ext/gyp/test/generator-output/gyptest-mac-bundle.py +33 -0
- data/ext/gyp/test/generator-output/gyptest-relocate.py +59 -0
- data/ext/gyp/test/generator-output/gyptest-rules.py +58 -0
- data/ext/gyp/test/generator-output/gyptest-subdir2-deep.py +36 -0
- data/ext/gyp/test/generator-output/gyptest-symlink.py +44 -0
- data/ext/gyp/test/generator-output/gyptest-top-all.py +53 -0
- data/ext/gyp/test/generator-output/mac-bundle/Info.plist +32 -0
- data/ext/gyp/test/generator-output/mac-bundle/app.order +1 -0
- data/ext/gyp/test/generator-output/mac-bundle/header.h +1 -0
- data/ext/gyp/test/generator-output/mac-bundle/main.c +1 -0
- data/ext/gyp/test/generator-output/mac-bundle/resource.sb +1 -0
- data/ext/gyp/test/generator-output/mac-bundle/test.gyp +25 -0
- data/ext/gyp/test/generator-output/rules/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/rules/copy-file.py +12 -0
- data/ext/gyp/test/generator-output/rules/rules.gyp +16 -0
- data/ext/gyp/test/generator-output/rules/subdir1/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/rules/subdir1/define3.in0 +1 -0
- data/ext/gyp/test/generator-output/rules/subdir1/define4.in0 +1 -0
- data/ext/gyp/test/generator-output/rules/subdir1/executable.gyp +59 -0
- data/ext/gyp/test/generator-output/rules/subdir1/function1.in1 +6 -0
- data/ext/gyp/test/generator-output/rules/subdir1/function2.in1 +6 -0
- data/ext/gyp/test/generator-output/rules/subdir1/program.c +18 -0
- data/ext/gyp/test/generator-output/rules/subdir2/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/rules/subdir2/file1.in0 +1 -0
- data/ext/gyp/test/generator-output/rules/subdir2/file2.in0 +1 -0
- data/ext/gyp/test/generator-output/rules/subdir2/file3.in1 +1 -0
- data/ext/gyp/test/generator-output/rules/subdir2/file4.in1 +1 -0
- data/ext/gyp/test/generator-output/rules/subdir2/none.gyp +49 -0
- data/ext/gyp/test/generator-output/rules/subdir2/rules-out/README.txt +4 -0
- data/ext/gyp/test/generator-output/src/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/src/inc.h +1 -0
- data/ext/gyp/test/generator-output/src/inc1/include1.h +1 -0
- data/ext/gyp/test/generator-output/src/prog1.c +18 -0
- data/ext/gyp/test/generator-output/src/prog1.gyp +28 -0
- data/ext/gyp/test/generator-output/src/subdir2/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/src/subdir2/deeper/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.c +7 -0
- data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.gyp +18 -0
- data/ext/gyp/test/generator-output/src/subdir2/deeper/deeper.h +1 -0
- data/ext/gyp/test/generator-output/src/subdir2/inc2/include2.h +1 -0
- data/ext/gyp/test/generator-output/src/subdir2/prog2.c +18 -0
- data/ext/gyp/test/generator-output/src/subdir2/prog2.gyp +28 -0
- data/ext/gyp/test/generator-output/src/subdir3/build/README.txt +4 -0
- data/ext/gyp/test/generator-output/src/subdir3/inc3/include3.h +1 -0
- data/ext/gyp/test/generator-output/src/subdir3/prog3.c +18 -0
- data/ext/gyp/test/generator-output/src/subdir3/prog3.gyp +25 -0
- data/ext/gyp/test/generator-output/src/symroot.gypi +16 -0
- data/ext/gyp/test/gyp-defines/defines.gyp +26 -0
- data/ext/gyp/test/gyp-defines/echo.py +11 -0
- data/ext/gyp/test/gyp-defines/gyptest-multiple-values.py +36 -0
- data/ext/gyp/test/gyp-defines/gyptest-regyp.py +40 -0
- data/ext/gyp/test/hard_dependency/gyptest-exported-hard-dependency.py +37 -0
- data/ext/gyp/test/hard_dependency/gyptest-no-exported-hard-dependency.py +36 -0
- data/ext/gyp/test/hard_dependency/src/a.c +9 -0
- data/ext/gyp/test/hard_dependency/src/a.h +12 -0
- data/ext/gyp/test/hard_dependency/src/b.c +9 -0
- data/ext/gyp/test/hard_dependency/src/b.h +12 -0
- data/ext/gyp/test/hard_dependency/src/c.c +10 -0
- data/ext/gyp/test/hard_dependency/src/c.h +10 -0
- data/ext/gyp/test/hard_dependency/src/d.c +9 -0
- data/ext/gyp/test/hard_dependency/src/emit.py +11 -0
- data/ext/gyp/test/hard_dependency/src/hard_dependency.gyp +78 -0
- data/ext/gyp/test/hello/gyptest-all.py +24 -0
- data/ext/gyp/test/hello/gyptest-default.py +24 -0
- data/ext/gyp/test/hello/gyptest-disable-regyp.py +32 -0
- data/ext/gyp/test/hello/gyptest-regyp-output.py +36 -0
- data/ext/gyp/test/hello/gyptest-regyp.py +32 -0
- data/ext/gyp/test/hello/gyptest-target.py +24 -0
- data/ext/gyp/test/hello/hello.c +11 -0
- data/ext/gyp/test/hello/hello.gyp +15 -0
- data/ext/gyp/test/hello/hello2.c +11 -0
- data/ext/gyp/test/hello/hello2.gyp +15 -0
- data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py +31 -0
- data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py +33 -0
- data/ext/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py +44 -0
- data/ext/gyp/test/home_dot_gyp/gyptest-home-includes.py +30 -0
- data/ext/gyp/test/home_dot_gyp/home/.gyp/include.gypi +5 -0
- data/ext/gyp/test/home_dot_gyp/home2/.gyp/include.gypi +5 -0
- data/ext/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi +5 -0
- data/ext/gyp/test/home_dot_gyp/src/all.gyp +22 -0
- data/ext/gyp/test/home_dot_gyp/src/printfoo.c +7 -0
- data/ext/gyp/test/include_dirs/gyptest-all.py +43 -0
- data/ext/gyp/test/include_dirs/gyptest-default.py +43 -0
- data/ext/gyp/test/include_dirs/src/inc.h +1 -0
- data/ext/gyp/test/include_dirs/src/inc1/include1.h +1 -0
- data/ext/gyp/test/include_dirs/src/includes.c +19 -0
- data/ext/gyp/test/include_dirs/src/includes.gyp +27 -0
- data/ext/gyp/test/include_dirs/src/shadow1/shadow.h +1 -0
- data/ext/gyp/test/include_dirs/src/shadow2/shadow.h +1 -0
- data/ext/gyp/test/include_dirs/src/subdir/inc.h +1 -0
- data/ext/gyp/test/include_dirs/src/subdir/inc2/include2.h +1 -0
- data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.c +14 -0
- data/ext/gyp/test/include_dirs/src/subdir/subdir_includes.gyp +20 -0
- data/ext/gyp/test/intermediate_dir/gyptest-intermediate-dir.py +44 -0
- data/ext/gyp/test/intermediate_dir/src/script.py +22 -0
- data/ext/gyp/test/intermediate_dir/src/shared_infile.txt +1 -0
- data/ext/gyp/test/intermediate_dir/src/test.gyp +42 -0
- data/ext/gyp/test/intermediate_dir/src/test2.gyp +42 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/LanguageMap.plist +8 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/MainMenu.xib +17 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/English.lproj/Main_iPhone.storyboard +27 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/TestApp-Info.plist +28 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/check_no_signature.py +13 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/main.m +13 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-32-bits.m +7 -0
- data/ext/gyp/test/ios/app-bundle/TestApp/only-compile-in-64-bits.m +7 -0
- data/ext/gyp/test/ios/app-bundle/test-archs.gyp +109 -0
- data/ext/gyp/test/ios/app-bundle/test-assets-catalog.gyp +45 -0
- data/ext/gyp/test/ios/app-bundle/test-crosscompile.gyp +47 -0
- data/ext/gyp/test/ios/app-bundle/test-device.gyp +109 -0
- data/ext/gyp/test/ios/app-bundle/test.gyp +75 -0
- data/ext/gyp/test/ios/app-bundle/tool_main.cc +7 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/Info.plist +24 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +97 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/empty.c +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file0 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file1 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file10 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file11 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file2 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file3 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file4 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file5 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file6 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file7 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file8 +1 -0
- data/ext/gyp/test/ios/copies-with-xcode-envvars/file9 +1 -0
- data/ext/gyp/test/ios/deployment-target/check-version-min.c +33 -0
- data/ext/gyp/test/ios/deployment-target/deployment-target.gyp +34 -0
- data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.h +9 -0
- data/ext/gyp/test/ios/extension/ActionExtension/ActionViewController.m +31 -0
- data/ext/gyp/test/ios/extension/ActionExtension/Info.plist +42 -0
- data/ext/gyp/test/ios/extension/ActionExtension/MainInterface.storyboard +63 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.h +12 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/AppDelegate.m +19 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/Base.lproj/Main.storyboard +25 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/Info.plist +32 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.h +11 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/ViewController.m +24 -0
- data/ext/gyp/test/ios/extension/ExtensionContainer/main.m +13 -0
- data/ext/gyp/test/ios/extension/extension.gyp +91 -0
- data/ext/gyp/test/ios/framework/framework.gyp +43 -0
- data/ext/gyp/test/ios/framework/iOSFramework/Info.plist +26 -0
- data/ext/gyp/test/ios/framework/iOSFramework/Thing.h +10 -0
- data/ext/gyp/test/ios/framework/iOSFramework/Thing.m +22 -0
- data/ext/gyp/test/ios/framework/iOSFramework/iOSFramework.h +9 -0
- data/ext/gyp/test/ios/gyptest-app-ios-assets-catalog.py +57 -0
- data/ext/gyp/test/ios/gyptest-app-ios.py +76 -0
- data/ext/gyp/test/ios/gyptest-archs.py +62 -0
- data/ext/gyp/test/ios/gyptest-copies-with-xcode-envvars.py +65 -0
- data/ext/gyp/test/ios/gyptest-crosscompile.py +34 -0
- data/ext/gyp/test/ios/gyptest-deployment-target.py +23 -0
- data/ext/gyp/test/ios/gyptest-extension.py +51 -0
- data/ext/gyp/test/ios/gyptest-framework.py +37 -0
- data/ext/gyp/test/ios/gyptest-per-config-settings.py +190 -0
- data/ext/gyp/test/ios/gyptest-watch.py +44 -0
- data/ext/gyp/test/ios/gyptest-xcode-ninja.py +25 -0
- data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/AppIcon.appiconset/Contents.json +62 -0
- data/ext/gyp/test/ios/watch/WatchApp/Images.xcassets/LaunchImage.launchimage/Contents.json +24 -0
- data/ext/gyp/test/ios/watch/WatchApp/Info.plist +35 -0
- data/ext/gyp/test/ios/watch/WatchApp/Interface.storyboard +15 -0
- data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.h +12 -0
- data/ext/gyp/test/ios/watch/WatchContainer/AppDelegate.m +19 -0
- data/ext/gyp/test/ios/watch/WatchContainer/Base.lproj/Main.storyboard +25 -0
- data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/ext/gyp/test/ios/watch/WatchContainer/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
- data/ext/gyp/test/ios/watch/WatchContainer/Info.plist +32 -0
- data/ext/gyp/test/ios/watch/WatchContainer/ViewController.h +11 -0
- data/ext/gyp/test/ios/watch/WatchContainer/ViewController.m +24 -0
- data/ext/gyp/test/ios/watch/WatchContainer/main.m +13 -0
- data/ext/gyp/test/ios/watch/WatchKitExtension/Images.xcassets/MyImage.imageset/Contents.json +20 -0
- data/ext/gyp/test/ios/watch/WatchKitExtension/Info.plist +38 -0
- data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.h +10 -0
- data/ext/gyp/test/ios/watch/WatchKitExtension/InterfaceController.m +25 -0
- data/ext/gyp/test/ios/watch/WatchKitExtension/MainInterface.storyboard +63 -0
- data/ext/gyp/test/ios/watch/watch.gyp +105 -0
- data/ext/gyp/test/ios/xctests/App/AppDelegate.h +11 -0
- data/ext/gyp/test/ios/xctests/App/AppDelegate.m +18 -0
- data/ext/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib +41 -0
- data/ext/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard +25 -0
- data/ext/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json +68 -0
- data/ext/gyp/test/ios/xctests/App/Info.plist +47 -0
- data/ext/gyp/test/ios/xctests/App/ViewController.h +9 -0
- data/ext/gyp/test/ios/xctests/App/ViewController.m +21 -0
- data/ext/gyp/test/ios/xctests/App/main.m +13 -0
- data/ext/gyp/test/ios/xctests/AppTests/AppTests.m +31 -0
- data/ext/gyp/test/ios/xctests/AppTests/Info.plist +24 -0
- data/ext/gyp/test/ios/xctests/gyptest-xctests.py +49 -0
- data/ext/gyp/test/ios/xctests/xctests.gyp +74 -0
- data/ext/gyp/test/lib/README.txt +17 -0
- data/ext/gyp/test/lib/TestCmd.py +1597 -0
- data/ext/gyp/test/lib/TestCommon.py +591 -0
- data/ext/gyp/test/lib/TestGyp.py +1259 -0
- data/ext/gyp/test/lib/TestMac.py +76 -0
- data/ext/gyp/test/lib/TestWin.py +101 -0
- data/ext/gyp/test/library/gyptest-shared-obj-install-path.py +39 -0
- data/ext/gyp/test/library/gyptest-shared.py +84 -0
- data/ext/gyp/test/library/gyptest-static.py +84 -0
- data/ext/gyp/test/library/src/lib1.c +10 -0
- data/ext/gyp/test/library/src/lib1_moveable.c +10 -0
- data/ext/gyp/test/library/src/lib2.c +10 -0
- data/ext/gyp/test/library/src/lib2_moveable.c +10 -0
- data/ext/gyp/test/library/src/library.gyp +58 -0
- data/ext/gyp/test/library/src/program.c +15 -0
- data/ext/gyp/test/library/src/shared_dependency.gyp +33 -0
- data/ext/gyp/test/library_dirs/gyptest-library-dirs.py +50 -0
- data/ext/gyp/test/library_dirs/subdir/README.txt +1 -0
- data/ext/gyp/test/library_dirs/subdir/hello.cc +11 -0
- data/ext/gyp/test/library_dirs/subdir/mylib.cc +9 -0
- data/ext/gyp/test/library_dirs/subdir/mylib.h +12 -0
- data/ext/gyp/test/library_dirs/subdir/test-win.gyp +60 -0
- data/ext/gyp/test/library_dirs/subdir/test.gyp +68 -0
- data/ext/gyp/test/link-dependency/gyptest-link-dependency.py +23 -0
- data/ext/gyp/test/link-dependency/main.c +7 -0
- data/ext/gyp/test/link-dependency/mymalloc.c +12 -0
- data/ext/gyp/test/link-dependency/test.gyp +37 -0
- data/ext/gyp/test/link-objects/base.c +6 -0
- data/ext/gyp/test/link-objects/extra.c +5 -0
- data/ext/gyp/test/link-objects/gyptest-all.py +28 -0
- data/ext/gyp/test/link-objects/link-objects.gyp +24 -0
- data/ext/gyp/test/linux/gyptest-implicit-rpath.py +48 -0
- data/ext/gyp/test/linux/gyptest-ldflags-duplicates.py +22 -0
- data/ext/gyp/test/linux/gyptest-ldflags-from-environment.py +45 -0
- data/ext/gyp/test/linux/gyptest-target-rpath.py +43 -0
- data/ext/gyp/test/linux/implicit-rpath/file.c +1 -0
- data/ext/gyp/test/linux/implicit-rpath/main.c +1 -0
- data/ext/gyp/test/linux/implicit-rpath/test.gyp +47 -0
- data/ext/gyp/test/linux/ldflags-duplicates/check-ldflags.py +28 -0
- data/ext/gyp/test/linux/ldflags-duplicates/lib1.c +6 -0
- data/ext/gyp/test/linux/ldflags-duplicates/lib2.c +6 -0
- data/ext/gyp/test/linux/ldflags-duplicates/main.c +7 -0
- data/ext/gyp/test/linux/ldflags-duplicates/test.gyp +45 -0
- data/ext/gyp/test/linux/ldflags-from-environment/main.c +7 -0
- data/ext/gyp/test/linux/ldflags-from-environment/test.gyp +23 -0
- data/ext/gyp/test/linux/target-rpath/file.c +1 -0
- data/ext/gyp/test/linux/target-rpath/main.c +1 -0
- data/ext/gyp/test/linux/target-rpath/test.gyp +47 -0
- data/ext/gyp/test/mac/action-envvars/action/action.gyp +34 -0
- data/ext/gyp/test/mac/action-envvars/action/action.sh +8 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist-error.strings +3 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings +3 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/MainMenu.xib +4119 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16be.strings +0 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/English.lproj/utf-16le.strings +0 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/Contents.json +23 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain.png +0 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@2x.png +0 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/Images.xcassets/image.imageset/super_sylvain@3x.png +0 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/TestApp-Info.plist +34 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.h +13 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/TestAppAppDelegate.m +15 -0
- data/ext/gyp/test/mac/app-bundle/TestApp/main.m +10 -0
- data/ext/gyp/test/mac/app-bundle/empty.c +0 -0
- data/ext/gyp/test/mac/app-bundle/test-assets-catalog.gyp +43 -0
- data/ext/gyp/test/mac/app-bundle/test-error.gyp +31 -0
- data/ext/gyp/test/mac/app-bundle/test.gyp +41 -0
- data/ext/gyp/test/mac/archs/empty_main.cc +1 -0
- data/ext/gyp/test/mac/archs/file.mm +1 -0
- data/ext/gyp/test/mac/archs/file_a.cc +8 -0
- data/ext/gyp/test/mac/archs/file_a.h +10 -0
- data/ext/gyp/test/mac/archs/file_b.cc +8 -0
- data/ext/gyp/test/mac/archs/file_b.h +10 -0
- data/ext/gyp/test/mac/archs/file_c.cc +11 -0
- data/ext/gyp/test/mac/archs/file_d.cc +11 -0
- data/ext/gyp/test/mac/archs/header.h +1 -0
- data/ext/gyp/test/mac/archs/my_file.cc +4 -0
- data/ext/gyp/test/mac/archs/my_main_file.cc +9 -0
- data/ext/gyp/test/mac/archs/test-archs-multiarch.gyp +92 -0
- data/ext/gyp/test/mac/archs/test-archs-x86_64.gyp +27 -0
- data/ext/gyp/test/mac/archs/test-dependencies.gyp +92 -0
- data/ext/gyp/test/mac/archs/test-no-archs.gyp +21 -0
- data/ext/gyp/test/mac/archs/test-valid-archs.gyp +28 -0
- data/ext/gyp/test/mac/bundle-resources/change.sh +3 -0
- data/ext/gyp/test/mac/bundle-resources/executable-file.sh +3 -0
- data/ext/gyp/test/mac/bundle-resources/secret.txt +1 -0
- data/ext/gyp/test/mac/bundle-resources/test.gyp +59 -0
- data/ext/gyp/test/mac/cflags/ccfile.cc +7 -0
- data/ext/gyp/test/mac/cflags/ccfile_withcflags.cc +7 -0
- data/ext/gyp/test/mac/cflags/cfile.c +7 -0
- data/ext/gyp/test/mac/cflags/cppfile.cpp +7 -0
- data/ext/gyp/test/mac/cflags/cppfile_withcflags.cpp +7 -0
- data/ext/gyp/test/mac/cflags/cxxfile.cxx +7 -0
- data/ext/gyp/test/mac/cflags/cxxfile_withcflags.cxx +7 -0
- data/ext/gyp/test/mac/cflags/mfile.m +7 -0
- data/ext/gyp/test/mac/cflags/mmfile.mm +7 -0
- data/ext/gyp/test/mac/cflags/mmfile_withcflags.mm +7 -0
- data/ext/gyp/test/mac/cflags/test.gyp +132 -0
- data/ext/gyp/test/mac/clang-cxx-language-standard/c++11.cc +8 -0
- data/ext/gyp/test/mac/clang-cxx-language-standard/c++98.cc +24 -0
- data/ext/gyp/test/mac/clang-cxx-language-standard/clang-cxx-language-standard.gyp +30 -0
- data/ext/gyp/test/mac/clang-cxx-library/clang-cxx-library.gyp +32 -0
- data/ext/gyp/test/mac/clang-cxx-library/libc++.cc +11 -0
- data/ext/gyp/test/mac/clang-cxx-library/libstdc++.cc +11 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/copies-with-xcode-envvars.gyp +87 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/empty.c +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file0 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file1 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file10 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file11 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file2 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file3 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file4 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file5 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file6 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file7 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file8 +1 -0
- data/ext/gyp/test/mac/copies-with-xcode-envvars/file9 +1 -0
- data/ext/gyp/test/mac/copy-dylib/empty.c +1 -0
- data/ext/gyp/test/mac/copy-dylib/test.gyp +31 -0
- data/ext/gyp/test/mac/debuginfo/file.c +6 -0
- data/ext/gyp/test/mac/debuginfo/test.gyp +82 -0
- data/ext/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings +1 -0
- data/ext/gyp/test/mac/depend-on-bundle/Info.plist +28 -0
- data/ext/gyp/test/mac/depend-on-bundle/bundle.c +1 -0
- data/ext/gyp/test/mac/depend-on-bundle/executable.c +4 -0
- data/ext/gyp/test/mac/depend-on-bundle/test.gyp +28 -0
- data/ext/gyp/test/mac/deployment-target/check-version-min.c +33 -0
- data/ext/gyp/test/mac/deployment-target/deployment-target.gyp +28 -0
- data/ext/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings +2 -0
- data/ext/gyp/test/mac/framework/TestFramework/Info.plist +28 -0
- data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.h +28 -0
- data/ext/gyp/test/mac/framework/TestFramework/ObjCVector.mm +63 -0
- data/ext/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h +9 -0
- data/ext/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch +7 -0
- data/ext/gyp/test/mac/framework/empty.c +0 -0
- data/ext/gyp/test/mac/framework/framework.gyp +108 -0
- data/ext/gyp/test/mac/framework-dirs/calculate.c +15 -0
- data/ext/gyp/test/mac/framework-dirs/framework-dirs.gyp +21 -0
- data/ext/gyp/test/mac/framework-headers/myframework.h +8 -0
- data/ext/gyp/test/mac/framework-headers/myframework.m +8 -0
- data/ext/gyp/test/mac/framework-headers/test.gyp +44 -0
- data/ext/gyp/test/mac/global-settings/src/dir1/dir1.gyp +11 -0
- data/ext/gyp/test/mac/global-settings/src/dir2/dir2.gyp +22 -0
- data/ext/gyp/test/mac/global-settings/src/dir2/file.txt +1 -0
- data/ext/gyp/test/mac/gyptest-action-envvars.py +36 -0
- data/ext/gyp/test/mac/gyptest-app-assets-catalog.py +125 -0
- data/ext/gyp/test/mac/gyptest-app-error.py +49 -0
- data/ext/gyp/test/mac/gyptest-app.py +122 -0
- data/ext/gyp/test/mac/gyptest-archs.py +96 -0
- data/ext/gyp/test/mac/gyptest-bundle-resources.py +64 -0
- data/ext/gyp/test/mac/gyptest-cflags.py +21 -0
- data/ext/gyp/test/mac/gyptest-clang-cxx-language-standard.py +25 -0
- data/ext/gyp/test/mac/gyptest-clang-cxx-library.py +32 -0
- data/ext/gyp/test/mac/gyptest-copies-with-xcode-envvars.py +65 -0
- data/ext/gyp/test/mac/gyptest-copies.py +62 -0
- data/ext/gyp/test/mac/gyptest-copy-dylib.py +25 -0
- data/ext/gyp/test/mac/gyptest-debuginfo.py +36 -0
- data/ext/gyp/test/mac/gyptest-depend-on-bundle.py +45 -0
- data/ext/gyp/test/mac/gyptest-deployment-target.py +27 -0
- data/ext/gyp/test/mac/gyptest-framework-dirs.py +23 -0
- data/ext/gyp/test/mac/gyptest-framework-headers.py +38 -0
- data/ext/gyp/test/mac/gyptest-framework.py +80 -0
- data/ext/gyp/test/mac/gyptest-global-settings.py +33 -0
- data/ext/gyp/test/mac/gyptest-identical-name.py +45 -0
- data/ext/gyp/test/mac/gyptest-infoplist-process.py +56 -0
- data/ext/gyp/test/mac/gyptest-installname.py +85 -0
- data/ext/gyp/test/mac/gyptest-kext.py +27 -0
- data/ext/gyp/test/mac/gyptest-ldflags-passed-to-libtool.py +37 -0
- data/ext/gyp/test/mac/gyptest-ldflags.py +74 -0
- data/ext/gyp/test/mac/gyptest-libraries.py +30 -0
- data/ext/gyp/test/mac/gyptest-libtool-zero.py +26 -0
- data/ext/gyp/test/mac/gyptest-loadable-module-bundle-product-extension.py +31 -0
- data/ext/gyp/test/mac/gyptest-loadable-module.py +54 -0
- data/ext/gyp/test/mac/gyptest-lto.py +66 -0
- data/ext/gyp/test/mac/gyptest-missing-cfbundlesignature.py +34 -0
- data/ext/gyp/test/mac/gyptest-non-strs-flattened-to-env.py +38 -0
- data/ext/gyp/test/mac/gyptest-objc-arc.py +27 -0
- data/ext/gyp/test/mac/gyptest-objc-gc.py +51 -0
- data/ext/gyp/test/mac/gyptest-postbuild-copy-bundle.py +75 -0
- data/ext/gyp/test/mac/gyptest-postbuild-defaults.py +34 -0
- data/ext/gyp/test/mac/gyptest-postbuild-fail.py +71 -0
- data/ext/gyp/test/mac/gyptest-postbuild-multiple-configurations.py +26 -0
- data/ext/gyp/test/mac/gyptest-postbuild-static-library.py +28 -0
- data/ext/gyp/test/mac/gyptest-postbuild.py +53 -0
- data/ext/gyp/test/mac/gyptest-prefixheader.py +20 -0
- data/ext/gyp/test/mac/gyptest-rebuild.py +46 -0
- data/ext/gyp/test/mac/gyptest-rpath.py +50 -0
- data/ext/gyp/test/mac/gyptest-sdkroot.py +56 -0
- data/ext/gyp/test/mac/gyptest-sourceless-module.py +77 -0
- data/ext/gyp/test/mac/gyptest-strip-default.py +97 -0
- data/ext/gyp/test/mac/gyptest-strip.py +66 -0
- data/ext/gyp/test/mac/gyptest-swift-library.py +67 -0
- data/ext/gyp/test/mac/gyptest-type-envvars.py +26 -0
- data/ext/gyp/test/mac/gyptest-unicode-settings.py +20 -0
- data/ext/gyp/test/mac/gyptest-xcode-env-order.py +95 -0
- data/ext/gyp/test/mac/gyptest-xcode-gcc-clang.py +40 -0
- data/ext/gyp/test/mac/gyptest-xcode-gcc.py +60 -0
- data/ext/gyp/test/mac/gyptest-xcode-support-actions.py +25 -0
- data/ext/gyp/test/mac/gyptest-xctest.py +41 -0
- data/ext/gyp/test/mac/gyptest-xcuitest.py +39 -0
- data/ext/gyp/test/mac/identical-name/proxy/proxy.cc +2 -0
- data/ext/gyp/test/mac/identical-name/proxy/proxy.gyp +9 -0
- data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.cc +2 -0
- data/ext/gyp/test/mac/identical-name/proxy/testlib/testlib.gyp +8 -0
- data/ext/gyp/test/mac/identical-name/test-should-fail.gyp +10 -0
- data/ext/gyp/test/mac/identical-name/test.gyp +11 -0
- data/ext/gyp/test/mac/identical-name/test.gypi +7 -0
- data/ext/gyp/test/mac/identical-name/testlib/main.cc +3 -0
- data/ext/gyp/test/mac/identical-name/testlib/testlib.gyp +14 -0
- data/ext/gyp/test/mac/identical-name/testlib/void.cc +2 -0
- data/ext/gyp/test/mac/infoplist-process/Info.plist +36 -0
- data/ext/gyp/test/mac/infoplist-process/main.c +7 -0
- data/ext/gyp/test/mac/infoplist-process/test1.gyp +25 -0
- data/ext/gyp/test/mac/infoplist-process/test2.gyp +25 -0
- data/ext/gyp/test/mac/infoplist-process/test3.gyp +25 -0
- data/ext/gyp/test/mac/installname/Info.plist +28 -0
- data/ext/gyp/test/mac/installname/file.c +1 -0
- data/ext/gyp/test/mac/installname/main.c +1 -0
- data/ext/gyp/test/mac/installname/test.gyp +93 -0
- data/ext/gyp/test/mac/kext/GypKext/GypKext-Info.plist +35 -0
- data/ext/gyp/test/mac/kext/GypKext/GypKext.c +16 -0
- data/ext/gyp/test/mac/kext/kext.gyp +18 -0
- data/ext/gyp/test/mac/ldflags/subdirectory/Info.plist +8 -0
- data/ext/gyp/test/mac/ldflags/subdirectory/file.c +2 -0
- data/ext/gyp/test/mac/ldflags/subdirectory/symbol_list.def +1 -0
- data/ext/gyp/test/mac/ldflags/subdirectory/test.gyp +66 -0
- data/ext/gyp/test/mac/ldflags-libtool/file.c +1 -0
- data/ext/gyp/test/mac/ldflags-libtool/test.gyp +17 -0
- data/ext/gyp/test/mac/libraries/subdir/README.txt +1 -0
- data/ext/gyp/test/mac/libraries/subdir/hello.cc +10 -0
- data/ext/gyp/test/mac/libraries/subdir/mylib.c +7 -0
- data/ext/gyp/test/mac/libraries/subdir/test.gyp +65 -0
- data/ext/gyp/test/mac/libtool-zero/mylib.c +7 -0
- data/ext/gyp/test/mac/libtool-zero/test.gyp +18 -0
- data/ext/gyp/test/mac/loadable-module/Info.plist +26 -0
- data/ext/gyp/test/mac/loadable-module/module.c +11 -0
- data/ext/gyp/test/mac/loadable-module/test.gyp +18 -0
- data/ext/gyp/test/mac/loadable-module-bundle-product-extension/src.cc +7 -0
- data/ext/gyp/test/mac/loadable-module-bundle-product-extension/test.gyp +24 -0
- data/ext/gyp/test/mac/lto/asmfile.S +2 -0
- data/ext/gyp/test/mac/lto/ccfile.cc +1 -0
- data/ext/gyp/test/mac/lto/cfile.c +1 -0
- data/ext/gyp/test/mac/lto/mfile.m +1 -0
- data/ext/gyp/test/mac/lto/mmfile.mm +1 -0
- data/ext/gyp/test/mac/lto/test.gyp +35 -0
- data/ext/gyp/test/mac/missing-cfbundlesignature/Info.plist +10 -0
- data/ext/gyp/test/mac/missing-cfbundlesignature/Other-Info.plist +12 -0
- data/ext/gyp/test/mac/missing-cfbundlesignature/Third-Info.plist +12 -0
- data/ext/gyp/test/mac/missing-cfbundlesignature/file.c +1 -0
- data/ext/gyp/test/mac/missing-cfbundlesignature/test.gyp +34 -0
- data/ext/gyp/test/mac/non-strs-flattened-to-env/Info.plist +15 -0
- data/ext/gyp/test/mac/non-strs-flattened-to-env/main.c +7 -0
- data/ext/gyp/test/mac/non-strs-flattened-to-env/test.gyp +27 -0
- data/ext/gyp/test/mac/objc-arc/c-file.c +5 -0
- data/ext/gyp/test/mac/objc-arc/cc-file.cc +5 -0
- data/ext/gyp/test/mac/objc-arc/m-file-arc-weak.m +9 -0
- data/ext/gyp/test/mac/objc-arc/m-file-no-arc.m +9 -0
- data/ext/gyp/test/mac/objc-arc/m-file.m +9 -0
- data/ext/gyp/test/mac/objc-arc/mm-file-arc-weak.mm +9 -0
- data/ext/gyp/test/mac/objc-arc/mm-file-no-arc.mm +9 -0
- data/ext/gyp/test/mac/objc-arc/mm-file.mm +9 -0
- data/ext/gyp/test/mac/objc-arc/test.gyp +53 -0
- data/ext/gyp/test/mac/objc-gc/c-file.c +1 -0
- data/ext/gyp/test/mac/objc-gc/cc-file.cc +1 -0
- data/ext/gyp/test/mac/objc-gc/main.m +6 -0
- data/ext/gyp/test/mac/objc-gc/needs-gc-mm.mm +1 -0
- data/ext/gyp/test/mac/objc-gc/needs-gc.m +1 -0
- data/ext/gyp/test/mac/objc-gc/test.gyp +102 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/Framework-Info.plist +30 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/TestApp-Info.plist +32 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/copied.txt +1 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/empty.c +0 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/main.c +4 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh +9 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/resource_file.sb +1 -0
- data/ext/gyp/test/mac/postbuild-copy-bundle/test.gyp +49 -0
- data/ext/gyp/test/mac/postbuild-defaults/Info.plist +13 -0
- data/ext/gyp/test/mac/postbuild-defaults/main.c +7 -0
- data/ext/gyp/test/mac/postbuild-defaults/postbuild-defaults.sh +15 -0
- data/ext/gyp/test/mac/postbuild-defaults/test.gyp +26 -0
- data/ext/gyp/test/mac/postbuild-fail/file.c +6 -0
- data/ext/gyp/test/mac/postbuild-fail/postbuild-fail.sh +6 -0
- data/ext/gyp/test/mac/postbuild-fail/test.gyp +38 -0
- data/ext/gyp/test/mac/postbuild-fail/touch-dynamic.sh +7 -0
- data/ext/gyp/test/mac/postbuild-fail/touch-static.sh +7 -0
- data/ext/gyp/test/mac/postbuild-multiple-configurations/main.c +4 -0
- data/ext/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh +7 -0
- data/ext/gyp/test/mac/postbuild-multiple-configurations/test.gyp +26 -0
- data/ext/gyp/test/mac/postbuild-static-library/empty.c +4 -0
- data/ext/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh +7 -0
- data/ext/gyp/test/mac/postbuild-static-library/test.gyp +34 -0
- data/ext/gyp/test/mac/postbuilds/copy.sh +3 -0
- data/ext/gyp/test/mac/postbuilds/file.c +4 -0
- data/ext/gyp/test/mac/postbuilds/file_g.c +4 -0
- data/ext/gyp/test/mac/postbuilds/file_h.c +4 -0
- data/ext/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh +23 -0
- data/ext/gyp/test/mac/postbuilds/script/static_library_postbuild.sh +23 -0
- data/ext/gyp/test/mac/postbuilds/subdirectory/copied_file.txt +1 -0
- data/ext/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp +53 -0
- data/ext/gyp/test/mac/postbuilds/test.gyp +93 -0
- data/ext/gyp/test/mac/prefixheader/file.c +1 -0
- data/ext/gyp/test/mac/prefixheader/file.cc +1 -0
- data/ext/gyp/test/mac/prefixheader/file.m +1 -0
- data/ext/gyp/test/mac/prefixheader/file.mm +1 -0
- data/ext/gyp/test/mac/prefixheader/header.h +1 -0
- data/ext/gyp/test/mac/prefixheader/test.gyp +82 -0
- data/ext/gyp/test/mac/rebuild/TestApp-Info.plist +32 -0
- data/ext/gyp/test/mac/rebuild/delay-touch.sh +6 -0
- data/ext/gyp/test/mac/rebuild/empty.c +0 -0
- data/ext/gyp/test/mac/rebuild/main.c +1 -0
- data/ext/gyp/test/mac/rebuild/test.gyp +56 -0
- data/ext/gyp/test/mac/rpath/file.c +1 -0
- data/ext/gyp/test/mac/rpath/main.c +1 -0
- data/ext/gyp/test/mac/rpath/test.gyp +48 -0
- data/ext/gyp/test/mac/sdkroot/file.cc +5 -0
- data/ext/gyp/test/mac/sdkroot/test.gyp +35 -0
- data/ext/gyp/test/mac/sdkroot/test_shorthand.sh +20 -0
- data/ext/gyp/test/mac/sourceless-module/empty.c +1 -0
- data/ext/gyp/test/mac/sourceless-module/empty.txt +2 -0
- data/ext/gyp/test/mac/sourceless-module/fun.c +1 -0
- data/ext/gyp/test/mac/sourceless-module/test.gyp +96 -0
- data/ext/gyp/test/mac/strip/file.c +22 -0
- data/ext/gyp/test/mac/strip/main.c +25 -0
- data/ext/gyp/test/mac/strip/strip.saves +5 -0
- data/ext/gyp/test/mac/strip/subdirectory/nested_file.c +1 -0
- data/ext/gyp/test/mac/strip/subdirectory/nested_strip.saves +5 -0
- data/ext/gyp/test/mac/strip/subdirectory/subdirectory.gyp +38 -0
- data/ext/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh +5 -0
- data/ext/gyp/test/mac/strip/test-defaults.gyp +51 -0
- data/ext/gyp/test/mac/strip/test.gyp +119 -0
- data/ext/gyp/test/mac/swift-library/Info.plist +28 -0
- data/ext/gyp/test/mac/swift-library/file.swift +9 -0
- data/ext/gyp/test/mac/swift-library/test.gyp +21 -0
- data/ext/gyp/test/mac/type_envvars/file.c +6 -0
- data/ext/gyp/test/mac/type_envvars/test.gyp +100 -0
- data/ext/gyp/test/mac/type_envvars/test_bundle_executable.sh +30 -0
- data/ext/gyp/test/mac/type_envvars/test_bundle_loadable_module.sh +35 -0
- data/ext/gyp/test/mac/type_envvars/test_bundle_shared_library.sh +38 -0
- data/ext/gyp/test/mac/type_envvars/test_check_sdkroot.sh +47 -0
- data/ext/gyp/test/mac/type_envvars/test_nonbundle_executable.sh +33 -0
- data/ext/gyp/test/mac/type_envvars/test_nonbundle_loadable_module.sh +31 -0
- data/ext/gyp/test/mac/type_envvars/test_nonbundle_none.sh +32 -0
- data/ext/gyp/test/mac/type_envvars/test_nonbundle_shared_library.sh +31 -0
- data/ext/gyp/test/mac/type_envvars/test_nonbundle_static_library.sh +31 -0
- data/ext/gyp/test/mac/unicode-settings/file.cc +2 -0
- data/ext/gyp/test/mac/unicode-settings/test.gyp +23 -0
- data/ext/gyp/test/mac/unicode-settings/test_bundle_display_name.sh +7 -0
- data/ext/gyp/test/mac/xcode-env-order/Info.plist +56 -0
- data/ext/gyp/test/mac/xcode-env-order/file.ext1 +0 -0
- data/ext/gyp/test/mac/xcode-env-order/file.ext2 +0 -0
- data/ext/gyp/test/mac/xcode-env-order/file.ext3 +0 -0
- data/ext/gyp/test/mac/xcode-env-order/main.c +7 -0
- data/ext/gyp/test/mac/xcode-env-order/test.gyp +121 -0
- data/ext/gyp/test/mac/xcode-gcc/aliasing.cc +13 -0
- data/ext/gyp/test/mac/xcode-gcc/test-clang.gyp +42 -0
- data/ext/gyp/test/mac/xcode-gcc/test.gyp +60 -0
- data/ext/gyp/test/mac/xcode-gcc/valid_c.c +8 -0
- data/ext/gyp/test/mac/xcode-gcc/valid_cc.cc +8 -0
- data/ext/gyp/test/mac/xcode-gcc/valid_m.m +8 -0
- data/ext/gyp/test/mac/xcode-gcc/valid_mm.mm +8 -0
- data/ext/gyp/test/mac/xcode-gcc/warn_about_invalid_offsetof_macro.cc +15 -0
- data/ext/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c +8 -0
- data/ext/gyp/test/mac/xcode-support-actions/source.c +0 -0
- data/ext/gyp/test/mac/xcode-support-actions/test.gyp +26 -0
- data/ext/gyp/test/mac/xctest/MyClass.h +8 -0
- data/ext/gyp/test/mac/xctest/MyClass.m +8 -0
- data/ext/gyp/test/mac/xctest/TestCase.m +16 -0
- data/ext/gyp/test/mac/xctest/resource.txt +1 -0
- data/ext/gyp/test/mac/xctest/test.gyp +47 -0
- data/ext/gyp/test/mac/xctest/test.xcodeproj/xcshareddata/xcschemes/classes.xcscheme +69 -0
- data/ext/gyp/test/mac/xcuitest/Info.plist +28 -0
- data/ext/gyp/test/mac/xcuitest/MyAppDelegate.h +8 -0
- data/ext/gyp/test/mac/xcuitest/MyAppDelegate.m +19 -0
- data/ext/gyp/test/mac/xcuitest/TestCase.m +15 -0
- data/ext/gyp/test/mac/xcuitest/main.m +15 -0
- data/ext/gyp/test/mac/xcuitest/resource.txt +1 -0
- data/ext/gyp/test/mac/xcuitest/test.gyp +69 -0
- data/ext/gyp/test/make/dependencies.gyp +15 -0
- data/ext/gyp/test/make/gyptest-dependencies.py +26 -0
- data/ext/gyp/test/make/gyptest-noload.py +57 -0
- data/ext/gyp/test/make/main.cc +12 -0
- data/ext/gyp/test/make/main.h +0 -0
- data/ext/gyp/test/make/noload/all.gyp +18 -0
- data/ext/gyp/test/make/noload/lib/shared.c +3 -0
- data/ext/gyp/test/make/noload/lib/shared.gyp +16 -0
- data/ext/gyp/test/make/noload/lib/shared.h +1 -0
- data/ext/gyp/test/make/noload/main.c +9 -0
- data/ext/gyp/test/make_global_settings/ar/gyptest-make_global_settings_ar.py +126 -0
- data/ext/gyp/test/make_global_settings/ar/make_global_settings_ar.gyp +29 -0
- data/ext/gyp/test/make_global_settings/basics/gyptest-make_global_settings.py +51 -0
- data/ext/gyp/test/make_global_settings/basics/make_global_settings.gyp +17 -0
- data/ext/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py +51 -0
- data/ext/gyp/test/make_global_settings/env-wrapper/wrapper.gyp +17 -0
- data/ext/gyp/test/make_global_settings/full-toolchain/bar.cc +1 -0
- data/ext/gyp/test/make_global_settings/full-toolchain/foo.c +1 -0
- data/ext/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py +53 -0
- data/ext/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp +22 -0
- data/ext/gyp/test/make_global_settings/full-toolchain/my_nm.py +9 -0
- data/ext/gyp/test/make_global_settings/full-toolchain/my_readelf.py +9 -0
- data/ext/gyp/test/make_global_settings/ld/gyptest-make_global_settings_ld.py +130 -0
- data/ext/gyp/test/make_global_settings/ld/make_global_settings_ld.gyp +29 -0
- data/ext/gyp/test/make_global_settings/wrapper/gyptest-wrapper.py +52 -0
- data/ext/gyp/test/make_global_settings/wrapper/wrapper.gyp +21 -0
- data/ext/gyp/test/many-actions/file0 +0 -0
- data/ext/gyp/test/many-actions/file1 +0 -0
- data/ext/gyp/test/many-actions/file2 +0 -0
- data/ext/gyp/test/many-actions/file3 +0 -0
- data/ext/gyp/test/many-actions/file4 +0 -0
- data/ext/gyp/test/many-actions/gyptest-many-actions-unsorted.py +43 -0
- data/ext/gyp/test/many-actions/gyptest-many-actions.py +29 -0
- data/ext/gyp/test/many-actions/many-actions-unsorted.gyp +154 -0
- data/ext/gyp/test/many-actions/many-actions.gyp +1817 -0
- data/ext/gyp/test/module/gyptest-default.py +28 -0
- data/ext/gyp/test/module/src/lib1.c +10 -0
- data/ext/gyp/test/module/src/lib2.c +10 -0
- data/ext/gyp/test/module/src/module.gyp +53 -0
- data/ext/gyp/test/module/src/program.c +111 -0
- data/ext/gyp/test/msvs/buildevents/buildevents.gyp +14 -0
- data/ext/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py +24 -0
- data/ext/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py +29 -0
- data/ext/gyp/test/msvs/buildevents/main.cc +5 -0
- data/ext/gyp/test/msvs/config_attrs/gyptest-config_attrs.py +41 -0
- data/ext/gyp/test/msvs/config_attrs/hello.c +11 -0
- data/ext/gyp/test/msvs/config_attrs/hello.gyp +21 -0
- data/ext/gyp/test/msvs/express/base/base.gyp +22 -0
- data/ext/gyp/test/msvs/express/express.gyp +19 -0
- data/ext/gyp/test/msvs/express/gyptest-express.py +29 -0
- data/ext/gyp/test/msvs/external_builder/external.gyp +68 -0
- data/ext/gyp/test/msvs/external_builder/external_builder.py +9 -0
- data/ext/gyp/test/msvs/external_builder/gyptest-all.py +59 -0
- data/ext/gyp/test/msvs/external_builder/hello.cpp +10 -0
- data/ext/gyp/test/msvs/external_builder/hello.z +6 -0
- data/ext/gyp/test/msvs/external_builder/msbuild_action.py +9 -0
- data/ext/gyp/test/msvs/external_builder/msbuild_rule.py +11 -0
- data/ext/gyp/test/msvs/filters/filters.gyp +47 -0
- data/ext/gyp/test/msvs/filters/gyptest-filters-2008.py +68 -0
- data/ext/gyp/test/msvs/filters/gyptest-filters-2010.py +57 -0
- data/ext/gyp/test/msvs/list_excluded/gyptest-all.py +51 -0
- data/ext/gyp/test/msvs/list_excluded/hello.cpp +10 -0
- data/ext/gyp/test/msvs/list_excluded/hello_exclude.gyp +19 -0
- data/ext/gyp/test/msvs/list_excluded/hello_mac.cpp +10 -0
- data/ext/gyp/test/msvs/missing_sources/gyptest-missing.py +43 -0
- data/ext/gyp/test/msvs/missing_sources/hello_missing.gyp +15 -0
- data/ext/gyp/test/msvs/multiple_actions_error_handling/action_fail.py +7 -0
- data/ext/gyp/test/msvs/multiple_actions_error_handling/action_succeed.py +7 -0
- data/ext/gyp/test/msvs/multiple_actions_error_handling/actions.gyp +40 -0
- data/ext/gyp/test/msvs/multiple_actions_error_handling/gyptest.py +26 -0
- data/ext/gyp/test/msvs/props/AppName.props +14 -0
- data/ext/gyp/test/msvs/props/AppName.vsprops +11 -0
- data/ext/gyp/test/msvs/props/gyptest-props.py +22 -0
- data/ext/gyp/test/msvs/props/hello.c +11 -0
- data/ext/gyp/test/msvs/props/hello.gyp +22 -0
- data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.bar +5 -0
- data/ext/gyp/test/msvs/rules_stdout_stderr/dummy.foo +5 -0
- data/ext/gyp/test/msvs/rules_stdout_stderr/gyptest-rules-stdout-stderr.py +29 -0
- data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stderr.py +8 -0
- data/ext/gyp/test/msvs/rules_stdout_stderr/rule_stdout.py +7 -0
- data/ext/gyp/test/msvs/rules_stdout_stderr/rules-stdout-stderr.gyp +52 -0
- data/ext/gyp/test/msvs/shared_output/common.gypi +17 -0
- data/ext/gyp/test/msvs/shared_output/gyptest-shared_output.py +41 -0
- data/ext/gyp/test/msvs/shared_output/hello.c +12 -0
- data/ext/gyp/test/msvs/shared_output/hello.gyp +21 -0
- data/ext/gyp/test/msvs/shared_output/there/there.c +12 -0
- data/ext/gyp/test/msvs/shared_output/there/there.gyp +16 -0
- data/ext/gyp/test/msvs/uldi2010/gyptest-all.py +20 -0
- data/ext/gyp/test/msvs/uldi2010/hello.c +13 -0
- data/ext/gyp/test/msvs/uldi2010/hello.gyp +26 -0
- data/ext/gyp/test/msvs/uldi2010/hello2.c +10 -0
- data/ext/gyp/test/multiple-targets/gyptest-all.py +30 -0
- data/ext/gyp/test/multiple-targets/gyptest-default.py +30 -0
- data/ext/gyp/test/multiple-targets/src/common.c +7 -0
- data/ext/gyp/test/multiple-targets/src/multiple.gyp +24 -0
- data/ext/gyp/test/multiple-targets/src/prog1.c +10 -0
- data/ext/gyp/test/multiple-targets/src/prog2.c +10 -0
- data/ext/gyp/test/ninja/action-rule-hash/gyptest-action-rule-hash.py +32 -0
- data/ext/gyp/test/ninja/action-rule-hash/subdir/action-rule-hash.gyp +29 -0
- data/ext/gyp/test/ninja/action-rule-hash/subdir/emit.py +13 -0
- data/ext/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py +64 -0
- data/ext/gyp/test/ninja/action_dependencies/src/a.c +10 -0
- data/ext/gyp/test/ninja/action_dependencies/src/a.h +13 -0
- data/ext/gyp/test/ninja/action_dependencies/src/action_dependencies.gyp +88 -0
- data/ext/gyp/test/ninja/action_dependencies/src/b.c +18 -0
- data/ext/gyp/test/ninja/action_dependencies/src/b.h +13 -0
- data/ext/gyp/test/ninja/action_dependencies/src/c.c +10 -0
- data/ext/gyp/test/ninja/action_dependencies/src/c.h +13 -0
- data/ext/gyp/test/ninja/action_dependencies/src/emit.py +11 -0
- data/ext/gyp/test/ninja/chained-dependency/chained-dependency.gyp +53 -0
- data/ext/gyp/test/ninja/chained-dependency/chained.c +5 -0
- data/ext/gyp/test/ninja/chained-dependency/gyptest-chained-dependency.py +30 -0
- data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py +23 -0
- data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/subdir/included.gyp +19 -0
- data/ext/gyp/test/ninja/empty-and-non-empty-duplicate-name/test.gyp +19 -0
- data/ext/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py +46 -0
- data/ext/gyp/test/ninja/normalize-paths-win/hello.cc +7 -0
- data/ext/gyp/test/ninja/normalize-paths-win/normalize-paths.gyp +68 -0
- data/ext/gyp/test/ninja/s-needs-no-depfiles/empty.s +1 -0
- data/ext/gyp/test/ninja/s-needs-no-depfiles/gyptest-s-needs-no-depfiles.py +42 -0
- data/ext/gyp/test/ninja/s-needs-no-depfiles/s-needs-no-depfiles.gyp +13 -0
- data/ext/gyp/test/ninja/solibs_avoid_relinking/gyptest-solibs-avoid-relinking.py +48 -0
- data/ext/gyp/test/ninja/solibs_avoid_relinking/main.cc +5 -0
- data/ext/gyp/test/ninja/solibs_avoid_relinking/solib.cc +8 -0
- data/ext/gyp/test/ninja/solibs_avoid_relinking/solibs_avoid_relinking.gyp +38 -0
- data/ext/gyp/test/ninja/use-console/foo.bar +5 -0
- data/ext/gyp/test/ninja/use-console/gyptest-use-console.py +29 -0
- data/ext/gyp/test/ninja/use-console/use-console.gyp +60 -0
- data/ext/gyp/test/ninja/use-custom-environment-files/gyptest-use-custom-environment-files.py +28 -0
- data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc +7 -0
- data/ext/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.gyp +15 -0
- data/ext/gyp/test/no-cpp/gyptest-no-cpp.py +53 -0
- data/ext/gyp/test/no-cpp/src/call-f-main.c +2 -0
- data/ext/gyp/test/no-cpp/src/empty-main.c +1 -0
- data/ext/gyp/test/no-cpp/src/f.cc +3 -0
- data/ext/gyp/test/no-cpp/src/test.gyp +25 -0
- data/ext/gyp/test/no-output/gyptest-no-output.py +21 -0
- data/ext/gyp/test/no-output/src/nooutput.gyp +17 -0
- data/ext/gyp/test/product/gyptest-product.py +43 -0
- data/ext/gyp/test/product/hello.c +15 -0
- data/ext/gyp/test/product/product.gyp +128 -0
- data/ext/gyp/test/prune_targets/gyptest-prune-targets.py +66 -0
- data/ext/gyp/test/prune_targets/lib1.cc +6 -0
- data/ext/gyp/test/prune_targets/lib2.cc +6 -0
- data/ext/gyp/test/prune_targets/lib3.cc +6 -0
- data/ext/gyp/test/prune_targets/lib_indirect.cc +6 -0
- data/ext/gyp/test/prune_targets/program.cc +7 -0
- data/ext/gyp/test/prune_targets/test1.gyp +26 -0
- data/ext/gyp/test/prune_targets/test2.gyp +30 -0
- data/ext/gyp/test/relative/foo/a/a.cc +9 -0
- data/ext/gyp/test/relative/foo/a/a.gyp +13 -0
- data/ext/gyp/test/relative/foo/a/c/c.cc +9 -0
- data/ext/gyp/test/relative/foo/a/c/c.gyp +12 -0
- data/ext/gyp/test/relative/foo/b/b.cc +9 -0
- data/ext/gyp/test/relative/foo/b/b.gyp +9 -0
- data/ext/gyp/test/relative/gyptest-default.py +25 -0
- data/ext/gyp/test/rename/filecase/file.c +1 -0
- data/ext/gyp/test/rename/filecase/test-casesensitive.gyp +15 -0
- data/ext/gyp/test/rename/filecase/test.gyp +14 -0
- data/ext/gyp/test/rename/gyptest-filecase.py +35 -0
- data/ext/gyp/test/restat/gyptest-restat.py +31 -0
- data/ext/gyp/test/restat/src/create_intermediate.py +17 -0
- data/ext/gyp/test/restat/src/restat.gyp +50 -0
- data/ext/gyp/test/restat/src/touch.py +16 -0
- data/ext/gyp/test/rules/gyptest-all.py +84 -0
- data/ext/gyp/test/rules/gyptest-default.py +70 -0
- data/ext/gyp/test/rules/gyptest-input-root.py +26 -0
- data/ext/gyp/test/rules/gyptest-special-variables.py +18 -0
- data/ext/gyp/test/rules/src/actions.gyp +23 -0
- data/ext/gyp/test/rules/src/an_asm.S +6 -0
- data/ext/gyp/test/rules/src/as.bat +7 -0
- data/ext/gyp/test/rules/src/copy-file.py +11 -0
- data/ext/gyp/test/rules/src/external/external.gyp +66 -0
- data/ext/gyp/test/rules/src/external/file1.in +1 -0
- data/ext/gyp/test/rules/src/external/file2.in +1 -0
- data/ext/gyp/test/rules/src/input-root.gyp +24 -0
- data/ext/gyp/test/rules/src/noaction/file1.in +1 -0
- data/ext/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp +37 -0
- data/ext/gyp/test/rules/src/rule.py +17 -0
- data/ext/gyp/test/rules/src/somefile.ext +0 -0
- data/ext/gyp/test/rules/src/special-variables.gyp +34 -0
- data/ext/gyp/test/rules/src/subdir1/executable.gyp +37 -0
- data/ext/gyp/test/rules/src/subdir1/function1.in +6 -0
- data/ext/gyp/test/rules/src/subdir1/function2.in +6 -0
- data/ext/gyp/test/rules/src/subdir1/program.c +12 -0
- data/ext/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp +50 -0
- data/ext/gyp/test/rules/src/subdir2/file1.in +1 -0
- data/ext/gyp/test/rules/src/subdir2/file2.in +1 -0
- data/ext/gyp/test/rules/src/subdir2/never_used.gyp +31 -0
- data/ext/gyp/test/rules/src/subdir2/no_action.gyp +38 -0
- data/ext/gyp/test/rules/src/subdir2/no_inputs.gyp +32 -0
- data/ext/gyp/test/rules/src/subdir2/none.gyp +33 -0
- data/ext/gyp/test/rules/src/subdir2/program.c +12 -0
- data/ext/gyp/test/rules/src/subdir3/executable2.gyp +37 -0
- data/ext/gyp/test/rules/src/subdir3/function3.in +6 -0
- data/ext/gyp/test/rules/src/subdir3/program.c +10 -0
- data/ext/gyp/test/rules/src/subdir4/asm-function.assem +10 -0
- data/ext/gyp/test/rules/src/subdir4/build-asm.gyp +49 -0
- data/ext/gyp/test/rules/src/subdir4/program.c +19 -0
- data/ext/gyp/test/rules-dirname/gyptest-dirname.py +57 -0
- data/ext/gyp/test/rules-dirname/src/actions.gyp +15 -0
- data/ext/gyp/test/rules-dirname/src/copy-file.py +11 -0
- data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.gencc +8 -0
- data/ext/gyp/test/rules-dirname/src/subdir/a/b/c.printvars +1 -0
- data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc +8 -0
- data/ext/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars +1 -0
- data/ext/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp +140 -0
- data/ext/gyp/test/rules-dirname/src/subdir/main.cc +14 -0
- data/ext/gyp/test/rules-dirname/src/subdir/nodir.gencc +8 -0
- data/ext/gyp/test/rules-dirname/src/subdir/printvars.py +14 -0
- data/ext/gyp/test/rules-rebuild/gyptest-all.py +70 -0
- data/ext/gyp/test/rules-rebuild/gyptest-default.py +91 -0
- data/ext/gyp/test/rules-rebuild/src/main.c +12 -0
- data/ext/gyp/test/rules-rebuild/src/make-sources.py +19 -0
- data/ext/gyp/test/rules-rebuild/src/prog1.in +7 -0
- data/ext/gyp/test/rules-rebuild/src/prog2.in +7 -0
- data/ext/gyp/test/rules-rebuild/src/same_target.gyp +31 -0
- data/ext/gyp/test/rules-use-built-dependencies/gyptest-use-built-dependencies.py +23 -0
- data/ext/gyp/test/rules-use-built-dependencies/src/main.cc +17 -0
- data/ext/gyp/test/rules-use-built-dependencies/src/use-built-dependencies-rule.gyp +42 -0
- data/ext/gyp/test/rules-variables/gyptest-rules-variables.py +35 -0
- data/ext/gyp/test/rules-variables/src/input_ext.c +9 -0
- data/ext/gyp/test/rules-variables/src/input_name/test.c +9 -0
- data/ext/gyp/test/rules-variables/src/input_path/subdir/test.c +9 -0
- data/ext/gyp/test/rules-variables/src/subdir/input_dirname.c +9 -0
- data/ext/gyp/test/rules-variables/src/subdir/test.c +18 -0
- data/ext/gyp/test/rules-variables/src/test.input_root.c +9 -0
- data/ext/gyp/test/rules-variables/src/variables.gyp +40 -0
- data/ext/gyp/test/same-gyp-name/gyptest-all.py +38 -0
- data/ext/gyp/test/same-gyp-name/gyptest-default.py +38 -0
- data/ext/gyp/test/same-gyp-name/gyptest-library.py +20 -0
- data/ext/gyp/test/same-gyp-name/library/one/sub.gyp +11 -0
- data/ext/gyp/test/same-gyp-name/library/test.gyp +15 -0
- data/ext/gyp/test/same-gyp-name/library/two/sub.gyp +11 -0
- data/ext/gyp/test/same-gyp-name/src/all.gyp +16 -0
- data/ext/gyp/test/same-gyp-name/src/subdir1/executable.gyp +15 -0
- data/ext/gyp/test/same-gyp-name/src/subdir1/main1.cc +6 -0
- data/ext/gyp/test/same-gyp-name/src/subdir2/executable.gyp +15 -0
- data/ext/gyp/test/same-gyp-name/src/subdir2/main2.cc +6 -0
- data/ext/gyp/test/same-rule-output-file-name/gyptest-all.py +23 -0
- data/ext/gyp/test/same-rule-output-file-name/src/subdir1/subdir1.gyp +30 -0
- data/ext/gyp/test/same-rule-output-file-name/src/subdir2/subdir2.gyp +30 -0
- data/ext/gyp/test/same-rule-output-file-name/src/subdirs.gyp +16 -0
- data/ext/gyp/test/same-rule-output-file-name/src/touch.py +11 -0
- data/ext/gyp/test/same-source-file-name/gyptest-all.py +34 -0
- data/ext/gyp/test/same-source-file-name/gyptest-default.py +34 -0
- data/ext/gyp/test/same-source-file-name/gyptest-pass-executable.py +33 -0
- data/ext/gyp/test/same-source-file-name/gyptest-pass-shared.py +18 -0
- data/ext/gyp/test/same-source-file-name/gyptest-static.py +34 -0
- data/ext/gyp/test/same-source-file-name/src/all.gyp +30 -0
- data/ext/gyp/test/same-source-file-name/src/double-executable.gyp +21 -0
- data/ext/gyp/test/same-source-file-name/src/double-shared.gyp +27 -0
- data/ext/gyp/test/same-source-file-name/src/double-static.gyp +22 -0
- data/ext/gyp/test/same-source-file-name/src/func.c +6 -0
- data/ext/gyp/test/same-source-file-name/src/prog1.c +16 -0
- data/ext/gyp/test/same-source-file-name/src/prog2.c +16 -0
- data/ext/gyp/test/same-source-file-name/src/prog3.c +18 -0
- data/ext/gyp/test/same-source-file-name/src/subdir1/func.c +6 -0
- data/ext/gyp/test/same-source-file-name/src/subdir2/func.c +6 -0
- data/ext/gyp/test/same-target-name/gyptest-same-target-name.py +18 -0
- data/ext/gyp/test/same-target-name/src/all.gyp +16 -0
- data/ext/gyp/test/same-target-name/src/executable1.gyp +15 -0
- data/ext/gyp/test/same-target-name/src/executable2.gyp +15 -0
- data/ext/gyp/test/same-target-name-different-directory/gyptest-all.py +41 -0
- data/ext/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp +66 -0
- data/ext/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp +66 -0
- data/ext/gyp/test/same-target-name-different-directory/src/subdirs.gyp +16 -0
- data/ext/gyp/test/same-target-name-different-directory/src/touch.py +11 -0
- data/ext/gyp/test/sanitize-rule-names/blah.S +0 -0
- data/ext/gyp/test/sanitize-rule-names/gyptest-sanitize-rule-names.py +17 -0
- data/ext/gyp/test/sanitize-rule-names/hello.cc +7 -0
- data/ext/gyp/test/sanitize-rule-names/sanitize-rule-names.gyp +27 -0
- data/ext/gyp/test/sanitize-rule-names/script.py +10 -0
- data/ext/gyp/test/self-dependency/common.gypi +13 -0
- data/ext/gyp/test/self-dependency/dep.gyp +23 -0
- data/ext/gyp/test/self-dependency/gyptest-self-dependency.py +19 -0
- data/ext/gyp/test/self-dependency/self_dependency.gyp +15 -0
- data/ext/gyp/test/sibling/gyptest-all.py +42 -0
- data/ext/gyp/test/sibling/gyptest-relocate.py +44 -0
- data/ext/gyp/test/sibling/src/build/all.gyp +16 -0
- data/ext/gyp/test/sibling/src/prog1/prog1.c +7 -0
- data/ext/gyp/test/sibling/src/prog1/prog1.gyp +15 -0
- data/ext/gyp/test/sibling/src/prog2/prog2.c +7 -0
- data/ext/gyp/test/sibling/src/prog2/prog2.gyp +15 -0
- data/ext/gyp/test/small/gyptest-small.py +56 -0
- data/ext/gyp/test/standalone/gyptest-standalone.py +35 -0
- data/ext/gyp/test/standalone/standalone.gyp +12 -0
- data/ext/gyp/test/standalone-static-library/gyptest-standalone-static-library.py +50 -0
- data/ext/gyp/test/standalone-static-library/invalid.gyp +16 -0
- data/ext/gyp/test/standalone-static-library/mylib.c +7 -0
- data/ext/gyp/test/standalone-static-library/mylib.gyp +26 -0
- data/ext/gyp/test/standalone-static-library/prog.c +7 -0
- data/ext/gyp/test/subdirectory/gyptest-SYMROOT-all.py +36 -0
- data/ext/gyp/test/subdirectory/gyptest-SYMROOT-default.py +37 -0
- data/ext/gyp/test/subdirectory/gyptest-subdir-all.py +34 -0
- data/ext/gyp/test/subdirectory/gyptest-subdir-default.py +34 -0
- data/ext/gyp/test/subdirectory/gyptest-subdir2-deep.py +25 -0
- data/ext/gyp/test/subdirectory/gyptest-top-all.py +43 -0
- data/ext/gyp/test/subdirectory/gyptest-top-default.py +43 -0
- data/ext/gyp/test/subdirectory/src/prog1.c +7 -0
- data/ext/gyp/test/subdirectory/src/prog1.gyp +21 -0
- data/ext/gyp/test/subdirectory/src/subdir/prog2.c +7 -0
- data/ext/gyp/test/subdirectory/src/subdir/prog2.gyp +18 -0
- data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.c +7 -0
- data/ext/gyp/test/subdirectory/src/subdir/subdir2/prog3.gyp +18 -0
- data/ext/gyp/test/subdirectory/src/symroot.gypi +16 -0
- data/ext/gyp/test/symlinks/gyptest-symlinks.py +66 -0
- data/ext/gyp/test/symlinks/hello.c +12 -0
- data/ext/gyp/test/symlinks/hello.gyp +15 -0
- data/ext/gyp/test/target/gyptest-target.py +37 -0
- data/ext/gyp/test/target/hello.c +7 -0
- data/ext/gyp/test/target/target.gyp +24 -0
- data/ext/gyp/test/toolsets/gyptest-toolsets.py +31 -0
- data/ext/gyp/test/toolsets/main.cc +13 -0
- data/ext/gyp/test/toolsets/toolsets.cc +11 -0
- data/ext/gyp/test/toolsets/toolsets.gyp +62 -0
- data/ext/gyp/test/toolsets/toolsets_shared.cc +11 -0
- data/ext/gyp/test/toplevel-dir/gyptest-toplevel-dir.py +31 -0
- data/ext/gyp/test/toplevel-dir/src/sub1/main.gyp +18 -0
- data/ext/gyp/test/toplevel-dir/src/sub1/prog1.c +7 -0
- data/ext/gyp/test/toplevel-dir/src/sub2/prog2.c +7 -0
- data/ext/gyp/test/toplevel-dir/src/sub2/prog2.gyp +15 -0
- data/ext/gyp/test/variables/commands/commands-repeated.gyp +128 -0
- data/ext/gyp/test/variables/commands/commands-repeated.gyp.stdout +136 -0
- data/ext/gyp/test/variables/commands/commands-repeated.gypd.golden +77 -0
- data/ext/gyp/test/variables/commands/commands.gyp +91 -0
- data/ext/gyp/test/variables/commands/commands.gyp.ignore-env.stdout +96 -0
- data/ext/gyp/test/variables/commands/commands.gyp.stdout +96 -0
- data/ext/gyp/test/variables/commands/commands.gypd.golden +66 -0
- data/ext/gyp/test/variables/commands/commands.gypi +23 -0
- data/ext/gyp/test/variables/commands/gyptest-commands-ignore-env.py +47 -0
- data/ext/gyp/test/variables/commands/gyptest-commands-repeated-multidir.py +23 -0
- data/ext/gyp/test/variables/commands/gyptest-commands-repeated.py +40 -0
- data/ext/gyp/test/variables/commands/gyptest-commands.py +40 -0
- data/ext/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp +13 -0
- data/ext/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp +13 -0
- data/ext/gyp/test/variables/commands/repeated_multidir/main.gyp +16 -0
- data/ext/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py +11 -0
- data/ext/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi +25 -0
- data/ext/gyp/test/variables/commands/test.py +7 -0
- data/ext/gyp/test/variables/commands/update_golden +11 -0
- data/ext/gyp/test/variables/empty/empty.gyp +13 -0
- data/ext/gyp/test/variables/empty/empty.gypi +9 -0
- data/ext/gyp/test/variables/empty/gyptest-empty.py +19 -0
- data/ext/gyp/test/variables/filelist/filelist.gyp.stdout +26 -0
- data/ext/gyp/test/variables/filelist/filelist.gypd.golden +43 -0
- data/ext/gyp/test/variables/filelist/gyptest-filelist-golden.py +53 -0
- data/ext/gyp/test/variables/filelist/gyptest-filelist.py +29 -0
- data/ext/gyp/test/variables/filelist/src/dummy.py +5 -0
- data/ext/gyp/test/variables/filelist/src/filelist.gyp +93 -0
- data/ext/gyp/test/variables/filelist/src/filelist2.gyp +40 -0
- data/ext/gyp/test/variables/filelist/update_golden +8 -0
- data/ext/gyp/test/variables/latelate/gyptest-latelate.py +25 -0
- data/ext/gyp/test/variables/latelate/src/latelate.gyp +34 -0
- data/ext/gyp/test/variables/latelate/src/program.cc +13 -0
- data/ext/gyp/test/variables/variable-in-path/C1/hello.cc +7 -0
- data/ext/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py +23 -0
- data/ext/gyp/test/variables/variable-in-path/variable-in-path.gyp +31 -0
- data/ext/gyp/test/win/asm-files/asm-files.gyp +17 -0
- data/ext/gyp/test/win/asm-files/b.s +0 -0
- data/ext/gyp/test/win/asm-files/c.S +0 -0
- data/ext/gyp/test/win/asm-files/hello.cc +7 -0
- data/ext/gyp/test/win/batch-file-action/batch-file-action.gyp +21 -0
- data/ext/gyp/test/win/batch-file-action/infile +1 -0
- data/ext/gyp/test/win/batch-file-action/somecmd.bat +5 -0
- data/ext/gyp/test/win/command-quote/a.S +0 -0
- data/ext/gyp/test/win/command-quote/bat with spaces.bat +7 -0
- data/ext/gyp/test/win/command-quote/command-quote.gyp +79 -0
- data/ext/gyp/test/win/command-quote/go.bat +7 -0
- data/ext/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp +27 -0
- data/ext/gyp/test/win/compiler-flags/additional-include-dirs.cc +10 -0
- data/ext/gyp/test/win/compiler-flags/additional-include-dirs.gyp +20 -0
- data/ext/gyp/test/win/compiler-flags/additional-options.cc +10 -0
- data/ext/gyp/test/win/compiler-flags/additional-options.gyp +31 -0
- data/ext/gyp/test/win/compiler-flags/analysis.gyp +40 -0
- data/ext/gyp/test/win/compiler-flags/buffer-security-check.gyp +51 -0
- data/ext/gyp/test/win/compiler-flags/buffer-security.cc +12 -0
- data/ext/gyp/test/win/compiler-flags/calling-convention-cdecl.def +6 -0
- data/ext/gyp/test/win/compiler-flags/calling-convention-fastcall.def +6 -0
- data/ext/gyp/test/win/compiler-flags/calling-convention-stdcall.def +6 -0
- data/ext/gyp/test/win/compiler-flags/calling-convention-vectorcall.def +6 -0
- data/ext/gyp/test/win/compiler-flags/calling-convention.cc +6 -0
- data/ext/gyp/test/win/compiler-flags/calling-convention.gyp +66 -0
- data/ext/gyp/test/win/compiler-flags/character-set-mbcs.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/character-set-unicode.cc +15 -0
- data/ext/gyp/test/win/compiler-flags/character-set.gyp +35 -0
- data/ext/gyp/test/win/compiler-flags/compile-as-managed.cc +9 -0
- data/ext/gyp/test/win/compiler-flags/compile-as-managed.gyp +29 -0
- data/ext/gyp/test/win/compiler-flags/compile-as-winrt.cc +12 -0
- data/ext/gyp/test/win/compiler-flags/compile-as-winrt.gyp +20 -0
- data/ext/gyp/test/win/compiler-flags/debug-format.gyp +48 -0
- data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.cc +15 -0
- data/ext/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp +20 -0
- data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.cc +9 -0
- data/ext/gyp/test/win/compiler-flags/disable-specific-warnings.gyp +29 -0
- data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc +28 -0
- data/ext/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp +68 -0
- data/ext/gyp/test/win/compiler-flags/exception-handling-on.cc +24 -0
- data/ext/gyp/test/win/compiler-flags/exception-handling.gyp +46 -0
- data/ext/gyp/test/win/compiler-flags/floating-point-model-fast.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/floating-point-model-precise.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/floating-point-model-strict.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/floating-point-model.gyp +43 -0
- data/ext/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc +10 -0
- data/ext/gyp/test/win/compiler-flags/force-include-files.cc +8 -0
- data/ext/gyp/test/win/compiler-flags/force-include-files.gyp +36 -0
- data/ext/gyp/test/win/compiler-flags/function-level-linking.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/function-level-linking.gyp +28 -0
- data/ext/gyp/test/win/compiler-flags/hello.cc +7 -0
- data/ext/gyp/test/win/compiler-flags/optimizations.gyp +207 -0
- data/ext/gyp/test/win/compiler-flags/pdbname-override.gyp +26 -0
- data/ext/gyp/test/win/compiler-flags/pdbname.cc +7 -0
- data/ext/gyp/test/win/compiler-flags/pdbname.gyp +24 -0
- data/ext/gyp/test/win/compiler-flags/precomp.cc +6 -0
- data/ext/gyp/test/win/compiler-flags/rtti-on.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/rtti.gyp +37 -0
- data/ext/gyp/test/win/compiler-flags/runtime-checks.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/runtime-checks.gyp +29 -0
- data/ext/gyp/test/win/compiler-flags/runtime-library-md.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/runtime-library-mdd.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/runtime-library-mt.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/runtime-library-mtd.cc +19 -0
- data/ext/gyp/test/win/compiler-flags/runtime-library.gyp +48 -0
- data/ext/gyp/test/win/compiler-flags/subdir/header.h +0 -0
- data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp +33 -0
- data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/uninit.cc +13 -0
- data/ext/gyp/test/win/compiler-flags/warning-as-error.cc +9 -0
- data/ext/gyp/test/win/compiler-flags/warning-as-error.gyp +37 -0
- data/ext/gyp/test/win/compiler-flags/warning-level.gyp +115 -0
- data/ext/gyp/test/win/compiler-flags/warning-level1.cc +8 -0
- data/ext/gyp/test/win/compiler-flags/warning-level2.cc +14 -0
- data/ext/gyp/test/win/compiler-flags/warning-level3.cc +11 -0
- data/ext/gyp/test/win/compiler-flags/warning-level4.cc +10 -0
- data/ext/gyp/test/win/enable-winrt/dllmain.cc +30 -0
- data/ext/gyp/test/win/enable-winrt/enable-winrt.gyp +39 -0
- data/ext/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py +44 -0
- data/ext/gyp/test/win/generator-output-different-drive/prog.c +10 -0
- data/ext/gyp/test/win/generator-output-different-drive/prog.gyp +15 -0
- data/ext/gyp/test/win/gyptest-asm-files.py +26 -0
- data/ext/gyp/test/win/gyptest-cl-additional-include-dirs.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-additional-options.py +28 -0
- data/ext/gyp/test/win/gyptest-cl-analysis.py +30 -0
- data/ext/gyp/test/win/gyptest-cl-buffer-security-check.py +53 -0
- data/ext/gyp/test/win/gyptest-cl-calling-convention.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-character-set.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-compile-as-managed.py +24 -0
- data/ext/gyp/test/win/gyptest-cl-compile-as-winrt.py +20 -0
- data/ext/gyp/test/win/gyptest-cl-debug-format.py +43 -0
- data/ext/gyp/test/win/gyptest-cl-default-char-is-unsigned.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-disable-specific-warnings.py +32 -0
- data/ext/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py +49 -0
- data/ext/gyp/test/win/gyptest-cl-exception-handling.py +33 -0
- data/ext/gyp/test/win/gyptest-cl-floating-point-model.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-force-include-files.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-function-level-linking.py +54 -0
- data/ext/gyp/test/win/gyptest-cl-optimizations.py +105 -0
- data/ext/gyp/test/win/gyptest-cl-pdbname-override.py +27 -0
- data/ext/gyp/test/win/gyptest-cl-pdbname.py +30 -0
- data/ext/gyp/test/win/gyptest-cl-rtti.py +30 -0
- data/ext/gyp/test/win/gyptest-cl-runtime-checks.py +30 -0
- data/ext/gyp/test/win/gyptest-cl-runtime-library.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py +22 -0
- data/ext/gyp/test/win/gyptest-cl-warning-as-error.py +30 -0
- data/ext/gyp/test/win/gyptest-cl-warning-level.py +41 -0
- data/ext/gyp/test/win/gyptest-command-quote.py +42 -0
- data/ext/gyp/test/win/gyptest-crosscompile-ar.py +29 -0
- data/ext/gyp/test/win/gyptest-lib-ltcg.py +22 -0
- data/ext/gyp/test/win/gyptest-link-additional-deps.py +22 -0
- data/ext/gyp/test/win/gyptest-link-additional-options.py +22 -0
- data/ext/gyp/test/win/gyptest-link-aslr.py +35 -0
- data/ext/gyp/test/win/gyptest-link-base-address.py +62 -0
- data/ext/gyp/test/win/gyptest-link-debug-info.py +26 -0
- data/ext/gyp/test/win/gyptest-link-default-libs.py +22 -0
- data/ext/gyp/test/win/gyptest-link-deffile.py +43 -0
- data/ext/gyp/test/win/gyptest-link-defrelink.py +56 -0
- data/ext/gyp/test/win/gyptest-link-delay-load-dlls.py +35 -0
- data/ext/gyp/test/win/gyptest-link-embed-manifest.py +100 -0
- data/ext/gyp/test/win/gyptest-link-enable-uac.py +104 -0
- data/ext/gyp/test/win/gyptest-link-enable-winrt-app-revision.py +43 -0
- data/ext/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py +47 -0
- data/ext/gyp/test/win/gyptest-link-enable-winrt.py +37 -0
- data/ext/gyp/test/win/gyptest-link-entrypointsymbol.py +24 -0
- data/ext/gyp/test/win/gyptest-link-fixed-base.py +40 -0
- data/ext/gyp/test/win/gyptest-link-force-symbol-reference.py +26 -0
- data/ext/gyp/test/win/gyptest-link-generate-manifest.py +127 -0
- data/ext/gyp/test/win/gyptest-link-incremental.py +37 -0
- data/ext/gyp/test/win/gyptest-link-large-address-aware.py +35 -0
- data/ext/gyp/test/win/gyptest-link-large-pdb.py +76 -0
- data/ext/gyp/test/win/gyptest-link-library-adjust.py +21 -0
- data/ext/gyp/test/win/gyptest-link-library-directories.py +35 -0
- data/ext/gyp/test/win/gyptest-link-ltcg.py +44 -0
- data/ext/gyp/test/win/gyptest-link-mapfile.py +44 -0
- data/ext/gyp/test/win/gyptest-link-nodefaultlib.py +24 -0
- data/ext/gyp/test/win/gyptest-link-noimportlib.py +30 -0
- data/ext/gyp/test/win/gyptest-link-nxcompat.py +37 -0
- data/ext/gyp/test/win/gyptest-link-opt-icf.py +41 -0
- data/ext/gyp/test/win/gyptest-link-opt-ref.py +40 -0
- data/ext/gyp/test/win/gyptest-link-ordering.py +103 -0
- data/ext/gyp/test/win/gyptest-link-outputfile.py +28 -0
- data/ext/gyp/test/win/gyptest-link-pdb-no-output.py +25 -0
- data/ext/gyp/test/win/gyptest-link-pdb-output.py +33 -0
- data/ext/gyp/test/win/gyptest-link-pdb.py +35 -0
- data/ext/gyp/test/win/gyptest-link-pgo.py +75 -0
- data/ext/gyp/test/win/gyptest-link-profile.py +37 -0
- data/ext/gyp/test/win/gyptest-link-restat-importlib.py +47 -0
- data/ext/gyp/test/win/gyptest-link-safeseh.py +46 -0
- data/ext/gyp/test/win/gyptest-link-shard.py +30 -0
- data/ext/gyp/test/win/gyptest-link-stacksize.py +62 -0
- data/ext/gyp/test/win/gyptest-link-subsystem.py +38 -0
- data/ext/gyp/test/win/gyptest-link-target-machine.py +28 -0
- data/ext/gyp/test/win/gyptest-link-tsaware.py +33 -0
- data/ext/gyp/test/win/gyptest-link-uldi-depending-on-module.py +24 -0
- data/ext/gyp/test/win/gyptest-link-uldi.py +28 -0
- data/ext/gyp/test/win/gyptest-link-unsupported-manifest.py +27 -0
- data/ext/gyp/test/win/gyptest-link-update-manifest.py +104 -0
- data/ext/gyp/test/win/gyptest-link-warnings-as-errors.py +24 -0
- data/ext/gyp/test/win/gyptest-long-command-line.py +23 -0
- data/ext/gyp/test/win/gyptest-macro-projectname.py +24 -0
- data/ext/gyp/test/win/gyptest-macro-targetext.py +26 -0
- data/ext/gyp/test/win/gyptest-macro-targetfilename.py +37 -0
- data/ext/gyp/test/win/gyptest-macro-targetname.py +29 -0
- data/ext/gyp/test/win/gyptest-macro-targetpath.py +30 -0
- data/ext/gyp/test/win/gyptest-macro-vcinstalldir.py +24 -0
- data/ext/gyp/test/win/gyptest-macros-containing-gyp.py +21 -0
- data/ext/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py +27 -0
- data/ext/gyp/test/win/gyptest-midl-excluded.py +22 -0
- data/ext/gyp/test/win/gyptest-midl-includedirs.py +21 -0
- data/ext/gyp/test/win/gyptest-midl-rules.py +28 -0
- data/ext/gyp/test/win/gyptest-ml-safeseh.py +22 -0
- data/ext/gyp/test/win/gyptest-quoting-commands.py +25 -0
- data/ext/gyp/test/win/gyptest-rc-build.py +29 -0
- data/ext/gyp/test/win/gyptest-sys.py +27 -0
- data/ext/gyp/test/win/gyptest-system-include.py +21 -0
- data/ext/gyp/test/win/idl-excluded/bad.idl +6 -0
- data/ext/gyp/test/win/idl-excluded/copy-file.py +11 -0
- data/ext/gyp/test/win/idl-excluded/idl-excluded.gyp +58 -0
- data/ext/gyp/test/win/idl-excluded/program.cc +7 -0
- data/ext/gyp/test/win/idl-includedirs/hello.cc +7 -0
- data/ext/gyp/test/win/idl-includedirs/idl-includedirs.gyp +26 -0
- data/ext/gyp/test/win/idl-includedirs/subdir/bar.idl +13 -0
- data/ext/gyp/test/win/idl-includedirs/subdir/foo.idl +14 -0
- data/ext/gyp/test/win/idl-rules/Window.idl +9 -0
- data/ext/gyp/test/win/idl-rules/basic-idl.gyp +67 -0
- data/ext/gyp/test/win/idl-rules/history_indexer.idl +17 -0
- data/ext/gyp/test/win/idl-rules/history_indexer_user.cc +15 -0
- data/ext/gyp/test/win/idl-rules/idl_compiler.py +17 -0
- data/ext/gyp/test/win/importlib/dll_no_exports.cc +9 -0
- data/ext/gyp/test/win/importlib/has-exports.cc +10 -0
- data/ext/gyp/test/win/importlib/hello.cc +9 -0
- data/ext/gyp/test/win/importlib/importlib.gyp +30 -0
- data/ext/gyp/test/win/importlib/noimplib.gyp +16 -0
- data/ext/gyp/test/win/large-pdb/dllmain.cc +9 -0
- data/ext/gyp/test/win/large-pdb/large-pdb.gyp +98 -0
- data/ext/gyp/test/win/large-pdb/main.cc +7 -0
- data/ext/gyp/test/win/lib-crosscompile/answer.cc +9 -0
- data/ext/gyp/test/win/lib-crosscompile/answer.h +5 -0
- data/ext/gyp/test/win/lib-crosscompile/use_host_ar.gyp +17 -0
- data/ext/gyp/test/win/lib-flags/answer.cc +9 -0
- data/ext/gyp/test/win/lib-flags/answer.h +5 -0
- data/ext/gyp/test/win/lib-flags/ltcg.gyp +21 -0
- data/ext/gyp/test/win/linker-flags/a/x.cc +7 -0
- data/ext/gyp/test/win/linker-flags/a/z.cc +7 -0
- data/ext/gyp/test/win/linker-flags/additional-deps.cc +10 -0
- data/ext/gyp/test/win/linker-flags/additional-deps.gyp +30 -0
- data/ext/gyp/test/win/linker-flags/additional-options.gyp +29 -0
- data/ext/gyp/test/win/linker-flags/aslr.gyp +35 -0
- data/ext/gyp/test/win/linker-flags/b/y.cc +7 -0
- data/ext/gyp/test/win/linker-flags/base-address.gyp +38 -0
- data/ext/gyp/test/win/linker-flags/debug-info.gyp +28 -0
- data/ext/gyp/test/win/linker-flags/deffile-multiple.gyp +17 -0
- data/ext/gyp/test/win/linker-flags/deffile.cc +13 -0
- data/ext/gyp/test/win/linker-flags/deffile.def +8 -0
- data/ext/gyp/test/win/linker-flags/deffile.gyp +38 -0
- data/ext/gyp/test/win/linker-flags/delay-load-dlls.gyp +35 -0
- data/ext/gyp/test/win/linker-flags/delay-load.cc +10 -0
- data/ext/gyp/test/win/linker-flags/embed-manifest.gyp +109 -0
- data/ext/gyp/test/win/linker-flags/enable-uac.gyp +45 -0
- data/ext/gyp/test/win/linker-flags/entrypointsymbol.cc +13 -0
- data/ext/gyp/test/win/linker-flags/entrypointsymbol.gyp +28 -0
- data/ext/gyp/test/win/linker-flags/extra.manifest +11 -0
- data/ext/gyp/test/win/linker-flags/extra2.manifest +11 -0
- data/ext/gyp/test/win/linker-flags/fixed-base.gyp +52 -0
- data/ext/gyp/test/win/linker-flags/force-symbol-reference.gyp +39 -0
- data/ext/gyp/test/win/linker-flags/generate-manifest.gyp +166 -0
- data/ext/gyp/test/win/linker-flags/hello.cc +7 -0
- data/ext/gyp/test/win/linker-flags/incremental.gyp +65 -0
- data/ext/gyp/test/win/linker-flags/inline_test.cc +12 -0
- data/ext/gyp/test/win/linker-flags/inline_test.h +5 -0
- data/ext/gyp/test/win/linker-flags/inline_test_main.cc +15 -0
- data/ext/gyp/test/win/linker-flags/large-address-aware.gyp +28 -0
- data/ext/gyp/test/win/linker-flags/library-adjust.cc +10 -0
- data/ext/gyp/test/win/linker-flags/library-adjust.gyp +16 -0
- data/ext/gyp/test/win/linker-flags/library-directories-define.cc +7 -0
- data/ext/gyp/test/win/linker-flags/library-directories-reference.cc +10 -0
- data/ext/gyp/test/win/linker-flags/library-directories.gyp +42 -0
- data/ext/gyp/test/win/linker-flags/link-ordering.gyp +95 -0
- data/ext/gyp/test/win/linker-flags/link-warning.cc +10 -0
- data/ext/gyp/test/win/linker-flags/ltcg.gyp +42 -0
- data/ext/gyp/test/win/linker-flags/main-crt.c +8 -0
- data/ext/gyp/test/win/linker-flags/manifest-in-comment.cc +13 -0
- data/ext/gyp/test/win/linker-flags/mapfile.cc +12 -0
- data/ext/gyp/test/win/linker-flags/mapfile.gyp +45 -0
- data/ext/gyp/test/win/linker-flags/no-default-libs.cc +18 -0
- data/ext/gyp/test/win/linker-flags/no-default-libs.gyp +13 -0
- data/ext/gyp/test/win/linker-flags/nodefaultlib.cc +13 -0
- data/ext/gyp/test/win/linker-flags/nodefaultlib.gyp +30 -0
- data/ext/gyp/test/win/linker-flags/nxcompat.gyp +35 -0
- data/ext/gyp/test/win/linker-flags/opt-icf.cc +29 -0
- data/ext/gyp/test/win/linker-flags/opt-icf.gyp +63 -0
- data/ext/gyp/test/win/linker-flags/opt-ref.cc +11 -0
- data/ext/gyp/test/win/linker-flags/opt-ref.gyp +56 -0
- data/ext/gyp/test/win/linker-flags/outputfile.gyp +58 -0
- data/ext/gyp/test/win/linker-flags/pdb-output.gyp +49 -0
- data/ext/gyp/test/win/linker-flags/pgo.gyp +143 -0
- data/ext/gyp/test/win/linker-flags/profile.gyp +50 -0
- data/ext/gyp/test/win/linker-flags/program-database.gyp +40 -0
- data/ext/gyp/test/win/linker-flags/safeseh.gyp +79 -0
- data/ext/gyp/test/win/linker-flags/safeseh_hello.cc +11 -0
- data/ext/gyp/test/win/linker-flags/safeseh_zero.asm +10 -0
- data/ext/gyp/test/win/linker-flags/safeseh_zero64.asm +9 -0
- data/ext/gyp/test/win/linker-flags/stacksize.gyp +44 -0
- data/ext/gyp/test/win/linker-flags/subdir/library.gyp +13 -0
- data/ext/gyp/test/win/linker-flags/subsystem-windows.cc +9 -0
- data/ext/gyp/test/win/linker-flags/subsystem.gyp +70 -0
- data/ext/gyp/test/win/linker-flags/target-machine.gyp +48 -0
- data/ext/gyp/test/win/linker-flags/tsaware.gyp +28 -0
- data/ext/gyp/test/win/linker-flags/unsupported-manifest.gyp +13 -0
- data/ext/gyp/test/win/linker-flags/update_pgd.py +35 -0
- data/ext/gyp/test/win/linker-flags/warn-as-error.gyp +33 -0
- data/ext/gyp/test/win/linker-flags/x.cc +7 -0
- data/ext/gyp/test/win/linker-flags/y.cc +7 -0
- data/ext/gyp/test/win/linker-flags/z.cc +7 -0
- data/ext/gyp/test/win/long-command-line/function.cc +7 -0
- data/ext/gyp/test/win/long-command-line/hello.cc +7 -0
- data/ext/gyp/test/win/long-command-line/long-command-line.gyp +54 -0
- data/ext/gyp/test/win/ml-safeseh/a.asm +10 -0
- data/ext/gyp/test/win/ml-safeseh/hello.cc +11 -0
- data/ext/gyp/test/win/ml-safeseh/ml-safeseh.gyp +24 -0
- data/ext/gyp/test/win/precompiled/gyptest-all.py +21 -0
- data/ext/gyp/test/win/precompiled/hello.c +14 -0
- data/ext/gyp/test/win/precompiled/hello.gyp +28 -0
- data/ext/gyp/test/win/precompiled/hello2.c +13 -0
- data/ext/gyp/test/win/precompiled/precomp.c +8 -0
- data/ext/gyp/test/win/rc-build/Resource.h +26 -0
- data/ext/gyp/test/win/rc-build/hello.cpp +30 -0
- data/ext/gyp/test/win/rc-build/hello.gyp +92 -0
- data/ext/gyp/test/win/rc-build/hello.h +3 -0
- data/ext/gyp/test/win/rc-build/hello.ico +0 -0
- data/ext/gyp/test/win/rc-build/hello.rc +86 -0
- data/ext/gyp/test/win/rc-build/hello3.rc +87 -0
- data/ext/gyp/test/win/rc-build/small.ico +0 -0
- data/ext/gyp/test/win/rc-build/subdir/hello2.rc +87 -0
- data/ext/gyp/test/win/rc-build/subdir/include.h +1 -0
- data/ext/gyp/test/win/rc-build/targetver.h +24 -0
- data/ext/gyp/test/win/shard/hello.cc +7 -0
- data/ext/gyp/test/win/shard/hello1.cc +7 -0
- data/ext/gyp/test/win/shard/hello2.cc +7 -0
- data/ext/gyp/test/win/shard/hello3.cc +7 -0
- data/ext/gyp/test/win/shard/hello4.cc +7 -0
- data/ext/gyp/test/win/shard/shard.gyp +31 -0
- data/ext/gyp/test/win/shard/shard_ref.gyp +41 -0
- data/ext/gyp/test/win/system-include/bar/header.h +0 -0
- data/ext/gyp/test/win/system-include/common/commonheader.h +0 -0
- data/ext/gyp/test/win/system-include/foo/header.h +0 -0
- data/ext/gyp/test/win/system-include/main.cc +4 -0
- data/ext/gyp/test/win/system-include/test.gyp +26 -0
- data/ext/gyp/test/win/uldi/a.cc +7 -0
- data/ext/gyp/test/win/uldi/b.cc +7 -0
- data/ext/gyp/test/win/uldi/dll.cc +6 -0
- data/ext/gyp/test/win/uldi/exe.cc +7 -0
- data/ext/gyp/test/win/uldi/main.cc +10 -0
- data/ext/gyp/test/win/uldi/uldi-depending-on-module.gyp +42 -0
- data/ext/gyp/test/win/uldi/uldi.gyp +45 -0
- data/ext/gyp/test/win/vs-macros/as.py +20 -0
- data/ext/gyp/test/win/vs-macros/containing-gyp.gyp +39 -0
- data/ext/gyp/test/win/vs-macros/do_stuff.py +8 -0
- data/ext/gyp/test/win/vs-macros/hello.cc +7 -0
- data/ext/gyp/test/win/vs-macros/input-output-macros.gyp +32 -0
- data/ext/gyp/test/win/vs-macros/input.S +0 -0
- data/ext/gyp/test/win/vs-macros/projectname.gyp +29 -0
- data/ext/gyp/test/win/vs-macros/stuff.blah +1 -0
- data/ext/gyp/test/win/vs-macros/targetext.gyp +59 -0
- data/ext/gyp/test/win/vs-macros/targetfilename.gyp +59 -0
- data/ext/gyp/test/win/vs-macros/targetname.gyp +52 -0
- data/ext/gyp/test/win/vs-macros/targetpath.gyp +59 -0
- data/ext/gyp/test/win/vs-macros/test_exists.py +10 -0
- data/ext/gyp/test/win/vs-macros/vcinstalldir.gyp +41 -0
- data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.c +10 -0
- data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp +32 -0
- data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.h +13 -0
- data/ext/gyp/test/win/win-driver-target-type/win-driver-target-type.rc +14 -0
- data/ext/gyp/test/win/win-tool/copies_readonly_files.gyp +29 -0
- data/ext/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py +55 -0
- data/ext/gyp/test/win/winrt-app-type-revision/dllmain.cc +30 -0
- data/ext/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp +43 -0
- data/ext/gyp/test/win/winrt-target-platform-version/dllmain.cc +30 -0
- data/ext/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp +49 -0
- data/ext/gyp/test/xcode-ninja/list_excluded/gyptest-all.py +49 -0
- data/ext/gyp/test/xcode-ninja/list_excluded/hello.cpp +7 -0
- data/ext/gyp/test/xcode-ninja/list_excluded/hello_exclude.gyp +19 -0
- data/ext/gyp/test/xcode-ninja/list_excluded/hello_excluded.cpp +7 -0
- data/ext/gyp/tools/README +15 -0
- data/ext/gyp/tools/Xcode/README +5 -0
- data/ext/gyp/tools/Xcode/Specifications/gyp.pbfilespec +27 -0
- data/ext/gyp/tools/Xcode/Specifications/gyp.xclangspec +226 -0
- data/ext/gyp/tools/emacs/README +12 -0
- data/ext/gyp/tools/emacs/gyp-tests.el +63 -0
- data/ext/gyp/tools/emacs/gyp.el +275 -0
- data/ext/gyp/tools/emacs/run-unit-tests.sh +7 -0
- data/ext/gyp/tools/emacs/testdata/media.gyp +1105 -0
- data/ext/gyp/tools/emacs/testdata/media.gyp.fontified +1107 -0
- data/ext/gyp/tools/graphviz.py +102 -0
- data/ext/gyp/tools/pretty_gyp.py +156 -0
- data/ext/gyp/tools/pretty_sln.py +171 -0
- data/ext/gyp/tools/pretty_vcproj.py +337 -0
- data/ext/libuv/.gitattributes +1 -0
- data/ext/libuv/.github/ISSUE_TEMPLATE.md +13 -0
- data/ext/libuv/.github/stale.yml +22 -0
- data/ext/libuv/.gitignore +80 -0
- data/ext/libuv/.mailmap +50 -0
- data/ext/libuv/AUTHORS +415 -0
- data/ext/libuv/CMakeLists.txt +430 -0
- data/ext/libuv/CONTRIBUTING.md +172 -0
- data/ext/libuv/ChangeLog +4548 -0
- data/ext/libuv/LICENSE +70 -0
- data/ext/libuv/LICENSE-docs +396 -0
- data/ext/libuv/MAINTAINERS.md +48 -0
- data/ext/libuv/Makefile.am +548 -0
- data/ext/libuv/README.md +431 -0
- data/ext/libuv/SUPPORTED_PLATFORMS.md +68 -0
- data/ext/libuv/android-configure-arm +23 -0
- data/ext/libuv/android-configure-arm64 +23 -0
- data/ext/libuv/android-configure-x86 +23 -0
- data/ext/libuv/android-configure-x86_64 +25 -0
- data/ext/libuv/appveyor.yml +32 -0
- data/ext/libuv/autogen.sh +46 -0
- data/ext/libuv/common.gypi +213 -0
- data/ext/libuv/configure.ac +82 -0
- data/ext/libuv/docs/Makefile +183 -0
- data/ext/libuv/docs/code/cgi/main.c +81 -0
- data/ext/libuv/docs/code/cgi/tick.c +13 -0
- data/ext/libuv/docs/code/detach/main.c +31 -0
- data/ext/libuv/docs/code/dns/main.c +80 -0
- data/ext/libuv/docs/code/helloworld/main.c +15 -0
- data/ext/libuv/docs/code/idle-basic/main.c +24 -0
- data/ext/libuv/docs/code/idle-compute/main.c +43 -0
- data/ext/libuv/docs/code/interfaces/main.c +33 -0
- data/ext/libuv/docs/code/locks/main.c +57 -0
- data/ext/libuv/docs/code/multi-echo-server/hammer.js +20 -0
- data/ext/libuv/docs/code/multi-echo-server/main.c +114 -0
- data/ext/libuv/docs/code/multi-echo-server/worker.c +88 -0
- data/ext/libuv/docs/code/onchange/main.c +44 -0
- data/ext/libuv/docs/code/pipe-echo-server/main.c +94 -0
- data/ext/libuv/docs/code/plugin/hello.c +5 -0
- data/ext/libuv/docs/code/plugin/main.c +39 -0
- data/ext/libuv/docs/code/plugin/plugin.h +7 -0
- data/ext/libuv/docs/code/proc-streams/main.c +49 -0
- data/ext/libuv/docs/code/proc-streams/test.c +8 -0
- data/ext/libuv/docs/code/progress/main.c +47 -0
- data/ext/libuv/docs/code/queue-cancel/main.c +59 -0
- data/ext/libuv/docs/code/queue-work/main.c +44 -0
- data/ext/libuv/docs/code/ref-timer/main.c +29 -0
- data/ext/libuv/docs/code/signal/main.c +66 -0
- data/ext/libuv/docs/code/spawn/main.c +36 -0
- data/ext/libuv/docs/code/tcp-echo-server/main.c +87 -0
- data/ext/libuv/docs/code/thread-create/main.c +36 -0
- data/ext/libuv/docs/code/tty/main.c +29 -0
- data/ext/libuv/docs/code/tty-gravity/main.c +48 -0
- data/ext/libuv/docs/code/udp-dhcp/main.c +127 -0
- data/ext/libuv/docs/code/uvcat/main.c +63 -0
- data/ext/libuv/docs/code/uvstop/main.c +33 -0
- data/ext/libuv/docs/code/uvtee/main.c +80 -0
- data/ext/libuv/docs/code/uvwget/main.c +166 -0
- data/ext/libuv/docs/make.bat +243 -0
- data/ext/libuv/docs/src/api.rst +35 -0
- data/ext/libuv/docs/src/async.rst +65 -0
- data/ext/libuv/docs/src/check.rst +46 -0
- data/ext/libuv/docs/src/conf.py +348 -0
- data/ext/libuv/docs/src/design.rst +140 -0
- data/ext/libuv/docs/src/dll.rst +44 -0
- data/ext/libuv/docs/src/dns.rst +108 -0
- data/ext/libuv/docs/src/errors.rst +365 -0
- data/ext/libuv/docs/src/fs.rst +689 -0
- data/ext/libuv/docs/src/fs_event.rst +132 -0
- data/ext/libuv/docs/src/fs_poll.rst +77 -0
- data/ext/libuv/docs/src/guide/about.rst +22 -0
- data/ext/libuv/docs/src/guide/basics.rst +219 -0
- data/ext/libuv/docs/src/guide/eventloops.rst +48 -0
- data/ext/libuv/docs/src/guide/filesystem.rst +330 -0
- data/ext/libuv/docs/src/guide/introduction.rst +75 -0
- data/ext/libuv/docs/src/guide/networking.rst +250 -0
- data/ext/libuv/docs/src/guide/processes.rst +406 -0
- data/ext/libuv/docs/src/guide/threads.rst +385 -0
- data/ext/libuv/docs/src/guide/utilities.rst +437 -0
- data/ext/libuv/docs/src/guide.rst +22 -0
- data/ext/libuv/docs/src/handle.rst +283 -0
- data/ext/libuv/docs/src/idle.rst +54 -0
- data/ext/libuv/docs/src/index.rst +62 -0
- data/ext/libuv/docs/src/loop.rst +238 -0
- data/ext/libuv/docs/src/migration_010_100.rst +244 -0
- data/ext/libuv/docs/src/misc.rst +702 -0
- data/ext/libuv/docs/src/pipe.rst +116 -0
- data/ext/libuv/docs/src/poll.rst +121 -0
- data/ext/libuv/docs/src/prepare.rst +46 -0
- data/ext/libuv/docs/src/process.rst +250 -0
- data/ext/libuv/docs/src/request.rst +116 -0
- data/ext/libuv/docs/src/signal.rst +101 -0
- data/ext/libuv/docs/src/sphinx-plugins/manpage.py +45 -0
- data/ext/libuv/docs/src/static/architecture.png +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/Data/st0-311.jpg +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/Data/st1-475.jpg +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/Index.zip +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/Metadata/BuildVersionHistory.plist +8 -0
- data/ext/libuv/docs/src/static/diagrams.key/Metadata/DocumentIdentifier +1 -0
- data/ext/libuv/docs/src/static/diagrams.key/Metadata/Properties.plist +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/preview-micro.jpg +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/preview-web.jpg +0 -0
- data/ext/libuv/docs/src/static/diagrams.key/preview.jpg +0 -0
- data/ext/libuv/docs/src/static/favicon.ico +0 -0
- data/ext/libuv/docs/src/static/logo.png +0 -0
- data/ext/libuv/docs/src/static/loop_iteration.png +0 -0
- data/ext/libuv/docs/src/stream.rst +237 -0
- data/ext/libuv/docs/src/tcp.rst +125 -0
- data/ext/libuv/docs/src/threading.rst +197 -0
- data/ext/libuv/docs/src/threadpool.rst +69 -0
- data/ext/libuv/docs/src/timer.rst +81 -0
- data/ext/libuv/docs/src/tty.rst +139 -0
- data/ext/libuv/docs/src/udp.rst +390 -0
- data/ext/libuv/docs/src/upgrading.rst +11 -0
- data/ext/libuv/docs/src/version.rst +60 -0
- data/ext/libuv/gyp_uv.py +73 -0
- data/ext/libuv/img/banner.png +0 -0
- data/ext/libuv/img/logos.svg +152 -0
- data/ext/libuv/include/uv/aix.h +32 -0
- data/ext/libuv/include/uv/android-ifaddrs.h +54 -0
- data/ext/libuv/include/uv/bsd.h +34 -0
- data/ext/libuv/include/uv/darwin.h +61 -0
- data/ext/libuv/include/uv/errno.h +448 -0
- data/ext/libuv/include/uv/linux.h +34 -0
- data/ext/libuv/include/uv/os390.h +33 -0
- data/ext/libuv/include/uv/posix.h +31 -0
- data/ext/libuv/include/uv/stdint-msvc2008.h +247 -0
- data/ext/libuv/include/uv/sunos.h +44 -0
- data/ext/libuv/include/uv/threadpool.h +37 -0
- data/ext/libuv/include/uv/tree.h +768 -0
- data/ext/libuv/include/uv/unix.h +505 -0
- data/ext/libuv/include/uv/version.h +43 -0
- data/ext/libuv/include/uv/win.h +691 -0
- data/ext/libuv/include/uv.h +1782 -0
- data/ext/libuv/libuv.pc.in +12 -0
- data/ext/libuv/m4/.gitignore +4 -0
- data/ext/libuv/m4/as_case.m4 +21 -0
- data/ext/libuv/m4/libuv-check-flags.m4 +319 -0
- data/ext/libuv/src/fs-poll.c +287 -0
- data/ext/libuv/src/heap-inl.h +245 -0
- data/ext/libuv/src/idna.c +291 -0
- data/ext/libuv/src/idna.h +31 -0
- data/ext/libuv/src/inet.c +302 -0
- data/ext/libuv/src/queue.h +108 -0
- data/ext/libuv/src/random.c +123 -0
- data/ext/libuv/src/strscpy.c +17 -0
- data/ext/libuv/src/strscpy.h +18 -0
- data/ext/libuv/src/threadpool.c +388 -0
- data/ext/libuv/src/timer.c +181 -0
- data/ext/libuv/src/unix/aix-common.c +337 -0
- data/ext/libuv/src/unix/aix.c +1066 -0
- data/ext/libuv/src/unix/android-ifaddrs.c +712 -0
- data/ext/libuv/src/unix/async.c +298 -0
- data/ext/libuv/src/unix/atomic-ops.h +59 -0
- data/ext/libuv/src/unix/bsd-ifaddrs.c +161 -0
- data/ext/libuv/src/unix/bsd-proctitle.c +93 -0
- data/ext/libuv/src/unix/core.c +1571 -0
- data/ext/libuv/src/unix/cygwin.c +53 -0
- data/ext/libuv/src/unix/darwin-proctitle.c +202 -0
- data/ext/libuv/src/unix/darwin.c +225 -0
- data/ext/libuv/src/unix/dl.c +80 -0
- data/ext/libuv/src/unix/freebsd.c +290 -0
- data/ext/libuv/src/unix/fs.c +2044 -0
- data/ext/libuv/src/unix/fsevents.c +924 -0
- data/ext/libuv/src/unix/getaddrinfo.c +255 -0
- data/ext/libuv/src/unix/getnameinfo.c +121 -0
- data/ext/libuv/src/unix/haiku.c +167 -0
- data/ext/libuv/src/unix/ibmi.c +249 -0
- data/ext/libuv/src/unix/internal.h +331 -0
- data/ext/libuv/src/unix/kqueue.c +544 -0
- data/ext/libuv/src/unix/linux-core.c +1091 -0
- data/ext/libuv/src/unix/linux-inotify.c +354 -0
- data/ext/libuv/src/unix/linux-syscalls.c +394 -0
- data/ext/libuv/src/unix/linux-syscalls.h +153 -0
- data/ext/libuv/src/unix/loop-watcher.c +68 -0
- data/ext/libuv/src/unix/loop.c +194 -0
- data/ext/libuv/src/unix/netbsd.c +259 -0
- data/ext/libuv/src/unix/no-fsevents.c +42 -0
- data/ext/libuv/src/unix/no-proctitle.c +42 -0
- data/ext/libuv/src/unix/openbsd.c +244 -0
- data/ext/libuv/src/unix/os390-syscalls.c +519 -0
- data/ext/libuv/src/unix/os390-syscalls.h +68 -0
- data/ext/libuv/src/unix/os390.c +1003 -0
- data/ext/libuv/src/unix/pipe.c +377 -0
- data/ext/libuv/src/unix/poll.c +150 -0
- data/ext/libuv/src/unix/posix-hrtime.c +35 -0
- data/ext/libuv/src/unix/posix-poll.c +336 -0
- data/ext/libuv/src/unix/process.c +603 -0
- data/ext/libuv/src/unix/procfs-exepath.c +45 -0
- data/ext/libuv/src/unix/proctitle.c +132 -0
- data/ext/libuv/src/unix/pthread-fixes.c +56 -0
- data/ext/libuv/src/unix/random-devurandom.c +93 -0
- data/ext/libuv/src/unix/random-getentropy.c +57 -0
- data/ext/libuv/src/unix/random-getrandom.c +88 -0
- data/ext/libuv/src/unix/random-sysctl-linux.c +99 -0
- data/ext/libuv/src/unix/signal.c +577 -0
- data/ext/libuv/src/unix/spinlock.h +53 -0
- data/ext/libuv/src/unix/stream.c +1697 -0
- data/ext/libuv/src/unix/sunos.c +836 -0
- data/ext/libuv/src/unix/sysinfo-loadavg.c +36 -0
- data/ext/libuv/src/unix/sysinfo-memory.c +42 -0
- data/ext/libuv/src/unix/tcp.c +450 -0
- data/ext/libuv/src/unix/thread.c +852 -0
- data/ext/libuv/src/unix/tty.c +381 -0
- data/ext/libuv/src/unix/udp.c +1136 -0
- data/ext/libuv/src/uv-common.c +812 -0
- data/ext/libuv/src/uv-common.h +326 -0
- data/ext/libuv/src/uv-data-getter-setters.c +98 -0
- data/ext/libuv/src/version.c +45 -0
- data/ext/libuv/src/win/async.c +98 -0
- data/ext/libuv/src/win/atomicops-inl.h +57 -0
- data/ext/libuv/src/win/core.c +657 -0
- data/ext/libuv/src/win/detect-wakeup.c +35 -0
- data/ext/libuv/src/win/dl.c +136 -0
- data/ext/libuv/src/win/error.c +172 -0
- data/ext/libuv/src/win/fs-event.c +589 -0
- data/ext/libuv/src/win/fs-fd-hash-inl.h +178 -0
- data/ext/libuv/src/win/fs.c +3238 -0
- data/ext/libuv/src/win/getaddrinfo.c +463 -0
- data/ext/libuv/src/win/getnameinfo.c +157 -0
- data/ext/libuv/src/win/handle-inl.h +180 -0
- data/ext/libuv/src/win/handle.c +162 -0
- data/ext/libuv/src/win/internal.h +344 -0
- data/ext/libuv/src/win/loop-watcher.c +122 -0
- data/ext/libuv/src/win/pipe.c +2386 -0
- data/ext/libuv/src/win/poll.c +643 -0
- data/ext/libuv/src/win/process-stdio.c +512 -0
- data/ext/libuv/src/win/process.c +1282 -0
- data/ext/libuv/src/win/req-inl.h +221 -0
- data/ext/libuv/src/win/signal.c +277 -0
- data/ext/libuv/src/win/snprintf.c +42 -0
- data/ext/libuv/src/win/stream-inl.h +54 -0
- data/ext/libuv/src/win/stream.c +243 -0
- data/ext/libuv/src/win/tcp.c +1520 -0
- data/ext/libuv/src/win/thread.c +520 -0
- data/ext/libuv/src/win/tty.c +2348 -0
- data/ext/libuv/src/win/udp.c +1185 -0
- data/ext/libuv/src/win/util.c +1879 -0
- data/ext/libuv/src/win/winapi.c +149 -0
- data/ext/libuv/src/win/winapi.h +4751 -0
- data/ext/libuv/src/win/winsock.c +575 -0
- data/ext/libuv/src/win/winsock.h +201 -0
- data/ext/libuv/test/benchmark-async-pummel.c +119 -0
- data/ext/libuv/test/benchmark-async.c +141 -0
- data/ext/libuv/test/benchmark-fs-stat.c +136 -0
- data/ext/libuv/test/benchmark-getaddrinfo.c +92 -0
- data/ext/libuv/test/benchmark-list.h +163 -0
- data/ext/libuv/test/benchmark-loop-count.c +92 -0
- data/ext/libuv/test/benchmark-million-async.c +112 -0
- data/ext/libuv/test/benchmark-million-timers.c +86 -0
- data/ext/libuv/test/benchmark-multi-accept.c +447 -0
- data/ext/libuv/test/benchmark-ping-pongs.c +221 -0
- data/ext/libuv/test/benchmark-pound.c +351 -0
- data/ext/libuv/test/benchmark-pump.c +476 -0
- data/ext/libuv/test/benchmark-sizes.c +46 -0
- data/ext/libuv/test/benchmark-spawn.c +164 -0
- data/ext/libuv/test/benchmark-tcp-write-batch.c +144 -0
- data/ext/libuv/test/benchmark-thread.c +64 -0
- data/ext/libuv/test/benchmark-udp-pummel.c +243 -0
- data/ext/libuv/test/blackhole-server.c +121 -0
- data/ext/libuv/test/dns-server.c +340 -0
- data/ext/libuv/test/echo-server.c +382 -0
- data/ext/libuv/test/fixtures/empty_file +0 -0
- data/ext/libuv/test/fixtures/load_error.node +1 -0
- data/ext/libuv/test/fixtures/lorem_ipsum.txt +1 -0
- data/ext/libuv/test/run-benchmarks.c +65 -0
- data/ext/libuv/test/run-tests.c +239 -0
- data/ext/libuv/test/runner-unix.c +450 -0
- data/ext/libuv/test/runner-unix.h +36 -0
- data/ext/libuv/test/runner-win.c +357 -0
- data/ext/libuv/test/runner-win.h +41 -0
- data/ext/libuv/test/runner.c +431 -0
- data/ext/libuv/test/runner.h +176 -0
- data/ext/libuv/test/task.h +238 -0
- data/ext/libuv/test/test-active.c +84 -0
- data/ext/libuv/test/test-async-null-cb.c +64 -0
- data/ext/libuv/test/test-async.c +134 -0
- data/ext/libuv/test/test-barrier.c +148 -0
- data/ext/libuv/test/test-callback-order.c +77 -0
- data/ext/libuv/test/test-callback-stack.c +204 -0
- data/ext/libuv/test/test-close-fd.c +80 -0
- data/ext/libuv/test/test-close-order.c +80 -0
- data/ext/libuv/test/test-condvar.c +267 -0
- data/ext/libuv/test/test-connect-unspecified.c +63 -0
- data/ext/libuv/test/test-connection-fail.c +151 -0
- data/ext/libuv/test/test-cwd-and-chdir.c +58 -0
- data/ext/libuv/test/test-default-loop-close.c +59 -0
- data/ext/libuv/test/test-delayed-accept.c +189 -0
- data/ext/libuv/test/test-dlerror.c +61 -0
- data/ext/libuv/test/test-eintr-handling.c +94 -0
- data/ext/libuv/test/test-embed.c +139 -0
- data/ext/libuv/test/test-emfile.c +121 -0
- data/ext/libuv/test/test-env-vars.c +140 -0
- data/ext/libuv/test/test-error.c +79 -0
- data/ext/libuv/test/test-fail-always.c +29 -0
- data/ext/libuv/test/test-fork.c +683 -0
- data/ext/libuv/test/test-fs-copyfile.c +209 -0
- data/ext/libuv/test/test-fs-event.c +1165 -0
- data/ext/libuv/test/test-fs-fd-hash.c +133 -0
- data/ext/libuv/test/test-fs-open-flags.c +435 -0
- data/ext/libuv/test/test-fs-poll.c +300 -0
- data/ext/libuv/test/test-fs-readdir.c +462 -0
- data/ext/libuv/test/test-fs.c +4238 -0
- data/ext/libuv/test/test-get-currentexe.c +86 -0
- data/ext/libuv/test/test-get-loadavg.c +35 -0
- data/ext/libuv/test/test-get-memory.c +40 -0
- data/ext/libuv/test/test-get-passwd.c +86 -0
- data/ext/libuv/test/test-getaddrinfo.c +191 -0
- data/ext/libuv/test/test-gethostname.c +58 -0
- data/ext/libuv/test/test-getnameinfo.c +101 -0
- data/ext/libuv/test/test-getsockname.c +361 -0
- data/ext/libuv/test/test-getters-setters.c +88 -0
- data/ext/libuv/test/test-gettimeofday.c +39 -0
- data/ext/libuv/test/test-handle-fileno.c +125 -0
- data/ext/libuv/test/test-homedir.c +72 -0
- data/ext/libuv/test/test-hrtime.c +52 -0
- data/ext/libuv/test/test-idle.c +99 -0
- data/ext/libuv/test/test-idna.c +195 -0
- data/ext/libuv/test/test-ip4-addr.c +55 -0
- data/ext/libuv/test/test-ip6-addr.c +171 -0
- data/ext/libuv/test/test-ipc-heavy-traffic-deadlock-bug.c +159 -0
- data/ext/libuv/test/test-ipc-send-recv.c +429 -0
- data/ext/libuv/test/test-ipc.c +974 -0
- data/ext/libuv/test/test-list.h +1064 -0
- data/ext/libuv/test/test-loop-alive.c +67 -0
- data/ext/libuv/test/test-loop-close.c +75 -0
- data/ext/libuv/test/test-loop-configure.c +38 -0
- data/ext/libuv/test/test-loop-handles.c +337 -0
- data/ext/libuv/test/test-loop-stop.c +71 -0
- data/ext/libuv/test/test-loop-time.c +63 -0
- data/ext/libuv/test/test-multiple-listen.c +109 -0
- data/ext/libuv/test/test-mutexes.c +182 -0
- data/ext/libuv/test/test-osx-select.c +140 -0
- data/ext/libuv/test/test-pass-always.c +28 -0
- data/ext/libuv/test/test-ping-pong.c +301 -0
- data/ext/libuv/test/test-pipe-bind-error.c +139 -0
- data/ext/libuv/test/test-pipe-close-stdout-read-stdin.c +112 -0
- data/ext/libuv/test/test-pipe-connect-error.c +95 -0
- data/ext/libuv/test/test-pipe-connect-multiple.c +107 -0
- data/ext/libuv/test/test-pipe-connect-prepare.c +83 -0
- data/ext/libuv/test/test-pipe-getsockname.c +266 -0
- data/ext/libuv/test/test-pipe-pending-instances.c +59 -0
- data/ext/libuv/test/test-pipe-sendmsg.c +172 -0
- data/ext/libuv/test/test-pipe-server-close.c +94 -0
- data/ext/libuv/test/test-pipe-set-fchmod.c +90 -0
- data/ext/libuv/test/test-pipe-set-non-blocking.c +99 -0
- data/ext/libuv/test/test-platform-output.c +170 -0
- data/ext/libuv/test/test-poll-close-doesnt-corrupt-stack.c +114 -0
- data/ext/libuv/test/test-poll-close.c +73 -0
- data/ext/libuv/test/test-poll-closesocket.c +92 -0
- data/ext/libuv/test/test-poll-oob.c +210 -0
- data/ext/libuv/test/test-poll.c +668 -0
- data/ext/libuv/test/test-process-priority.c +83 -0
- data/ext/libuv/test/test-process-title-threadsafe.c +89 -0
- data/ext/libuv/test/test-process-title.c +76 -0
- data/ext/libuv/test/test-queue-foreach-delete.c +204 -0
- data/ext/libuv/test/test-random.c +94 -0
- data/ext/libuv/test/test-ref.c +445 -0
- data/ext/libuv/test/test-run-nowait.c +45 -0
- data/ext/libuv/test/test-run-once.c +48 -0
- data/ext/libuv/test/test-semaphore.c +111 -0
- data/ext/libuv/test/test-shutdown-close.c +108 -0
- data/ext/libuv/test/test-shutdown-eof.c +182 -0
- data/ext/libuv/test/test-shutdown-twice.c +85 -0
- data/ext/libuv/test/test-signal-multiple-loops.c +302 -0
- data/ext/libuv/test/test-signal-pending-on-close.c +94 -0
- data/ext/libuv/test/test-signal.c +325 -0
- data/ext/libuv/test/test-socket-buffer-size.c +77 -0
- data/ext/libuv/test/test-spawn.c +1924 -0
- data/ext/libuv/test/test-stdio-over-pipes.c +256 -0
- data/ext/libuv/test/test-strscpy.c +53 -0
- data/ext/libuv/test/test-tcp-alloc-cb-fail.c +123 -0
- data/ext/libuv/test/test-tcp-bind-error.c +254 -0
- data/ext/libuv/test/test-tcp-bind6-error.c +176 -0
- data/ext/libuv/test/test-tcp-close-accept.c +198 -0
- data/ext/libuv/test/test-tcp-close-reset.c +290 -0
- data/ext/libuv/test/test-tcp-close-while-connecting.c +97 -0
- data/ext/libuv/test/test-tcp-close.c +136 -0
- data/ext/libuv/test/test-tcp-connect-error-after-write.c +98 -0
- data/ext/libuv/test/test-tcp-connect-error.c +73 -0
- data/ext/libuv/test/test-tcp-connect-timeout.c +91 -0
- data/ext/libuv/test/test-tcp-connect6-error.c +71 -0
- data/ext/libuv/test/test-tcp-create-socket-early.c +209 -0
- data/ext/libuv/test/test-tcp-flags.c +52 -0
- data/ext/libuv/test/test-tcp-oob.c +146 -0
- data/ext/libuv/test/test-tcp-open.c +400 -0
- data/ext/libuv/test/test-tcp-read-stop.c +76 -0
- data/ext/libuv/test/test-tcp-shutdown-after-write.c +138 -0
- data/ext/libuv/test/test-tcp-try-write-error.c +109 -0
- data/ext/libuv/test/test-tcp-try-write.c +135 -0
- data/ext/libuv/test/test-tcp-unexpected-read.c +117 -0
- data/ext/libuv/test/test-tcp-write-after-connect.c +72 -0
- data/ext/libuv/test/test-tcp-write-fail.c +115 -0
- data/ext/libuv/test/test-tcp-write-queue-order.c +139 -0
- data/ext/libuv/test/test-tcp-write-to-half-open-connection.c +141 -0
- data/ext/libuv/test/test-tcp-writealot.c +180 -0
- data/ext/libuv/test/test-thread-equal.c +45 -0
- data/ext/libuv/test/test-thread.c +286 -0
- data/ext/libuv/test/test-threadpool-cancel.c +349 -0
- data/ext/libuv/test/test-threadpool.c +76 -0
- data/ext/libuv/test/test-timer-again.c +141 -0
- data/ext/libuv/test/test-timer-from-check.c +80 -0
- data/ext/libuv/test/test-timer.c +343 -0
- data/ext/libuv/test/test-tmpdir.c +82 -0
- data/ext/libuv/test/test-tty-duplicate-key.c +321 -0
- data/ext/libuv/test/test-tty.c +464 -0
- data/ext/libuv/test/test-udp-alloc-cb-fail.c +196 -0
- data/ext/libuv/test/test-udp-bind.c +93 -0
- data/ext/libuv/test/test-udp-connect.c +182 -0
- data/ext/libuv/test/test-udp-create-socket-early.c +135 -0
- data/ext/libuv/test/test-udp-dgram-too-big.c +91 -0
- data/ext/libuv/test/test-udp-ipv6.c +200 -0
- data/ext/libuv/test/test-udp-multicast-interface.c +99 -0
- data/ext/libuv/test/test-udp-multicast-interface6.c +103 -0
- data/ext/libuv/test/test-udp-multicast-join.c +181 -0
- data/ext/libuv/test/test-udp-multicast-join6.c +215 -0
- data/ext/libuv/test/test-udp-multicast-ttl.c +94 -0
- data/ext/libuv/test/test-udp-open.c +350 -0
- data/ext/libuv/test/test-udp-options.c +156 -0
- data/ext/libuv/test/test-udp-send-and-recv.c +212 -0
- data/ext/libuv/test/test-udp-send-hang-loop.c +99 -0
- data/ext/libuv/test/test-udp-send-immediate.c +148 -0
- data/ext/libuv/test/test-udp-send-unreachable.c +150 -0
- data/ext/libuv/test/test-udp-try-send.c +121 -0
- data/ext/libuv/test/test-uname.c +69 -0
- data/ext/libuv/test/test-walk-handles.c +77 -0
- data/ext/libuv/test/test-watcher-cross-stop.c +111 -0
- data/ext/libuv/test/test.gyp +293 -0
- data/ext/libuv/tools/make_dist_html.py +124 -0
- data/ext/libuv/tools/vswhere_usability_wrapper.cmd +33 -0
- data/ext/libuv/uv.gyp +368 -0
- data/ext/libuv/vcbuild.bat +184 -0
- data/lib/mt-libuv/version.rb +1 -1
- data/mt-libuv.gemspec +26 -26
- metadata +2088 -1
@@ -0,0 +1,1697 @@
|
|
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 "uv.h"
|
23
|
+
#include "internal.h"
|
24
|
+
|
25
|
+
#include <stdio.h>
|
26
|
+
#include <stdlib.h>
|
27
|
+
#include <string.h>
|
28
|
+
#include <assert.h>
|
29
|
+
#include <errno.h>
|
30
|
+
|
31
|
+
#include <sys/types.h>
|
32
|
+
#include <sys/socket.h>
|
33
|
+
#include <sys/uio.h>
|
34
|
+
#include <sys/un.h>
|
35
|
+
#include <unistd.h>
|
36
|
+
#include <limits.h> /* IOV_MAX */
|
37
|
+
|
38
|
+
#if defined(__APPLE__)
|
39
|
+
# include <sys/event.h>
|
40
|
+
# include <sys/time.h>
|
41
|
+
# include <sys/select.h>
|
42
|
+
|
43
|
+
/* Forward declaration */
|
44
|
+
typedef struct uv__stream_select_s uv__stream_select_t;
|
45
|
+
|
46
|
+
struct uv__stream_select_s {
|
47
|
+
uv_stream_t* stream;
|
48
|
+
uv_thread_t thread;
|
49
|
+
uv_sem_t close_sem;
|
50
|
+
uv_sem_t async_sem;
|
51
|
+
uv_async_t async;
|
52
|
+
int events;
|
53
|
+
int fake_fd;
|
54
|
+
int int_fd;
|
55
|
+
int fd;
|
56
|
+
fd_set* sread;
|
57
|
+
size_t sread_sz;
|
58
|
+
fd_set* swrite;
|
59
|
+
size_t swrite_sz;
|
60
|
+
};
|
61
|
+
|
62
|
+
/* Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
|
63
|
+
* EPROTOTYPE can be returned while trying to write to a socket that is
|
64
|
+
* shutting down. If we retry the write, we should get the expected EPIPE
|
65
|
+
* instead.
|
66
|
+
*/
|
67
|
+
# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR || errno == EPROTOTYPE)
|
68
|
+
# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \
|
69
|
+
(errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS || \
|
70
|
+
(errno == EMSGSIZE && send_handle != NULL))
|
71
|
+
#else
|
72
|
+
# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR)
|
73
|
+
# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \
|
74
|
+
(errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS)
|
75
|
+
#endif /* defined(__APPLE__) */
|
76
|
+
|
77
|
+
static void uv__stream_connect(uv_stream_t*);
|
78
|
+
static void uv__write(uv_stream_t* stream);
|
79
|
+
static void uv__read(uv_stream_t* stream);
|
80
|
+
static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events);
|
81
|
+
static void uv__write_callbacks(uv_stream_t* stream);
|
82
|
+
static size_t uv__write_req_size(uv_write_t* req);
|
83
|
+
|
84
|
+
|
85
|
+
void uv__stream_init(uv_loop_t* loop,
|
86
|
+
uv_stream_t* stream,
|
87
|
+
uv_handle_type type) {
|
88
|
+
int err;
|
89
|
+
|
90
|
+
uv__handle_init(loop, (uv_handle_t*)stream, type);
|
91
|
+
stream->read_cb = NULL;
|
92
|
+
stream->alloc_cb = NULL;
|
93
|
+
stream->close_cb = NULL;
|
94
|
+
stream->connection_cb = NULL;
|
95
|
+
stream->connect_req = NULL;
|
96
|
+
stream->shutdown_req = NULL;
|
97
|
+
stream->accepted_fd = -1;
|
98
|
+
stream->queued_fds = NULL;
|
99
|
+
stream->delayed_error = 0;
|
100
|
+
QUEUE_INIT(&stream->write_queue);
|
101
|
+
QUEUE_INIT(&stream->write_completed_queue);
|
102
|
+
stream->write_queue_size = 0;
|
103
|
+
|
104
|
+
if (loop->emfile_fd == -1) {
|
105
|
+
err = uv__open_cloexec("/dev/null", O_RDONLY);
|
106
|
+
if (err < 0)
|
107
|
+
/* In the rare case that "/dev/null" isn't mounted open "/"
|
108
|
+
* instead.
|
109
|
+
*/
|
110
|
+
err = uv__open_cloexec("/", O_RDONLY);
|
111
|
+
if (err >= 0)
|
112
|
+
loop->emfile_fd = err;
|
113
|
+
}
|
114
|
+
|
115
|
+
#if defined(__APPLE__)
|
116
|
+
stream->select = NULL;
|
117
|
+
#endif /* defined(__APPLE_) */
|
118
|
+
|
119
|
+
uv__io_init(&stream->io_watcher, uv__stream_io, -1);
|
120
|
+
}
|
121
|
+
|
122
|
+
|
123
|
+
static void uv__stream_osx_interrupt_select(uv_stream_t* stream) {
|
124
|
+
#if defined(__APPLE__)
|
125
|
+
/* Notify select() thread about state change */
|
126
|
+
uv__stream_select_t* s;
|
127
|
+
int r;
|
128
|
+
|
129
|
+
s = stream->select;
|
130
|
+
if (s == NULL)
|
131
|
+
return;
|
132
|
+
|
133
|
+
/* Interrupt select() loop
|
134
|
+
* NOTE: fake_fd and int_fd are socketpair(), thus writing to one will
|
135
|
+
* emit read event on other side
|
136
|
+
*/
|
137
|
+
do
|
138
|
+
r = write(s->fake_fd, "x", 1);
|
139
|
+
while (r == -1 && errno == EINTR);
|
140
|
+
|
141
|
+
assert(r == 1);
|
142
|
+
#else /* !defined(__APPLE__) */
|
143
|
+
/* No-op on any other platform */
|
144
|
+
#endif /* !defined(__APPLE__) */
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
#if defined(__APPLE__)
|
149
|
+
static void uv__stream_osx_select(void* arg) {
|
150
|
+
uv_stream_t* stream;
|
151
|
+
uv__stream_select_t* s;
|
152
|
+
char buf[1024];
|
153
|
+
int events;
|
154
|
+
int fd;
|
155
|
+
int r;
|
156
|
+
int max_fd;
|
157
|
+
|
158
|
+
stream = arg;
|
159
|
+
s = stream->select;
|
160
|
+
fd = s->fd;
|
161
|
+
|
162
|
+
if (fd > s->int_fd)
|
163
|
+
max_fd = fd;
|
164
|
+
else
|
165
|
+
max_fd = s->int_fd;
|
166
|
+
|
167
|
+
while (1) {
|
168
|
+
/* Terminate on semaphore */
|
169
|
+
if (uv_sem_trywait(&s->close_sem) == 0)
|
170
|
+
break;
|
171
|
+
|
172
|
+
/* Watch fd using select(2) */
|
173
|
+
memset(s->sread, 0, s->sread_sz);
|
174
|
+
memset(s->swrite, 0, s->swrite_sz);
|
175
|
+
|
176
|
+
if (uv__io_active(&stream->io_watcher, POLLIN))
|
177
|
+
FD_SET(fd, s->sread);
|
178
|
+
if (uv__io_active(&stream->io_watcher, POLLOUT))
|
179
|
+
FD_SET(fd, s->swrite);
|
180
|
+
FD_SET(s->int_fd, s->sread);
|
181
|
+
|
182
|
+
/* Wait indefinitely for fd events */
|
183
|
+
r = select(max_fd + 1, s->sread, s->swrite, NULL, NULL);
|
184
|
+
if (r == -1) {
|
185
|
+
if (errno == EINTR)
|
186
|
+
continue;
|
187
|
+
|
188
|
+
/* XXX: Possible?! */
|
189
|
+
abort();
|
190
|
+
}
|
191
|
+
|
192
|
+
/* Ignore timeouts */
|
193
|
+
if (r == 0)
|
194
|
+
continue;
|
195
|
+
|
196
|
+
/* Empty socketpair's buffer in case of interruption */
|
197
|
+
if (FD_ISSET(s->int_fd, s->sread))
|
198
|
+
while (1) {
|
199
|
+
r = read(s->int_fd, buf, sizeof(buf));
|
200
|
+
|
201
|
+
if (r == sizeof(buf))
|
202
|
+
continue;
|
203
|
+
|
204
|
+
if (r != -1)
|
205
|
+
break;
|
206
|
+
|
207
|
+
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
208
|
+
break;
|
209
|
+
|
210
|
+
if (errno == EINTR)
|
211
|
+
continue;
|
212
|
+
|
213
|
+
abort();
|
214
|
+
}
|
215
|
+
|
216
|
+
/* Handle events */
|
217
|
+
events = 0;
|
218
|
+
if (FD_ISSET(fd, s->sread))
|
219
|
+
events |= POLLIN;
|
220
|
+
if (FD_ISSET(fd, s->swrite))
|
221
|
+
events |= POLLOUT;
|
222
|
+
|
223
|
+
assert(events != 0 || FD_ISSET(s->int_fd, s->sread));
|
224
|
+
if (events != 0) {
|
225
|
+
ACCESS_ONCE(int, s->events) = events;
|
226
|
+
|
227
|
+
uv_async_send(&s->async);
|
228
|
+
uv_sem_wait(&s->async_sem);
|
229
|
+
|
230
|
+
/* Should be processed at this stage */
|
231
|
+
assert((s->events == 0) || (stream->flags & UV_HANDLE_CLOSING));
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
|
237
|
+
static void uv__stream_osx_select_cb(uv_async_t* handle) {
|
238
|
+
uv__stream_select_t* s;
|
239
|
+
uv_stream_t* stream;
|
240
|
+
int events;
|
241
|
+
|
242
|
+
s = container_of(handle, uv__stream_select_t, async);
|
243
|
+
stream = s->stream;
|
244
|
+
|
245
|
+
/* Get and reset stream's events */
|
246
|
+
events = s->events;
|
247
|
+
ACCESS_ONCE(int, s->events) = 0;
|
248
|
+
|
249
|
+
assert(events != 0);
|
250
|
+
assert(events == (events & (POLLIN | POLLOUT)));
|
251
|
+
|
252
|
+
/* Invoke callback on event-loop */
|
253
|
+
if ((events & POLLIN) && uv__io_active(&stream->io_watcher, POLLIN))
|
254
|
+
uv__stream_io(stream->loop, &stream->io_watcher, POLLIN);
|
255
|
+
|
256
|
+
if ((events & POLLOUT) && uv__io_active(&stream->io_watcher, POLLOUT))
|
257
|
+
uv__stream_io(stream->loop, &stream->io_watcher, POLLOUT);
|
258
|
+
|
259
|
+
if (stream->flags & UV_HANDLE_CLOSING)
|
260
|
+
return;
|
261
|
+
|
262
|
+
/* NOTE: It is important to do it here, otherwise `select()` might be called
|
263
|
+
* before the actual `uv__read()`, leading to the blocking syscall
|
264
|
+
*/
|
265
|
+
uv_sem_post(&s->async_sem);
|
266
|
+
}
|
267
|
+
|
268
|
+
|
269
|
+
static void uv__stream_osx_cb_close(uv_handle_t* async) {
|
270
|
+
uv__stream_select_t* s;
|
271
|
+
|
272
|
+
s = container_of(async, uv__stream_select_t, async);
|
273
|
+
uv__free(s);
|
274
|
+
}
|
275
|
+
|
276
|
+
|
277
|
+
int uv__stream_try_select(uv_stream_t* stream, int* fd) {
|
278
|
+
/*
|
279
|
+
* kqueue doesn't work with some files from /dev mount on osx.
|
280
|
+
* select(2) in separate thread for those fds
|
281
|
+
*/
|
282
|
+
|
283
|
+
struct kevent filter[1];
|
284
|
+
struct kevent events[1];
|
285
|
+
struct timespec timeout;
|
286
|
+
uv__stream_select_t* s;
|
287
|
+
int fds[2];
|
288
|
+
int err;
|
289
|
+
int ret;
|
290
|
+
int kq;
|
291
|
+
int old_fd;
|
292
|
+
int max_fd;
|
293
|
+
size_t sread_sz;
|
294
|
+
size_t swrite_sz;
|
295
|
+
|
296
|
+
kq = kqueue();
|
297
|
+
if (kq == -1) {
|
298
|
+
perror("(libuv) kqueue()");
|
299
|
+
return UV__ERR(errno);
|
300
|
+
}
|
301
|
+
|
302
|
+
EV_SET(&filter[0], *fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0);
|
303
|
+
|
304
|
+
/* Use small timeout, because we only want to capture EINVALs */
|
305
|
+
timeout.tv_sec = 0;
|
306
|
+
timeout.tv_nsec = 1;
|
307
|
+
|
308
|
+
do
|
309
|
+
ret = kevent(kq, filter, 1, events, 1, &timeout);
|
310
|
+
while (ret == -1 && errno == EINTR);
|
311
|
+
|
312
|
+
uv__close(kq);
|
313
|
+
|
314
|
+
if (ret == -1)
|
315
|
+
return UV__ERR(errno);
|
316
|
+
|
317
|
+
if (ret == 0 || (events[0].flags & EV_ERROR) == 0 || events[0].data != EINVAL)
|
318
|
+
return 0;
|
319
|
+
|
320
|
+
/* At this point we definitely know that this fd won't work with kqueue */
|
321
|
+
|
322
|
+
/*
|
323
|
+
* Create fds for io watcher and to interrupt the select() loop.
|
324
|
+
* NOTE: do it ahead of malloc below to allocate enough space for fd_sets
|
325
|
+
*/
|
326
|
+
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds))
|
327
|
+
return UV__ERR(errno);
|
328
|
+
|
329
|
+
max_fd = *fd;
|
330
|
+
if (fds[1] > max_fd)
|
331
|
+
max_fd = fds[1];
|
332
|
+
|
333
|
+
sread_sz = ROUND_UP(max_fd + 1, sizeof(uint32_t) * NBBY) / NBBY;
|
334
|
+
swrite_sz = sread_sz;
|
335
|
+
|
336
|
+
s = uv__malloc(sizeof(*s) + sread_sz + swrite_sz);
|
337
|
+
if (s == NULL) {
|
338
|
+
err = UV_ENOMEM;
|
339
|
+
goto failed_malloc;
|
340
|
+
}
|
341
|
+
|
342
|
+
s->events = 0;
|
343
|
+
s->fd = *fd;
|
344
|
+
s->sread = (fd_set*) ((char*) s + sizeof(*s));
|
345
|
+
s->sread_sz = sread_sz;
|
346
|
+
s->swrite = (fd_set*) ((char*) s->sread + sread_sz);
|
347
|
+
s->swrite_sz = swrite_sz;
|
348
|
+
|
349
|
+
err = uv_async_init(stream->loop, &s->async, uv__stream_osx_select_cb);
|
350
|
+
if (err)
|
351
|
+
goto failed_async_init;
|
352
|
+
|
353
|
+
s->async.flags |= UV_HANDLE_INTERNAL;
|
354
|
+
uv__handle_unref(&s->async);
|
355
|
+
|
356
|
+
err = uv_sem_init(&s->close_sem, 0);
|
357
|
+
if (err != 0)
|
358
|
+
goto failed_close_sem_init;
|
359
|
+
|
360
|
+
err = uv_sem_init(&s->async_sem, 0);
|
361
|
+
if (err != 0)
|
362
|
+
goto failed_async_sem_init;
|
363
|
+
|
364
|
+
s->fake_fd = fds[0];
|
365
|
+
s->int_fd = fds[1];
|
366
|
+
|
367
|
+
old_fd = *fd;
|
368
|
+
s->stream = stream;
|
369
|
+
stream->select = s;
|
370
|
+
*fd = s->fake_fd;
|
371
|
+
|
372
|
+
err = uv_thread_create(&s->thread, uv__stream_osx_select, stream);
|
373
|
+
if (err != 0)
|
374
|
+
goto failed_thread_create;
|
375
|
+
|
376
|
+
return 0;
|
377
|
+
|
378
|
+
failed_thread_create:
|
379
|
+
s->stream = NULL;
|
380
|
+
stream->select = NULL;
|
381
|
+
*fd = old_fd;
|
382
|
+
|
383
|
+
uv_sem_destroy(&s->async_sem);
|
384
|
+
|
385
|
+
failed_async_sem_init:
|
386
|
+
uv_sem_destroy(&s->close_sem);
|
387
|
+
|
388
|
+
failed_close_sem_init:
|
389
|
+
uv__close(fds[0]);
|
390
|
+
uv__close(fds[1]);
|
391
|
+
uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close);
|
392
|
+
return err;
|
393
|
+
|
394
|
+
failed_async_init:
|
395
|
+
uv__free(s);
|
396
|
+
|
397
|
+
failed_malloc:
|
398
|
+
uv__close(fds[0]);
|
399
|
+
uv__close(fds[1]);
|
400
|
+
|
401
|
+
return err;
|
402
|
+
}
|
403
|
+
#endif /* defined(__APPLE__) */
|
404
|
+
|
405
|
+
|
406
|
+
int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
|
407
|
+
#if defined(__APPLE__)
|
408
|
+
int enable;
|
409
|
+
#endif
|
410
|
+
|
411
|
+
if (!(stream->io_watcher.fd == -1 || stream->io_watcher.fd == fd))
|
412
|
+
return UV_EBUSY;
|
413
|
+
|
414
|
+
assert(fd >= 0);
|
415
|
+
stream->flags |= flags;
|
416
|
+
|
417
|
+
if (stream->type == UV_TCP) {
|
418
|
+
if ((stream->flags & UV_HANDLE_TCP_NODELAY) && uv__tcp_nodelay(fd, 1))
|
419
|
+
return UV__ERR(errno);
|
420
|
+
|
421
|
+
/* TODO Use delay the user passed in. */
|
422
|
+
if ((stream->flags & UV_HANDLE_TCP_KEEPALIVE) &&
|
423
|
+
uv__tcp_keepalive(fd, 1, 60)) {
|
424
|
+
return UV__ERR(errno);
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
428
|
+
#if defined(__APPLE__)
|
429
|
+
enable = 1;
|
430
|
+
if (setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &enable, sizeof(enable)) &&
|
431
|
+
errno != ENOTSOCK &&
|
432
|
+
errno != EINVAL) {
|
433
|
+
return UV__ERR(errno);
|
434
|
+
}
|
435
|
+
#endif
|
436
|
+
|
437
|
+
stream->io_watcher.fd = fd;
|
438
|
+
|
439
|
+
return 0;
|
440
|
+
}
|
441
|
+
|
442
|
+
|
443
|
+
void uv__stream_flush_write_queue(uv_stream_t* stream, int error) {
|
444
|
+
uv_write_t* req;
|
445
|
+
QUEUE* q;
|
446
|
+
while (!QUEUE_EMPTY(&stream->write_queue)) {
|
447
|
+
q = QUEUE_HEAD(&stream->write_queue);
|
448
|
+
QUEUE_REMOVE(q);
|
449
|
+
|
450
|
+
req = QUEUE_DATA(q, uv_write_t, queue);
|
451
|
+
req->error = error;
|
452
|
+
|
453
|
+
QUEUE_INSERT_TAIL(&stream->write_completed_queue, &req->queue);
|
454
|
+
}
|
455
|
+
}
|
456
|
+
|
457
|
+
|
458
|
+
void uv__stream_destroy(uv_stream_t* stream) {
|
459
|
+
assert(!uv__io_active(&stream->io_watcher, POLLIN | POLLOUT));
|
460
|
+
assert(stream->flags & UV_HANDLE_CLOSED);
|
461
|
+
|
462
|
+
if (stream->connect_req) {
|
463
|
+
uv__req_unregister(stream->loop, stream->connect_req);
|
464
|
+
stream->connect_req->cb(stream->connect_req, UV_ECANCELED);
|
465
|
+
stream->connect_req = NULL;
|
466
|
+
}
|
467
|
+
|
468
|
+
uv__stream_flush_write_queue(stream, UV_ECANCELED);
|
469
|
+
uv__write_callbacks(stream);
|
470
|
+
|
471
|
+
if (stream->shutdown_req) {
|
472
|
+
/* The ECANCELED error code is a lie, the shutdown(2) syscall is a
|
473
|
+
* fait accompli at this point. Maybe we should revisit this in v0.11.
|
474
|
+
* A possible reason for leaving it unchanged is that it informs the
|
475
|
+
* callee that the handle has been destroyed.
|
476
|
+
*/
|
477
|
+
uv__req_unregister(stream->loop, stream->shutdown_req);
|
478
|
+
stream->shutdown_req->cb(stream->shutdown_req, UV_ECANCELED);
|
479
|
+
stream->shutdown_req = NULL;
|
480
|
+
}
|
481
|
+
|
482
|
+
assert(stream->write_queue_size == 0);
|
483
|
+
}
|
484
|
+
|
485
|
+
|
486
|
+
/* Implements a best effort approach to mitigating accept() EMFILE errors.
|
487
|
+
* We have a spare file descriptor stashed away that we close to get below
|
488
|
+
* the EMFILE limit. Next, we accept all pending connections and close them
|
489
|
+
* immediately to signal the clients that we're overloaded - and we are, but
|
490
|
+
* we still keep on trucking.
|
491
|
+
*
|
492
|
+
* There is one caveat: it's not reliable in a multi-threaded environment.
|
493
|
+
* The file descriptor limit is per process. Our party trick fails if another
|
494
|
+
* thread opens a file or creates a socket in the time window between us
|
495
|
+
* calling close() and accept().
|
496
|
+
*/
|
497
|
+
static int uv__emfile_trick(uv_loop_t* loop, int accept_fd) {
|
498
|
+
int err;
|
499
|
+
int emfile_fd;
|
500
|
+
|
501
|
+
if (loop->emfile_fd == -1)
|
502
|
+
return UV_EMFILE;
|
503
|
+
|
504
|
+
uv__close(loop->emfile_fd);
|
505
|
+
loop->emfile_fd = -1;
|
506
|
+
|
507
|
+
do {
|
508
|
+
err = uv__accept(accept_fd);
|
509
|
+
if (err >= 0)
|
510
|
+
uv__close(err);
|
511
|
+
} while (err >= 0 || err == UV_EINTR);
|
512
|
+
|
513
|
+
emfile_fd = uv__open_cloexec("/", O_RDONLY);
|
514
|
+
if (emfile_fd >= 0)
|
515
|
+
loop->emfile_fd = emfile_fd;
|
516
|
+
|
517
|
+
return err;
|
518
|
+
}
|
519
|
+
|
520
|
+
|
521
|
+
#if defined(UV_HAVE_KQUEUE)
|
522
|
+
# define UV_DEC_BACKLOG(w) w->rcount--;
|
523
|
+
#else
|
524
|
+
# define UV_DEC_BACKLOG(w) /* no-op */
|
525
|
+
#endif /* defined(UV_HAVE_KQUEUE) */
|
526
|
+
|
527
|
+
|
528
|
+
void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
|
529
|
+
uv_stream_t* stream;
|
530
|
+
int err;
|
531
|
+
|
532
|
+
stream = container_of(w, uv_stream_t, io_watcher);
|
533
|
+
assert(events & POLLIN);
|
534
|
+
assert(stream->accepted_fd == -1);
|
535
|
+
assert(!(stream->flags & UV_HANDLE_CLOSING));
|
536
|
+
|
537
|
+
uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
|
538
|
+
|
539
|
+
/* connection_cb can close the server socket while we're
|
540
|
+
* in the loop so check it on each iteration.
|
541
|
+
*/
|
542
|
+
while (uv__stream_fd(stream) != -1) {
|
543
|
+
assert(stream->accepted_fd == -1);
|
544
|
+
|
545
|
+
#if defined(UV_HAVE_KQUEUE)
|
546
|
+
if (w->rcount <= 0)
|
547
|
+
return;
|
548
|
+
#endif /* defined(UV_HAVE_KQUEUE) */
|
549
|
+
|
550
|
+
err = uv__accept(uv__stream_fd(stream));
|
551
|
+
if (err < 0) {
|
552
|
+
if (err == UV_EAGAIN || err == UV__ERR(EWOULDBLOCK))
|
553
|
+
return; /* Not an error. */
|
554
|
+
|
555
|
+
if (err == UV_ECONNABORTED)
|
556
|
+
continue; /* Ignore. Nothing we can do about that. */
|
557
|
+
|
558
|
+
if (err == UV_EMFILE || err == UV_ENFILE) {
|
559
|
+
err = uv__emfile_trick(loop, uv__stream_fd(stream));
|
560
|
+
if (err == UV_EAGAIN || err == UV__ERR(EWOULDBLOCK))
|
561
|
+
break;
|
562
|
+
}
|
563
|
+
|
564
|
+
stream->connection_cb(stream, err);
|
565
|
+
continue;
|
566
|
+
}
|
567
|
+
|
568
|
+
UV_DEC_BACKLOG(w)
|
569
|
+
stream->accepted_fd = err;
|
570
|
+
stream->connection_cb(stream, 0);
|
571
|
+
|
572
|
+
if (stream->accepted_fd != -1) {
|
573
|
+
/* The user hasn't yet accepted called uv_accept() */
|
574
|
+
uv__io_stop(loop, &stream->io_watcher, POLLIN);
|
575
|
+
return;
|
576
|
+
}
|
577
|
+
|
578
|
+
if (stream->type == UV_TCP &&
|
579
|
+
(stream->flags & UV_HANDLE_TCP_SINGLE_ACCEPT)) {
|
580
|
+
/* Give other processes a chance to accept connections. */
|
581
|
+
struct timespec timeout = { 0, 1 };
|
582
|
+
nanosleep(&timeout, NULL);
|
583
|
+
}
|
584
|
+
}
|
585
|
+
}
|
586
|
+
|
587
|
+
|
588
|
+
#undef UV_DEC_BACKLOG
|
589
|
+
|
590
|
+
|
591
|
+
int uv_accept(uv_stream_t* server, uv_stream_t* client) {
|
592
|
+
int err;
|
593
|
+
|
594
|
+
assert(server->loop == client->loop);
|
595
|
+
|
596
|
+
if (server->accepted_fd == -1)
|
597
|
+
return UV_EAGAIN;
|
598
|
+
|
599
|
+
switch (client->type) {
|
600
|
+
case UV_NAMED_PIPE:
|
601
|
+
case UV_TCP:
|
602
|
+
err = uv__stream_open(client,
|
603
|
+
server->accepted_fd,
|
604
|
+
UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
|
605
|
+
if (err) {
|
606
|
+
/* TODO handle error */
|
607
|
+
uv__close(server->accepted_fd);
|
608
|
+
goto done;
|
609
|
+
}
|
610
|
+
break;
|
611
|
+
|
612
|
+
case UV_UDP:
|
613
|
+
err = uv_udp_open((uv_udp_t*) client, server->accepted_fd);
|
614
|
+
if (err) {
|
615
|
+
uv__close(server->accepted_fd);
|
616
|
+
goto done;
|
617
|
+
}
|
618
|
+
break;
|
619
|
+
|
620
|
+
default:
|
621
|
+
return UV_EINVAL;
|
622
|
+
}
|
623
|
+
|
624
|
+
client->flags |= UV_HANDLE_BOUND;
|
625
|
+
|
626
|
+
done:
|
627
|
+
/* Process queued fds */
|
628
|
+
if (server->queued_fds != NULL) {
|
629
|
+
uv__stream_queued_fds_t* queued_fds;
|
630
|
+
|
631
|
+
queued_fds = server->queued_fds;
|
632
|
+
|
633
|
+
/* Read first */
|
634
|
+
server->accepted_fd = queued_fds->fds[0];
|
635
|
+
|
636
|
+
/* All read, free */
|
637
|
+
assert(queued_fds->offset > 0);
|
638
|
+
if (--queued_fds->offset == 0) {
|
639
|
+
uv__free(queued_fds);
|
640
|
+
server->queued_fds = NULL;
|
641
|
+
} else {
|
642
|
+
/* Shift rest */
|
643
|
+
memmove(queued_fds->fds,
|
644
|
+
queued_fds->fds + 1,
|
645
|
+
queued_fds->offset * sizeof(*queued_fds->fds));
|
646
|
+
}
|
647
|
+
} else {
|
648
|
+
server->accepted_fd = -1;
|
649
|
+
if (err == 0)
|
650
|
+
uv__io_start(server->loop, &server->io_watcher, POLLIN);
|
651
|
+
}
|
652
|
+
return err;
|
653
|
+
}
|
654
|
+
|
655
|
+
|
656
|
+
int uv_listen(uv_stream_t* stream, int backlog, uv_connection_cb cb) {
|
657
|
+
int err;
|
658
|
+
|
659
|
+
switch (stream->type) {
|
660
|
+
case UV_TCP:
|
661
|
+
err = uv_tcp_listen((uv_tcp_t*)stream, backlog, cb);
|
662
|
+
break;
|
663
|
+
|
664
|
+
case UV_NAMED_PIPE:
|
665
|
+
err = uv_pipe_listen((uv_pipe_t*)stream, backlog, cb);
|
666
|
+
break;
|
667
|
+
|
668
|
+
default:
|
669
|
+
err = UV_EINVAL;
|
670
|
+
}
|
671
|
+
|
672
|
+
if (err == 0)
|
673
|
+
uv__handle_start(stream);
|
674
|
+
|
675
|
+
return err;
|
676
|
+
}
|
677
|
+
|
678
|
+
|
679
|
+
static void uv__drain(uv_stream_t* stream) {
|
680
|
+
uv_shutdown_t* req;
|
681
|
+
int err;
|
682
|
+
|
683
|
+
assert(QUEUE_EMPTY(&stream->write_queue));
|
684
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
|
685
|
+
uv__stream_osx_interrupt_select(stream);
|
686
|
+
|
687
|
+
/* Shutdown? */
|
688
|
+
if ((stream->flags & UV_HANDLE_SHUTTING) &&
|
689
|
+
!(stream->flags & UV_HANDLE_CLOSING) &&
|
690
|
+
!(stream->flags & UV_HANDLE_SHUT)) {
|
691
|
+
assert(stream->shutdown_req);
|
692
|
+
|
693
|
+
req = stream->shutdown_req;
|
694
|
+
stream->shutdown_req = NULL;
|
695
|
+
stream->flags &= ~UV_HANDLE_SHUTTING;
|
696
|
+
uv__req_unregister(stream->loop, req);
|
697
|
+
|
698
|
+
err = 0;
|
699
|
+
if (shutdown(uv__stream_fd(stream), SHUT_WR))
|
700
|
+
err = UV__ERR(errno);
|
701
|
+
|
702
|
+
if (err == 0)
|
703
|
+
stream->flags |= UV_HANDLE_SHUT;
|
704
|
+
|
705
|
+
if (req->cb != NULL)
|
706
|
+
req->cb(req, err);
|
707
|
+
}
|
708
|
+
}
|
709
|
+
|
710
|
+
|
711
|
+
static ssize_t uv__writev(int fd, struct iovec* vec, size_t n) {
|
712
|
+
if (n == 1)
|
713
|
+
return write(fd, vec->iov_base, vec->iov_len);
|
714
|
+
else
|
715
|
+
return writev(fd, vec, n);
|
716
|
+
}
|
717
|
+
|
718
|
+
|
719
|
+
static size_t uv__write_req_size(uv_write_t* req) {
|
720
|
+
size_t size;
|
721
|
+
|
722
|
+
assert(req->bufs != NULL);
|
723
|
+
size = uv__count_bufs(req->bufs + req->write_index,
|
724
|
+
req->nbufs - req->write_index);
|
725
|
+
assert(req->handle->write_queue_size >= size);
|
726
|
+
|
727
|
+
return size;
|
728
|
+
}
|
729
|
+
|
730
|
+
|
731
|
+
/* Returns 1 if all write request data has been written, or 0 if there is still
|
732
|
+
* more data to write.
|
733
|
+
*
|
734
|
+
* Note: the return value only says something about the *current* request.
|
735
|
+
* There may still be other write requests sitting in the queue.
|
736
|
+
*/
|
737
|
+
static int uv__write_req_update(uv_stream_t* stream,
|
738
|
+
uv_write_t* req,
|
739
|
+
size_t n) {
|
740
|
+
uv_buf_t* buf;
|
741
|
+
size_t len;
|
742
|
+
|
743
|
+
assert(n <= stream->write_queue_size);
|
744
|
+
stream->write_queue_size -= n;
|
745
|
+
|
746
|
+
buf = req->bufs + req->write_index;
|
747
|
+
|
748
|
+
do {
|
749
|
+
len = n < buf->len ? n : buf->len;
|
750
|
+
buf->base += len;
|
751
|
+
buf->len -= len;
|
752
|
+
buf += (buf->len == 0); /* Advance to next buffer if this one is empty. */
|
753
|
+
n -= len;
|
754
|
+
} while (n > 0);
|
755
|
+
|
756
|
+
req->write_index = buf - req->bufs;
|
757
|
+
|
758
|
+
return req->write_index == req->nbufs;
|
759
|
+
}
|
760
|
+
|
761
|
+
|
762
|
+
static void uv__write_req_finish(uv_write_t* req) {
|
763
|
+
uv_stream_t* stream = req->handle;
|
764
|
+
|
765
|
+
/* Pop the req off tcp->write_queue. */
|
766
|
+
QUEUE_REMOVE(&req->queue);
|
767
|
+
|
768
|
+
/* Only free when there was no error. On error, we touch up write_queue_size
|
769
|
+
* right before making the callback. The reason we don't do that right away
|
770
|
+
* is that a write_queue_size > 0 is our only way to signal to the user that
|
771
|
+
* they should stop writing - which they should if we got an error. Something
|
772
|
+
* to revisit in future revisions of the libuv API.
|
773
|
+
*/
|
774
|
+
if (req->error == 0) {
|
775
|
+
if (req->bufs != req->bufsml)
|
776
|
+
uv__free(req->bufs);
|
777
|
+
req->bufs = NULL;
|
778
|
+
}
|
779
|
+
|
780
|
+
/* Add it to the write_completed_queue where it will have its
|
781
|
+
* callback called in the near future.
|
782
|
+
*/
|
783
|
+
QUEUE_INSERT_TAIL(&stream->write_completed_queue, &req->queue);
|
784
|
+
uv__io_feed(stream->loop, &stream->io_watcher);
|
785
|
+
}
|
786
|
+
|
787
|
+
|
788
|
+
static int uv__handle_fd(uv_handle_t* handle) {
|
789
|
+
switch (handle->type) {
|
790
|
+
case UV_NAMED_PIPE:
|
791
|
+
case UV_TCP:
|
792
|
+
return ((uv_stream_t*) handle)->io_watcher.fd;
|
793
|
+
|
794
|
+
case UV_UDP:
|
795
|
+
return ((uv_udp_t*) handle)->io_watcher.fd;
|
796
|
+
|
797
|
+
default:
|
798
|
+
return -1;
|
799
|
+
}
|
800
|
+
}
|
801
|
+
|
802
|
+
static void uv__write(uv_stream_t* stream) {
|
803
|
+
struct iovec* iov;
|
804
|
+
QUEUE* q;
|
805
|
+
uv_write_t* req;
|
806
|
+
int iovmax;
|
807
|
+
int iovcnt;
|
808
|
+
ssize_t n;
|
809
|
+
int err;
|
810
|
+
|
811
|
+
start:
|
812
|
+
|
813
|
+
assert(uv__stream_fd(stream) >= 0);
|
814
|
+
|
815
|
+
if (QUEUE_EMPTY(&stream->write_queue))
|
816
|
+
return;
|
817
|
+
|
818
|
+
q = QUEUE_HEAD(&stream->write_queue);
|
819
|
+
req = QUEUE_DATA(q, uv_write_t, queue);
|
820
|
+
assert(req->handle == stream);
|
821
|
+
|
822
|
+
/*
|
823
|
+
* Cast to iovec. We had to have our own uv_buf_t instead of iovec
|
824
|
+
* because Windows's WSABUF is not an iovec.
|
825
|
+
*/
|
826
|
+
assert(sizeof(uv_buf_t) == sizeof(struct iovec));
|
827
|
+
iov = (struct iovec*) &(req->bufs[req->write_index]);
|
828
|
+
iovcnt = req->nbufs - req->write_index;
|
829
|
+
|
830
|
+
iovmax = uv__getiovmax();
|
831
|
+
|
832
|
+
/* Limit iov count to avoid EINVALs from writev() */
|
833
|
+
if (iovcnt > iovmax)
|
834
|
+
iovcnt = iovmax;
|
835
|
+
|
836
|
+
/*
|
837
|
+
* Now do the actual writev. Note that we've been updating the pointers
|
838
|
+
* inside the iov each time we write. So there is no need to offset it.
|
839
|
+
*/
|
840
|
+
|
841
|
+
if (req->send_handle) {
|
842
|
+
int fd_to_send;
|
843
|
+
struct msghdr msg;
|
844
|
+
struct cmsghdr *cmsg;
|
845
|
+
union {
|
846
|
+
char data[64];
|
847
|
+
struct cmsghdr alias;
|
848
|
+
} scratch;
|
849
|
+
|
850
|
+
if (uv__is_closing(req->send_handle)) {
|
851
|
+
err = UV_EBADF;
|
852
|
+
goto error;
|
853
|
+
}
|
854
|
+
|
855
|
+
fd_to_send = uv__handle_fd((uv_handle_t*) req->send_handle);
|
856
|
+
|
857
|
+
memset(&scratch, 0, sizeof(scratch));
|
858
|
+
|
859
|
+
assert(fd_to_send >= 0);
|
860
|
+
|
861
|
+
msg.msg_name = NULL;
|
862
|
+
msg.msg_namelen = 0;
|
863
|
+
msg.msg_iov = iov;
|
864
|
+
msg.msg_iovlen = iovcnt;
|
865
|
+
msg.msg_flags = 0;
|
866
|
+
|
867
|
+
msg.msg_control = &scratch.alias;
|
868
|
+
msg.msg_controllen = CMSG_SPACE(sizeof(fd_to_send));
|
869
|
+
|
870
|
+
cmsg = CMSG_FIRSTHDR(&msg);
|
871
|
+
cmsg->cmsg_level = SOL_SOCKET;
|
872
|
+
cmsg->cmsg_type = SCM_RIGHTS;
|
873
|
+
cmsg->cmsg_len = CMSG_LEN(sizeof(fd_to_send));
|
874
|
+
|
875
|
+
/* silence aliasing warning */
|
876
|
+
{
|
877
|
+
void* pv = CMSG_DATA(cmsg);
|
878
|
+
int* pi = pv;
|
879
|
+
*pi = fd_to_send;
|
880
|
+
}
|
881
|
+
|
882
|
+
do
|
883
|
+
n = sendmsg(uv__stream_fd(stream), &msg, 0);
|
884
|
+
while (n == -1 && RETRY_ON_WRITE_ERROR(errno));
|
885
|
+
|
886
|
+
/* Ensure the handle isn't sent again in case this is a partial write. */
|
887
|
+
if (n >= 0)
|
888
|
+
req->send_handle = NULL;
|
889
|
+
} else {
|
890
|
+
do
|
891
|
+
n = uv__writev(uv__stream_fd(stream), iov, iovcnt);
|
892
|
+
while (n == -1 && RETRY_ON_WRITE_ERROR(errno));
|
893
|
+
}
|
894
|
+
|
895
|
+
if (n == -1 && !IS_TRANSIENT_WRITE_ERROR(errno, req->send_handle)) {
|
896
|
+
err = UV__ERR(errno);
|
897
|
+
goto error;
|
898
|
+
}
|
899
|
+
|
900
|
+
if (n >= 0 && uv__write_req_update(stream, req, n)) {
|
901
|
+
uv__write_req_finish(req);
|
902
|
+
return; /* TODO(bnoordhuis) Start trying to write the next request. */
|
903
|
+
}
|
904
|
+
|
905
|
+
/* If this is a blocking stream, try again. */
|
906
|
+
if (stream->flags & UV_HANDLE_BLOCKING_WRITES)
|
907
|
+
goto start;
|
908
|
+
|
909
|
+
/* We're not done. */
|
910
|
+
uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
|
911
|
+
|
912
|
+
/* Notify select() thread about state change */
|
913
|
+
uv__stream_osx_interrupt_select(stream);
|
914
|
+
|
915
|
+
return;
|
916
|
+
|
917
|
+
error:
|
918
|
+
req->error = err;
|
919
|
+
uv__write_req_finish(req);
|
920
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
|
921
|
+
if (!uv__io_active(&stream->io_watcher, POLLIN))
|
922
|
+
uv__handle_stop(stream);
|
923
|
+
uv__stream_osx_interrupt_select(stream);
|
924
|
+
}
|
925
|
+
|
926
|
+
|
927
|
+
static void uv__write_callbacks(uv_stream_t* stream) {
|
928
|
+
uv_write_t* req;
|
929
|
+
QUEUE* q;
|
930
|
+
QUEUE pq;
|
931
|
+
|
932
|
+
if (QUEUE_EMPTY(&stream->write_completed_queue))
|
933
|
+
return;
|
934
|
+
|
935
|
+
QUEUE_MOVE(&stream->write_completed_queue, &pq);
|
936
|
+
|
937
|
+
while (!QUEUE_EMPTY(&pq)) {
|
938
|
+
/* Pop a req off write_completed_queue. */
|
939
|
+
q = QUEUE_HEAD(&pq);
|
940
|
+
req = QUEUE_DATA(q, uv_write_t, queue);
|
941
|
+
QUEUE_REMOVE(q);
|
942
|
+
uv__req_unregister(stream->loop, req);
|
943
|
+
|
944
|
+
if (req->bufs != NULL) {
|
945
|
+
stream->write_queue_size -= uv__write_req_size(req);
|
946
|
+
if (req->bufs != req->bufsml)
|
947
|
+
uv__free(req->bufs);
|
948
|
+
req->bufs = NULL;
|
949
|
+
}
|
950
|
+
|
951
|
+
/* NOTE: call callback AFTER freeing the request data. */
|
952
|
+
if (req->cb)
|
953
|
+
req->cb(req, req->error);
|
954
|
+
}
|
955
|
+
}
|
956
|
+
|
957
|
+
|
958
|
+
uv_handle_type uv__handle_type(int fd) {
|
959
|
+
struct sockaddr_storage ss;
|
960
|
+
socklen_t sslen;
|
961
|
+
socklen_t len;
|
962
|
+
int type;
|
963
|
+
|
964
|
+
memset(&ss, 0, sizeof(ss));
|
965
|
+
sslen = sizeof(ss);
|
966
|
+
|
967
|
+
if (getsockname(fd, (struct sockaddr*)&ss, &sslen))
|
968
|
+
return UV_UNKNOWN_HANDLE;
|
969
|
+
|
970
|
+
len = sizeof type;
|
971
|
+
|
972
|
+
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len))
|
973
|
+
return UV_UNKNOWN_HANDLE;
|
974
|
+
|
975
|
+
if (type == SOCK_STREAM) {
|
976
|
+
#if defined(_AIX) || defined(__DragonFly__)
|
977
|
+
/* on AIX/DragonFly the getsockname call returns an empty sa structure
|
978
|
+
* for sockets of type AF_UNIX. For all other types it will
|
979
|
+
* return a properly filled in structure.
|
980
|
+
*/
|
981
|
+
if (sslen == 0)
|
982
|
+
return UV_NAMED_PIPE;
|
983
|
+
#endif
|
984
|
+
switch (ss.ss_family) {
|
985
|
+
case AF_UNIX:
|
986
|
+
return UV_NAMED_PIPE;
|
987
|
+
case AF_INET:
|
988
|
+
case AF_INET6:
|
989
|
+
return UV_TCP;
|
990
|
+
}
|
991
|
+
}
|
992
|
+
|
993
|
+
if (type == SOCK_DGRAM &&
|
994
|
+
(ss.ss_family == AF_INET || ss.ss_family == AF_INET6))
|
995
|
+
return UV_UDP;
|
996
|
+
|
997
|
+
return UV_UNKNOWN_HANDLE;
|
998
|
+
}
|
999
|
+
|
1000
|
+
|
1001
|
+
static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) {
|
1002
|
+
stream->flags |= UV_HANDLE_READ_EOF;
|
1003
|
+
stream->flags &= ~UV_HANDLE_READING;
|
1004
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
|
1005
|
+
if (!uv__io_active(&stream->io_watcher, POLLOUT))
|
1006
|
+
uv__handle_stop(stream);
|
1007
|
+
uv__stream_osx_interrupt_select(stream);
|
1008
|
+
stream->read_cb(stream, UV_EOF, buf);
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
|
1012
|
+
static int uv__stream_queue_fd(uv_stream_t* stream, int fd) {
|
1013
|
+
uv__stream_queued_fds_t* queued_fds;
|
1014
|
+
unsigned int queue_size;
|
1015
|
+
|
1016
|
+
queued_fds = stream->queued_fds;
|
1017
|
+
if (queued_fds == NULL) {
|
1018
|
+
queue_size = 8;
|
1019
|
+
queued_fds = uv__malloc((queue_size - 1) * sizeof(*queued_fds->fds) +
|
1020
|
+
sizeof(*queued_fds));
|
1021
|
+
if (queued_fds == NULL)
|
1022
|
+
return UV_ENOMEM;
|
1023
|
+
queued_fds->size = queue_size;
|
1024
|
+
queued_fds->offset = 0;
|
1025
|
+
stream->queued_fds = queued_fds;
|
1026
|
+
|
1027
|
+
/* Grow */
|
1028
|
+
} else if (queued_fds->size == queued_fds->offset) {
|
1029
|
+
queue_size = queued_fds->size + 8;
|
1030
|
+
queued_fds = uv__realloc(queued_fds,
|
1031
|
+
(queue_size - 1) * sizeof(*queued_fds->fds) +
|
1032
|
+
sizeof(*queued_fds));
|
1033
|
+
|
1034
|
+
/*
|
1035
|
+
* Allocation failure, report back.
|
1036
|
+
* NOTE: if it is fatal - sockets will be closed in uv__stream_close
|
1037
|
+
*/
|
1038
|
+
if (queued_fds == NULL)
|
1039
|
+
return UV_ENOMEM;
|
1040
|
+
queued_fds->size = queue_size;
|
1041
|
+
stream->queued_fds = queued_fds;
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
/* Put fd in a queue */
|
1045
|
+
queued_fds->fds[queued_fds->offset++] = fd;
|
1046
|
+
|
1047
|
+
return 0;
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
|
1051
|
+
#if defined(__PASE__)
|
1052
|
+
/* on IBMi PASE the control message length can not exceed 256. */
|
1053
|
+
# define UV__CMSG_FD_COUNT 60
|
1054
|
+
#else
|
1055
|
+
# define UV__CMSG_FD_COUNT 64
|
1056
|
+
#endif
|
1057
|
+
#define UV__CMSG_FD_SIZE (UV__CMSG_FD_COUNT * sizeof(int))
|
1058
|
+
|
1059
|
+
|
1060
|
+
static int uv__stream_recv_cmsg(uv_stream_t* stream, struct msghdr* msg) {
|
1061
|
+
struct cmsghdr* cmsg;
|
1062
|
+
|
1063
|
+
for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; cmsg = CMSG_NXTHDR(msg, cmsg)) {
|
1064
|
+
char* start;
|
1065
|
+
char* end;
|
1066
|
+
int err;
|
1067
|
+
void* pv;
|
1068
|
+
int* pi;
|
1069
|
+
unsigned int i;
|
1070
|
+
unsigned int count;
|
1071
|
+
|
1072
|
+
if (cmsg->cmsg_type != SCM_RIGHTS) {
|
1073
|
+
fprintf(stderr, "ignoring non-SCM_RIGHTS ancillary data: %d\n",
|
1074
|
+
cmsg->cmsg_type);
|
1075
|
+
continue;
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
/* silence aliasing warning */
|
1079
|
+
pv = CMSG_DATA(cmsg);
|
1080
|
+
pi = pv;
|
1081
|
+
|
1082
|
+
/* Count available fds */
|
1083
|
+
start = (char*) cmsg;
|
1084
|
+
end = (char*) cmsg + cmsg->cmsg_len;
|
1085
|
+
count = 0;
|
1086
|
+
while (start + CMSG_LEN(count * sizeof(*pi)) < end)
|
1087
|
+
count++;
|
1088
|
+
assert(start + CMSG_LEN(count * sizeof(*pi)) == end);
|
1089
|
+
|
1090
|
+
for (i = 0; i < count; i++) {
|
1091
|
+
/* Already has accepted fd, queue now */
|
1092
|
+
if (stream->accepted_fd != -1) {
|
1093
|
+
err = uv__stream_queue_fd(stream, pi[i]);
|
1094
|
+
if (err != 0) {
|
1095
|
+
/* Close rest */
|
1096
|
+
for (; i < count; i++)
|
1097
|
+
uv__close(pi[i]);
|
1098
|
+
return err;
|
1099
|
+
}
|
1100
|
+
} else {
|
1101
|
+
stream->accepted_fd = pi[i];
|
1102
|
+
}
|
1103
|
+
}
|
1104
|
+
}
|
1105
|
+
|
1106
|
+
return 0;
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
|
1110
|
+
#ifdef __clang__
|
1111
|
+
# pragma clang diagnostic push
|
1112
|
+
# pragma clang diagnostic ignored "-Wgnu-folding-constant"
|
1113
|
+
# pragma clang diagnostic ignored "-Wvla-extension"
|
1114
|
+
#endif
|
1115
|
+
|
1116
|
+
static void uv__read(uv_stream_t* stream) {
|
1117
|
+
uv_buf_t buf;
|
1118
|
+
ssize_t nread;
|
1119
|
+
struct msghdr msg;
|
1120
|
+
char cmsg_space[CMSG_SPACE(UV__CMSG_FD_SIZE)];
|
1121
|
+
int count;
|
1122
|
+
int err;
|
1123
|
+
int is_ipc;
|
1124
|
+
|
1125
|
+
stream->flags &= ~UV_HANDLE_READ_PARTIAL;
|
1126
|
+
|
1127
|
+
/* Prevent loop starvation when the data comes in as fast as (or faster than)
|
1128
|
+
* we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
|
1129
|
+
*/
|
1130
|
+
count = 32;
|
1131
|
+
|
1132
|
+
is_ipc = stream->type == UV_NAMED_PIPE && ((uv_pipe_t*) stream)->ipc;
|
1133
|
+
|
1134
|
+
/* XXX: Maybe instead of having UV_HANDLE_READING we just test if
|
1135
|
+
* tcp->read_cb is NULL or not?
|
1136
|
+
*/
|
1137
|
+
while (stream->read_cb
|
1138
|
+
&& (stream->flags & UV_HANDLE_READING)
|
1139
|
+
&& (count-- > 0)) {
|
1140
|
+
assert(stream->alloc_cb != NULL);
|
1141
|
+
|
1142
|
+
buf = uv_buf_init(NULL, 0);
|
1143
|
+
stream->alloc_cb((uv_handle_t*)stream, 64 * 1024, &buf);
|
1144
|
+
if (buf.base == NULL || buf.len == 0) {
|
1145
|
+
/* User indicates it can't or won't handle the read. */
|
1146
|
+
stream->read_cb(stream, UV_ENOBUFS, &buf);
|
1147
|
+
return;
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
assert(buf.base != NULL);
|
1151
|
+
assert(uv__stream_fd(stream) >= 0);
|
1152
|
+
|
1153
|
+
if (!is_ipc) {
|
1154
|
+
do {
|
1155
|
+
nread = read(uv__stream_fd(stream), buf.base, buf.len);
|
1156
|
+
}
|
1157
|
+
while (nread < 0 && errno == EINTR);
|
1158
|
+
} else {
|
1159
|
+
/* ipc uses recvmsg */
|
1160
|
+
msg.msg_flags = 0;
|
1161
|
+
msg.msg_iov = (struct iovec*) &buf;
|
1162
|
+
msg.msg_iovlen = 1;
|
1163
|
+
msg.msg_name = NULL;
|
1164
|
+
msg.msg_namelen = 0;
|
1165
|
+
/* Set up to receive a descriptor even if one isn't in the message */
|
1166
|
+
msg.msg_controllen = sizeof(cmsg_space);
|
1167
|
+
msg.msg_control = cmsg_space;
|
1168
|
+
|
1169
|
+
do {
|
1170
|
+
nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0);
|
1171
|
+
}
|
1172
|
+
while (nread < 0 && errno == EINTR);
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
if (nread < 0) {
|
1176
|
+
/* Error */
|
1177
|
+
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
1178
|
+
/* Wait for the next one. */
|
1179
|
+
if (stream->flags & UV_HANDLE_READING) {
|
1180
|
+
uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
|
1181
|
+
uv__stream_osx_interrupt_select(stream);
|
1182
|
+
}
|
1183
|
+
stream->read_cb(stream, 0, &buf);
|
1184
|
+
#if defined(__CYGWIN__) || defined(__MSYS__)
|
1185
|
+
} else if (errno == ECONNRESET && stream->type == UV_NAMED_PIPE) {
|
1186
|
+
uv__stream_eof(stream, &buf);
|
1187
|
+
return;
|
1188
|
+
#elif defined(_AIX)
|
1189
|
+
} else if (errno == ECONNRESET && (stream->flags & UV_DISCONNECT)) {
|
1190
|
+
uv__stream_eof(stream, &buf);
|
1191
|
+
return;
|
1192
|
+
#endif
|
1193
|
+
} else {
|
1194
|
+
/* Error. User should call uv_close(). */
|
1195
|
+
stream->read_cb(stream, UV__ERR(errno), &buf);
|
1196
|
+
if (stream->flags & UV_HANDLE_READING) {
|
1197
|
+
stream->flags &= ~UV_HANDLE_READING;
|
1198
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
|
1199
|
+
if (!uv__io_active(&stream->io_watcher, POLLOUT))
|
1200
|
+
uv__handle_stop(stream);
|
1201
|
+
uv__stream_osx_interrupt_select(stream);
|
1202
|
+
}
|
1203
|
+
}
|
1204
|
+
return;
|
1205
|
+
} else if (nread == 0) {
|
1206
|
+
uv__stream_eof(stream, &buf);
|
1207
|
+
return;
|
1208
|
+
} else {
|
1209
|
+
/* Successful read */
|
1210
|
+
ssize_t buflen = buf.len;
|
1211
|
+
|
1212
|
+
if (is_ipc) {
|
1213
|
+
err = uv__stream_recv_cmsg(stream, &msg);
|
1214
|
+
if (err != 0) {
|
1215
|
+
stream->read_cb(stream, err, &buf);
|
1216
|
+
return;
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
|
1220
|
+
#if defined(__MVS__)
|
1221
|
+
if (is_ipc && msg.msg_controllen > 0) {
|
1222
|
+
uv_buf_t blankbuf;
|
1223
|
+
int nread;
|
1224
|
+
struct iovec *old;
|
1225
|
+
|
1226
|
+
blankbuf.base = 0;
|
1227
|
+
blankbuf.len = 0;
|
1228
|
+
old = msg.msg_iov;
|
1229
|
+
msg.msg_iov = (struct iovec*) &blankbuf;
|
1230
|
+
nread = 0;
|
1231
|
+
do {
|
1232
|
+
nread = uv__recvmsg(uv__stream_fd(stream), &msg, 0);
|
1233
|
+
err = uv__stream_recv_cmsg(stream, &msg);
|
1234
|
+
if (err != 0) {
|
1235
|
+
stream->read_cb(stream, err, &buf);
|
1236
|
+
msg.msg_iov = old;
|
1237
|
+
return;
|
1238
|
+
}
|
1239
|
+
} while (nread == 0 && msg.msg_controllen > 0);
|
1240
|
+
msg.msg_iov = old;
|
1241
|
+
}
|
1242
|
+
#endif
|
1243
|
+
stream->read_cb(stream, nread, &buf);
|
1244
|
+
|
1245
|
+
/* Return if we didn't fill the buffer, there is no more data to read. */
|
1246
|
+
if (nread < buflen) {
|
1247
|
+
stream->flags |= UV_HANDLE_READ_PARTIAL;
|
1248
|
+
return;
|
1249
|
+
}
|
1250
|
+
}
|
1251
|
+
}
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
|
1255
|
+
#ifdef __clang__
|
1256
|
+
# pragma clang diagnostic pop
|
1257
|
+
#endif
|
1258
|
+
|
1259
|
+
#undef UV__CMSG_FD_COUNT
|
1260
|
+
#undef UV__CMSG_FD_SIZE
|
1261
|
+
|
1262
|
+
|
1263
|
+
int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) {
|
1264
|
+
assert(stream->type == UV_TCP ||
|
1265
|
+
stream->type == UV_TTY ||
|
1266
|
+
stream->type == UV_NAMED_PIPE);
|
1267
|
+
|
1268
|
+
if (!(stream->flags & UV_HANDLE_WRITABLE) ||
|
1269
|
+
stream->flags & UV_HANDLE_SHUT ||
|
1270
|
+
stream->flags & UV_HANDLE_SHUTTING ||
|
1271
|
+
uv__is_closing(stream)) {
|
1272
|
+
return UV_ENOTCONN;
|
1273
|
+
}
|
1274
|
+
|
1275
|
+
assert(uv__stream_fd(stream) >= 0);
|
1276
|
+
|
1277
|
+
/* Initialize request */
|
1278
|
+
uv__req_init(stream->loop, req, UV_SHUTDOWN);
|
1279
|
+
req->handle = stream;
|
1280
|
+
req->cb = cb;
|
1281
|
+
stream->shutdown_req = req;
|
1282
|
+
stream->flags |= UV_HANDLE_SHUTTING;
|
1283
|
+
|
1284
|
+
uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
|
1285
|
+
uv__stream_osx_interrupt_select(stream);
|
1286
|
+
|
1287
|
+
return 0;
|
1288
|
+
}
|
1289
|
+
|
1290
|
+
|
1291
|
+
static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
|
1292
|
+
uv_stream_t* stream;
|
1293
|
+
|
1294
|
+
stream = container_of(w, uv_stream_t, io_watcher);
|
1295
|
+
|
1296
|
+
assert(stream->type == UV_TCP ||
|
1297
|
+
stream->type == UV_NAMED_PIPE ||
|
1298
|
+
stream->type == UV_TTY);
|
1299
|
+
assert(!(stream->flags & UV_HANDLE_CLOSING));
|
1300
|
+
|
1301
|
+
if (stream->connect_req) {
|
1302
|
+
uv__stream_connect(stream);
|
1303
|
+
return;
|
1304
|
+
}
|
1305
|
+
|
1306
|
+
assert(uv__stream_fd(stream) >= 0);
|
1307
|
+
|
1308
|
+
/* Ignore POLLHUP here. Even if it's set, there may still be data to read. */
|
1309
|
+
if (events & (POLLIN | POLLERR | POLLHUP))
|
1310
|
+
uv__read(stream);
|
1311
|
+
|
1312
|
+
if (uv__stream_fd(stream) == -1)
|
1313
|
+
return; /* read_cb closed stream. */
|
1314
|
+
|
1315
|
+
/* Short-circuit iff POLLHUP is set, the user is still interested in read
|
1316
|
+
* events and uv__read() reported a partial read but not EOF. If the EOF
|
1317
|
+
* flag is set, uv__read() called read_cb with err=UV_EOF and we don't
|
1318
|
+
* have to do anything. If the partial read flag is not set, we can't
|
1319
|
+
* report the EOF yet because there is still data to read.
|
1320
|
+
*/
|
1321
|
+
if ((events & POLLHUP) &&
|
1322
|
+
(stream->flags & UV_HANDLE_READING) &&
|
1323
|
+
(stream->flags & UV_HANDLE_READ_PARTIAL) &&
|
1324
|
+
!(stream->flags & UV_HANDLE_READ_EOF)) {
|
1325
|
+
uv_buf_t buf = { NULL, 0 };
|
1326
|
+
uv__stream_eof(stream, &buf);
|
1327
|
+
}
|
1328
|
+
|
1329
|
+
if (uv__stream_fd(stream) == -1)
|
1330
|
+
return; /* read_cb closed stream. */
|
1331
|
+
|
1332
|
+
if (events & (POLLOUT | POLLERR | POLLHUP)) {
|
1333
|
+
uv__write(stream);
|
1334
|
+
uv__write_callbacks(stream);
|
1335
|
+
|
1336
|
+
/* Write queue drained. */
|
1337
|
+
if (QUEUE_EMPTY(&stream->write_queue))
|
1338
|
+
uv__drain(stream);
|
1339
|
+
}
|
1340
|
+
}
|
1341
|
+
|
1342
|
+
|
1343
|
+
/**
|
1344
|
+
* We get called here from directly following a call to connect(2).
|
1345
|
+
* In order to determine if we've errored out or succeeded must call
|
1346
|
+
* getsockopt.
|
1347
|
+
*/
|
1348
|
+
static void uv__stream_connect(uv_stream_t* stream) {
|
1349
|
+
int error;
|
1350
|
+
uv_connect_t* req = stream->connect_req;
|
1351
|
+
socklen_t errorsize = sizeof(int);
|
1352
|
+
|
1353
|
+
assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE);
|
1354
|
+
assert(req);
|
1355
|
+
|
1356
|
+
if (stream->delayed_error) {
|
1357
|
+
/* To smooth over the differences between unixes errors that
|
1358
|
+
* were reported synchronously on the first connect can be delayed
|
1359
|
+
* until the next tick--which is now.
|
1360
|
+
*/
|
1361
|
+
error = stream->delayed_error;
|
1362
|
+
stream->delayed_error = 0;
|
1363
|
+
} else {
|
1364
|
+
/* Normal situation: we need to get the socket error from the kernel. */
|
1365
|
+
assert(uv__stream_fd(stream) >= 0);
|
1366
|
+
getsockopt(uv__stream_fd(stream),
|
1367
|
+
SOL_SOCKET,
|
1368
|
+
SO_ERROR,
|
1369
|
+
&error,
|
1370
|
+
&errorsize);
|
1371
|
+
error = UV__ERR(error);
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
if (error == UV__ERR(EINPROGRESS))
|
1375
|
+
return;
|
1376
|
+
|
1377
|
+
stream->connect_req = NULL;
|
1378
|
+
uv__req_unregister(stream->loop, req);
|
1379
|
+
|
1380
|
+
if (error < 0 || QUEUE_EMPTY(&stream->write_queue)) {
|
1381
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
if (req->cb)
|
1385
|
+
req->cb(req, error);
|
1386
|
+
|
1387
|
+
if (uv__stream_fd(stream) == -1)
|
1388
|
+
return;
|
1389
|
+
|
1390
|
+
if (error < 0) {
|
1391
|
+
uv__stream_flush_write_queue(stream, UV_ECANCELED);
|
1392
|
+
uv__write_callbacks(stream);
|
1393
|
+
}
|
1394
|
+
}
|
1395
|
+
|
1396
|
+
|
1397
|
+
int uv_write2(uv_write_t* req,
|
1398
|
+
uv_stream_t* stream,
|
1399
|
+
const uv_buf_t bufs[],
|
1400
|
+
unsigned int nbufs,
|
1401
|
+
uv_stream_t* send_handle,
|
1402
|
+
uv_write_cb cb) {
|
1403
|
+
int empty_queue;
|
1404
|
+
|
1405
|
+
assert(nbufs > 0);
|
1406
|
+
assert((stream->type == UV_TCP ||
|
1407
|
+
stream->type == UV_NAMED_PIPE ||
|
1408
|
+
stream->type == UV_TTY) &&
|
1409
|
+
"uv_write (unix) does not yet support other types of streams");
|
1410
|
+
|
1411
|
+
if (uv__stream_fd(stream) < 0)
|
1412
|
+
return UV_EBADF;
|
1413
|
+
|
1414
|
+
if (!(stream->flags & UV_HANDLE_WRITABLE))
|
1415
|
+
return UV_EPIPE;
|
1416
|
+
|
1417
|
+
if (send_handle) {
|
1418
|
+
if (stream->type != UV_NAMED_PIPE || !((uv_pipe_t*)stream)->ipc)
|
1419
|
+
return UV_EINVAL;
|
1420
|
+
|
1421
|
+
/* XXX We abuse uv_write2() to send over UDP handles to child processes.
|
1422
|
+
* Don't call uv__stream_fd() on those handles, it's a macro that on OS X
|
1423
|
+
* evaluates to a function that operates on a uv_stream_t with a couple of
|
1424
|
+
* OS X specific fields. On other Unices it does (handle)->io_watcher.fd,
|
1425
|
+
* which works but only by accident.
|
1426
|
+
*/
|
1427
|
+
if (uv__handle_fd((uv_handle_t*) send_handle) < 0)
|
1428
|
+
return UV_EBADF;
|
1429
|
+
|
1430
|
+
#if defined(__CYGWIN__) || defined(__MSYS__)
|
1431
|
+
/* Cygwin recvmsg always sets msg_controllen to zero, so we cannot send it.
|
1432
|
+
See https://github.com/mirror/newlib-cygwin/blob/86fc4bf0/winsup/cygwin/fhandler_socket.cc#L1736-L1743 */
|
1433
|
+
return UV_ENOSYS;
|
1434
|
+
#endif
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
/* It's legal for write_queue_size > 0 even when the write_queue is empty;
|
1438
|
+
* it means there are error-state requests in the write_completed_queue that
|
1439
|
+
* will touch up write_queue_size later, see also uv__write_req_finish().
|
1440
|
+
* We could check that write_queue is empty instead but that implies making
|
1441
|
+
* a write() syscall when we know that the handle is in error mode.
|
1442
|
+
*/
|
1443
|
+
empty_queue = (stream->write_queue_size == 0);
|
1444
|
+
|
1445
|
+
/* Initialize the req */
|
1446
|
+
uv__req_init(stream->loop, req, UV_WRITE);
|
1447
|
+
req->cb = cb;
|
1448
|
+
req->handle = stream;
|
1449
|
+
req->error = 0;
|
1450
|
+
req->send_handle = send_handle;
|
1451
|
+
QUEUE_INIT(&req->queue);
|
1452
|
+
|
1453
|
+
req->bufs = req->bufsml;
|
1454
|
+
if (nbufs > ARRAY_SIZE(req->bufsml))
|
1455
|
+
req->bufs = uv__malloc(nbufs * sizeof(bufs[0]));
|
1456
|
+
|
1457
|
+
if (req->bufs == NULL)
|
1458
|
+
return UV_ENOMEM;
|
1459
|
+
|
1460
|
+
memcpy(req->bufs, bufs, nbufs * sizeof(bufs[0]));
|
1461
|
+
req->nbufs = nbufs;
|
1462
|
+
req->write_index = 0;
|
1463
|
+
stream->write_queue_size += uv__count_bufs(bufs, nbufs);
|
1464
|
+
|
1465
|
+
/* Append the request to write_queue. */
|
1466
|
+
QUEUE_INSERT_TAIL(&stream->write_queue, &req->queue);
|
1467
|
+
|
1468
|
+
/* If the queue was empty when this function began, we should attempt to
|
1469
|
+
* do the write immediately. Otherwise start the write_watcher and wait
|
1470
|
+
* for the fd to become writable.
|
1471
|
+
*/
|
1472
|
+
if (stream->connect_req) {
|
1473
|
+
/* Still connecting, do nothing. */
|
1474
|
+
}
|
1475
|
+
else if (empty_queue) {
|
1476
|
+
uv__write(stream);
|
1477
|
+
}
|
1478
|
+
else {
|
1479
|
+
/*
|
1480
|
+
* blocking streams should never have anything in the queue.
|
1481
|
+
* if this assert fires then somehow the blocking stream isn't being
|
1482
|
+
* sufficiently flushed in uv__write.
|
1483
|
+
*/
|
1484
|
+
assert(!(stream->flags & UV_HANDLE_BLOCKING_WRITES));
|
1485
|
+
uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
|
1486
|
+
uv__stream_osx_interrupt_select(stream);
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
return 0;
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
|
1493
|
+
/* The buffers to be written must remain valid until the callback is called.
|
1494
|
+
* This is not required for the uv_buf_t array.
|
1495
|
+
*/
|
1496
|
+
int uv_write(uv_write_t* req,
|
1497
|
+
uv_stream_t* handle,
|
1498
|
+
const uv_buf_t bufs[],
|
1499
|
+
unsigned int nbufs,
|
1500
|
+
uv_write_cb cb) {
|
1501
|
+
return uv_write2(req, handle, bufs, nbufs, NULL, cb);
|
1502
|
+
}
|
1503
|
+
|
1504
|
+
|
1505
|
+
void uv_try_write_cb(uv_write_t* req, int status) {
|
1506
|
+
/* Should not be called */
|
1507
|
+
abort();
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
|
1511
|
+
int uv_try_write(uv_stream_t* stream,
|
1512
|
+
const uv_buf_t bufs[],
|
1513
|
+
unsigned int nbufs) {
|
1514
|
+
int r;
|
1515
|
+
int has_pollout;
|
1516
|
+
size_t written;
|
1517
|
+
size_t req_size;
|
1518
|
+
uv_write_t req;
|
1519
|
+
|
1520
|
+
/* Connecting or already writing some data */
|
1521
|
+
if (stream->connect_req != NULL || stream->write_queue_size != 0)
|
1522
|
+
return UV_EAGAIN;
|
1523
|
+
|
1524
|
+
has_pollout = uv__io_active(&stream->io_watcher, POLLOUT);
|
1525
|
+
|
1526
|
+
r = uv_write(&req, stream, bufs, nbufs, uv_try_write_cb);
|
1527
|
+
if (r != 0)
|
1528
|
+
return r;
|
1529
|
+
|
1530
|
+
/* Remove not written bytes from write queue size */
|
1531
|
+
written = uv__count_bufs(bufs, nbufs);
|
1532
|
+
if (req.bufs != NULL)
|
1533
|
+
req_size = uv__write_req_size(&req);
|
1534
|
+
else
|
1535
|
+
req_size = 0;
|
1536
|
+
written -= req_size;
|
1537
|
+
stream->write_queue_size -= req_size;
|
1538
|
+
|
1539
|
+
/* Unqueue request, regardless of immediateness */
|
1540
|
+
QUEUE_REMOVE(&req.queue);
|
1541
|
+
uv__req_unregister(stream->loop, &req);
|
1542
|
+
if (req.bufs != req.bufsml)
|
1543
|
+
uv__free(req.bufs);
|
1544
|
+
req.bufs = NULL;
|
1545
|
+
|
1546
|
+
/* Do not poll for writable, if we wasn't before calling this */
|
1547
|
+
if (!has_pollout) {
|
1548
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLOUT);
|
1549
|
+
uv__stream_osx_interrupt_select(stream);
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
if (written == 0 && req_size != 0)
|
1553
|
+
return req.error < 0 ? req.error : UV_EAGAIN;
|
1554
|
+
else
|
1555
|
+
return written;
|
1556
|
+
}
|
1557
|
+
|
1558
|
+
|
1559
|
+
int uv_read_start(uv_stream_t* stream,
|
1560
|
+
uv_alloc_cb alloc_cb,
|
1561
|
+
uv_read_cb read_cb) {
|
1562
|
+
assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE ||
|
1563
|
+
stream->type == UV_TTY);
|
1564
|
+
|
1565
|
+
if (stream->flags & UV_HANDLE_CLOSING)
|
1566
|
+
return UV_EINVAL;
|
1567
|
+
|
1568
|
+
if (!(stream->flags & UV_HANDLE_READABLE))
|
1569
|
+
return UV_ENOTCONN;
|
1570
|
+
|
1571
|
+
/* The UV_HANDLE_READING flag is irrelevant of the state of the tcp - it just
|
1572
|
+
* expresses the desired state of the user.
|
1573
|
+
*/
|
1574
|
+
stream->flags |= UV_HANDLE_READING;
|
1575
|
+
|
1576
|
+
/* TODO: try to do the read inline? */
|
1577
|
+
/* TODO: keep track of tcp state. If we've gotten a EOF then we should
|
1578
|
+
* not start the IO watcher.
|
1579
|
+
*/
|
1580
|
+
assert(uv__stream_fd(stream) >= 0);
|
1581
|
+
assert(alloc_cb);
|
1582
|
+
|
1583
|
+
stream->read_cb = read_cb;
|
1584
|
+
stream->alloc_cb = alloc_cb;
|
1585
|
+
|
1586
|
+
uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
|
1587
|
+
uv__handle_start(stream);
|
1588
|
+
uv__stream_osx_interrupt_select(stream);
|
1589
|
+
|
1590
|
+
return 0;
|
1591
|
+
}
|
1592
|
+
|
1593
|
+
|
1594
|
+
int uv_read_stop(uv_stream_t* stream) {
|
1595
|
+
if (!(stream->flags & UV_HANDLE_READING))
|
1596
|
+
return 0;
|
1597
|
+
|
1598
|
+
stream->flags &= ~UV_HANDLE_READING;
|
1599
|
+
uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
|
1600
|
+
if (!uv__io_active(&stream->io_watcher, POLLOUT))
|
1601
|
+
uv__handle_stop(stream);
|
1602
|
+
uv__stream_osx_interrupt_select(stream);
|
1603
|
+
|
1604
|
+
stream->read_cb = NULL;
|
1605
|
+
stream->alloc_cb = NULL;
|
1606
|
+
return 0;
|
1607
|
+
}
|
1608
|
+
|
1609
|
+
|
1610
|
+
int uv_is_readable(const uv_stream_t* stream) {
|
1611
|
+
return !!(stream->flags & UV_HANDLE_READABLE);
|
1612
|
+
}
|
1613
|
+
|
1614
|
+
|
1615
|
+
int uv_is_writable(const uv_stream_t* stream) {
|
1616
|
+
return !!(stream->flags & UV_HANDLE_WRITABLE);
|
1617
|
+
}
|
1618
|
+
|
1619
|
+
|
1620
|
+
#if defined(__APPLE__)
|
1621
|
+
int uv___stream_fd(const uv_stream_t* handle) {
|
1622
|
+
const uv__stream_select_t* s;
|
1623
|
+
|
1624
|
+
assert(handle->type == UV_TCP ||
|
1625
|
+
handle->type == UV_TTY ||
|
1626
|
+
handle->type == UV_NAMED_PIPE);
|
1627
|
+
|
1628
|
+
s = handle->select;
|
1629
|
+
if (s != NULL)
|
1630
|
+
return s->fd;
|
1631
|
+
|
1632
|
+
return handle->io_watcher.fd;
|
1633
|
+
}
|
1634
|
+
#endif /* defined(__APPLE__) */
|
1635
|
+
|
1636
|
+
|
1637
|
+
void uv__stream_close(uv_stream_t* handle) {
|
1638
|
+
unsigned int i;
|
1639
|
+
uv__stream_queued_fds_t* queued_fds;
|
1640
|
+
|
1641
|
+
#if defined(__APPLE__)
|
1642
|
+
/* Terminate select loop first */
|
1643
|
+
if (handle->select != NULL) {
|
1644
|
+
uv__stream_select_t* s;
|
1645
|
+
|
1646
|
+
s = handle->select;
|
1647
|
+
|
1648
|
+
uv_sem_post(&s->close_sem);
|
1649
|
+
uv_sem_post(&s->async_sem);
|
1650
|
+
uv__stream_osx_interrupt_select(handle);
|
1651
|
+
uv_thread_join(&s->thread);
|
1652
|
+
uv_sem_destroy(&s->close_sem);
|
1653
|
+
uv_sem_destroy(&s->async_sem);
|
1654
|
+
uv__close(s->fake_fd);
|
1655
|
+
uv__close(s->int_fd);
|
1656
|
+
uv_close((uv_handle_t*) &s->async, uv__stream_osx_cb_close);
|
1657
|
+
|
1658
|
+
handle->select = NULL;
|
1659
|
+
}
|
1660
|
+
#endif /* defined(__APPLE__) */
|
1661
|
+
|
1662
|
+
uv__io_close(handle->loop, &handle->io_watcher);
|
1663
|
+
uv_read_stop(handle);
|
1664
|
+
uv__handle_stop(handle);
|
1665
|
+
handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
|
1666
|
+
|
1667
|
+
if (handle->io_watcher.fd != -1) {
|
1668
|
+
/* Don't close stdio file descriptors. Nothing good comes from it. */
|
1669
|
+
if (handle->io_watcher.fd > STDERR_FILENO)
|
1670
|
+
uv__close(handle->io_watcher.fd);
|
1671
|
+
handle->io_watcher.fd = -1;
|
1672
|
+
}
|
1673
|
+
|
1674
|
+
if (handle->accepted_fd != -1) {
|
1675
|
+
uv__close(handle->accepted_fd);
|
1676
|
+
handle->accepted_fd = -1;
|
1677
|
+
}
|
1678
|
+
|
1679
|
+
/* Close all queued fds */
|
1680
|
+
if (handle->queued_fds != NULL) {
|
1681
|
+
queued_fds = handle->queued_fds;
|
1682
|
+
for (i = 0; i < queued_fds->offset; i++)
|
1683
|
+
uv__close(queued_fds->fds[i]);
|
1684
|
+
uv__free(handle->queued_fds);
|
1685
|
+
handle->queued_fds = NULL;
|
1686
|
+
}
|
1687
|
+
|
1688
|
+
assert(!uv__io_active(&handle->io_watcher, POLLIN | POLLOUT));
|
1689
|
+
}
|
1690
|
+
|
1691
|
+
|
1692
|
+
int uv_stream_set_blocking(uv_stream_t* handle, int blocking) {
|
1693
|
+
/* Don't need to check the file descriptor, uv__nonblock()
|
1694
|
+
* will fail with EBADF if it's not valid.
|
1695
|
+
*/
|
1696
|
+
return uv__nonblock(uv__stream_fd(handle), !blocking);
|
1697
|
+
}
|