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,2348 @@
|
|
1
|
+
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
2
|
+
*
|
3
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
* of this software and associated documentation files (the "Software"), to
|
5
|
+
* deal in the Software without restriction, including without limitation the
|
6
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
* furnished to do so, subject to the following conditions:
|
9
|
+
*
|
10
|
+
* The above copyright notice and this permission notice shall be included in
|
11
|
+
* all copies or substantial portions of the Software.
|
12
|
+
*
|
13
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19
|
+
* IN THE SOFTWARE.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include <assert.h>
|
23
|
+
#include <io.h>
|
24
|
+
#include <string.h>
|
25
|
+
#include <stdlib.h>
|
26
|
+
|
27
|
+
#if defined(_MSC_VER) && _MSC_VER < 1600
|
28
|
+
# include "uv/stdint-msvc2008.h"
|
29
|
+
#else
|
30
|
+
# include <stdint.h>
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#ifndef COMMON_LVB_REVERSE_VIDEO
|
34
|
+
# define COMMON_LVB_REVERSE_VIDEO 0x4000
|
35
|
+
#endif
|
36
|
+
|
37
|
+
#include "uv.h"
|
38
|
+
#include "internal.h"
|
39
|
+
#include "handle-inl.h"
|
40
|
+
#include "stream-inl.h"
|
41
|
+
#include "req-inl.h"
|
42
|
+
|
43
|
+
#ifndef InterlockedOr
|
44
|
+
# define InterlockedOr _InterlockedOr
|
45
|
+
#endif
|
46
|
+
|
47
|
+
#define UNICODE_REPLACEMENT_CHARACTER (0xfffd)
|
48
|
+
|
49
|
+
#define ANSI_NORMAL 0x00
|
50
|
+
#define ANSI_ESCAPE_SEEN 0x02
|
51
|
+
#define ANSI_CSI 0x04
|
52
|
+
#define ANSI_ST_CONTROL 0x08
|
53
|
+
#define ANSI_IGNORE 0x10
|
54
|
+
#define ANSI_IN_ARG 0x20
|
55
|
+
#define ANSI_IN_STRING 0x40
|
56
|
+
#define ANSI_BACKSLASH_SEEN 0x80
|
57
|
+
|
58
|
+
#define MAX_INPUT_BUFFER_LENGTH 8192
|
59
|
+
#define MAX_CONSOLE_CHAR 8192
|
60
|
+
|
61
|
+
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
62
|
+
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
|
63
|
+
#endif
|
64
|
+
|
65
|
+
static void uv_tty_capture_initial_style(CONSOLE_SCREEN_BUFFER_INFO* info);
|
66
|
+
static void uv_tty_update_virtual_window(CONSOLE_SCREEN_BUFFER_INFO* info);
|
67
|
+
static int uv__cancel_read_console(uv_tty_t* handle);
|
68
|
+
|
69
|
+
|
70
|
+
/* Null uv_buf_t */
|
71
|
+
static const uv_buf_t uv_null_buf_ = { 0, NULL };
|
72
|
+
|
73
|
+
enum uv__read_console_status_e {
|
74
|
+
NOT_STARTED,
|
75
|
+
IN_PROGRESS,
|
76
|
+
TRAP_REQUESTED,
|
77
|
+
COMPLETED
|
78
|
+
};
|
79
|
+
|
80
|
+
static volatile LONG uv__read_console_status = NOT_STARTED;
|
81
|
+
static volatile LONG uv__restore_screen_state;
|
82
|
+
static CONSOLE_SCREEN_BUFFER_INFO uv__saved_screen_state;
|
83
|
+
|
84
|
+
|
85
|
+
/*
|
86
|
+
* The console virtual window.
|
87
|
+
*
|
88
|
+
* Normally cursor movement in windows is relative to the console screen buffer,
|
89
|
+
* e.g. the application is allowed to overwrite the 'history'. This is very
|
90
|
+
* inconvenient, it makes absolute cursor movement pretty useless. There is
|
91
|
+
* also the concept of 'client rect' which is defined by the actual size of
|
92
|
+
* the console window and the scroll position of the screen buffer, but it's
|
93
|
+
* very volatile because it changes when the user scrolls.
|
94
|
+
*
|
95
|
+
* To make cursor movement behave sensibly we define a virtual window to which
|
96
|
+
* cursor movement is confined. The virtual window is always as wide as the
|
97
|
+
* console screen buffer, but it's height is defined by the size of the
|
98
|
+
* console window. The top of the virtual window aligns with the position
|
99
|
+
* of the caret when the first stdout/err handle is created, unless that would
|
100
|
+
* mean that it would extend beyond the bottom of the screen buffer - in that
|
101
|
+
* that case it's located as far down as possible.
|
102
|
+
*
|
103
|
+
* When the user writes a long text or many newlines, such that the output
|
104
|
+
* reaches beyond the bottom of the virtual window, the virtual window is
|
105
|
+
* shifted downwards, but not resized.
|
106
|
+
*
|
107
|
+
* Since all tty i/o happens on the same console, this window is shared
|
108
|
+
* between all stdout/stderr handles.
|
109
|
+
*/
|
110
|
+
|
111
|
+
static int uv_tty_virtual_offset = -1;
|
112
|
+
static int uv_tty_virtual_height = -1;
|
113
|
+
static int uv_tty_virtual_width = -1;
|
114
|
+
|
115
|
+
/* The console window size
|
116
|
+
* We keep this separate from uv_tty_virtual_*. We use those values to only
|
117
|
+
* handle signalling SIGWINCH
|
118
|
+
*/
|
119
|
+
|
120
|
+
static HANDLE uv__tty_console_handle = INVALID_HANDLE_VALUE;
|
121
|
+
static int uv__tty_console_height = -1;
|
122
|
+
static int uv__tty_console_width = -1;
|
123
|
+
static HANDLE uv__tty_console_resized = INVALID_HANDLE_VALUE;
|
124
|
+
static uv_mutex_t uv__tty_console_resize_mutex;
|
125
|
+
|
126
|
+
static DWORD WINAPI uv__tty_console_resize_message_loop_thread(void* param);
|
127
|
+
static void CALLBACK uv__tty_console_resize_event(HWINEVENTHOOK hWinEventHook,
|
128
|
+
DWORD event,
|
129
|
+
HWND hwnd,
|
130
|
+
LONG idObject,
|
131
|
+
LONG idChild,
|
132
|
+
DWORD dwEventThread,
|
133
|
+
DWORD dwmsEventTime);
|
134
|
+
static DWORD WINAPI uv__tty_console_resize_watcher_thread(void* param);
|
135
|
+
static void uv__tty_console_signal_resize(void);
|
136
|
+
|
137
|
+
/* We use a semaphore rather than a mutex or critical section because in some
|
138
|
+
cases (uv__cancel_read_console) we need take the lock in the main thread and
|
139
|
+
release it in another thread. Using a semaphore ensures that in such
|
140
|
+
scenario the main thread will still block when trying to acquire the lock. */
|
141
|
+
static uv_sem_t uv_tty_output_lock;
|
142
|
+
|
143
|
+
static WORD uv_tty_default_text_attributes =
|
144
|
+
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
|
145
|
+
|
146
|
+
static char uv_tty_default_fg_color = 7;
|
147
|
+
static char uv_tty_default_bg_color = 0;
|
148
|
+
static char uv_tty_default_fg_bright = 0;
|
149
|
+
static char uv_tty_default_bg_bright = 0;
|
150
|
+
static char uv_tty_default_inverse = 0;
|
151
|
+
|
152
|
+
/* Determine whether or not ANSI support is enabled. */
|
153
|
+
static BOOL uv__need_check_vterm_state = TRUE;
|
154
|
+
static uv_tty_vtermstate_t uv__vterm_state = UV_TTY_UNSUPPORTED;
|
155
|
+
static void uv__determine_vterm_state(HANDLE handle);
|
156
|
+
|
157
|
+
void uv_console_init(void) {
|
158
|
+
if (uv_sem_init(&uv_tty_output_lock, 1))
|
159
|
+
abort();
|
160
|
+
uv__tty_console_handle = CreateFileW(L"CONOUT$",
|
161
|
+
GENERIC_READ | GENERIC_WRITE,
|
162
|
+
FILE_SHARE_WRITE,
|
163
|
+
0,
|
164
|
+
OPEN_EXISTING,
|
165
|
+
0,
|
166
|
+
0);
|
167
|
+
if (uv__tty_console_handle != INVALID_HANDLE_VALUE) {
|
168
|
+
CONSOLE_SCREEN_BUFFER_INFO sb_info;
|
169
|
+
QueueUserWorkItem(uv__tty_console_resize_message_loop_thread,
|
170
|
+
NULL,
|
171
|
+
WT_EXECUTELONGFUNCTION);
|
172
|
+
uv_mutex_init(&uv__tty_console_resize_mutex);
|
173
|
+
if (GetConsoleScreenBufferInfo(uv__tty_console_handle, &sb_info)) {
|
174
|
+
uv__tty_console_width = sb_info.dwSize.X;
|
175
|
+
uv__tty_console_height = sb_info.srWindow.Bottom - sb_info.srWindow.Top + 1;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int unused) {
|
182
|
+
BOOL readable;
|
183
|
+
DWORD NumberOfEvents;
|
184
|
+
HANDLE handle;
|
185
|
+
CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info;
|
186
|
+
(void)unused;
|
187
|
+
|
188
|
+
uv__once_init();
|
189
|
+
handle = (HANDLE) uv__get_osfhandle(fd);
|
190
|
+
if (handle == INVALID_HANDLE_VALUE)
|
191
|
+
return UV_EBADF;
|
192
|
+
|
193
|
+
if (fd <= 2) {
|
194
|
+
/* In order to avoid closing a stdio file descriptor 0-2, duplicate the
|
195
|
+
* underlying OS handle and forget about the original fd.
|
196
|
+
* We could also opt to use the original OS handle and just never close it,
|
197
|
+
* but then there would be no reliable way to cancel pending read operations
|
198
|
+
* upon close.
|
199
|
+
*/
|
200
|
+
if (!DuplicateHandle(INVALID_HANDLE_VALUE,
|
201
|
+
handle,
|
202
|
+
INVALID_HANDLE_VALUE,
|
203
|
+
&handle,
|
204
|
+
0,
|
205
|
+
FALSE,
|
206
|
+
DUPLICATE_SAME_ACCESS))
|
207
|
+
return uv_translate_sys_error(GetLastError());
|
208
|
+
fd = -1;
|
209
|
+
}
|
210
|
+
|
211
|
+
readable = GetNumberOfConsoleInputEvents(handle, &NumberOfEvents);
|
212
|
+
if (!readable) {
|
213
|
+
/* Obtain the screen buffer info with the output handle. */
|
214
|
+
if (!GetConsoleScreenBufferInfo(handle, &screen_buffer_info)) {
|
215
|
+
return uv_translate_sys_error(GetLastError());
|
216
|
+
}
|
217
|
+
|
218
|
+
/* Obtain the tty_output_lock because the virtual window state is shared
|
219
|
+
* between all uv_tty_t handles. */
|
220
|
+
uv_sem_wait(&uv_tty_output_lock);
|
221
|
+
|
222
|
+
if (uv__need_check_vterm_state)
|
223
|
+
uv__determine_vterm_state(handle);
|
224
|
+
|
225
|
+
/* Remember the original console text attributes. */
|
226
|
+
uv_tty_capture_initial_style(&screen_buffer_info);
|
227
|
+
|
228
|
+
uv_tty_update_virtual_window(&screen_buffer_info);
|
229
|
+
|
230
|
+
uv_sem_post(&uv_tty_output_lock);
|
231
|
+
}
|
232
|
+
|
233
|
+
|
234
|
+
uv_stream_init(loop, (uv_stream_t*) tty, UV_TTY);
|
235
|
+
uv_connection_init((uv_stream_t*) tty);
|
236
|
+
|
237
|
+
tty->handle = handle;
|
238
|
+
tty->u.fd = fd;
|
239
|
+
tty->reqs_pending = 0;
|
240
|
+
tty->flags |= UV_HANDLE_BOUND;
|
241
|
+
|
242
|
+
if (readable) {
|
243
|
+
/* Initialize TTY input specific fields. */
|
244
|
+
tty->flags |= UV_HANDLE_TTY_READABLE | UV_HANDLE_READABLE;
|
245
|
+
/* TODO: remove me in v2.x. */
|
246
|
+
tty->tty.rd.unused_ = NULL;
|
247
|
+
tty->tty.rd.read_line_buffer = uv_null_buf_;
|
248
|
+
tty->tty.rd.read_raw_wait = NULL;
|
249
|
+
|
250
|
+
/* Init keycode-to-vt100 mapper state. */
|
251
|
+
tty->tty.rd.last_key_len = 0;
|
252
|
+
tty->tty.rd.last_key_offset = 0;
|
253
|
+
tty->tty.rd.last_utf16_high_surrogate = 0;
|
254
|
+
memset(&tty->tty.rd.last_input_record, 0, sizeof tty->tty.rd.last_input_record);
|
255
|
+
} else {
|
256
|
+
/* TTY output specific fields. */
|
257
|
+
tty->flags |= UV_HANDLE_WRITABLE;
|
258
|
+
|
259
|
+
/* Init utf8-to-utf16 conversion state. */
|
260
|
+
tty->tty.wr.utf8_bytes_left = 0;
|
261
|
+
tty->tty.wr.utf8_codepoint = 0;
|
262
|
+
|
263
|
+
/* Initialize eol conversion state */
|
264
|
+
tty->tty.wr.previous_eol = 0;
|
265
|
+
|
266
|
+
/* Init ANSI parser state. */
|
267
|
+
tty->tty.wr.ansi_parser_state = ANSI_NORMAL;
|
268
|
+
}
|
269
|
+
|
270
|
+
return 0;
|
271
|
+
}
|
272
|
+
|
273
|
+
|
274
|
+
/* Set the default console text attributes based on how the console was
|
275
|
+
* configured when libuv started.
|
276
|
+
*/
|
277
|
+
static void uv_tty_capture_initial_style(CONSOLE_SCREEN_BUFFER_INFO* info) {
|
278
|
+
static int style_captured = 0;
|
279
|
+
|
280
|
+
/* Only do this once.
|
281
|
+
Assumption: Caller has acquired uv_tty_output_lock. */
|
282
|
+
if (style_captured)
|
283
|
+
return;
|
284
|
+
|
285
|
+
/* Save raw win32 attributes. */
|
286
|
+
uv_tty_default_text_attributes = info->wAttributes;
|
287
|
+
|
288
|
+
/* Convert black text on black background to use white text. */
|
289
|
+
if (uv_tty_default_text_attributes == 0)
|
290
|
+
uv_tty_default_text_attributes = 7;
|
291
|
+
|
292
|
+
/* Convert Win32 attributes to ANSI colors. */
|
293
|
+
uv_tty_default_fg_color = 0;
|
294
|
+
uv_tty_default_bg_color = 0;
|
295
|
+
uv_tty_default_fg_bright = 0;
|
296
|
+
uv_tty_default_bg_bright = 0;
|
297
|
+
uv_tty_default_inverse = 0;
|
298
|
+
|
299
|
+
if (uv_tty_default_text_attributes & FOREGROUND_RED)
|
300
|
+
uv_tty_default_fg_color |= 1;
|
301
|
+
|
302
|
+
if (uv_tty_default_text_attributes & FOREGROUND_GREEN)
|
303
|
+
uv_tty_default_fg_color |= 2;
|
304
|
+
|
305
|
+
if (uv_tty_default_text_attributes & FOREGROUND_BLUE)
|
306
|
+
uv_tty_default_fg_color |= 4;
|
307
|
+
|
308
|
+
if (uv_tty_default_text_attributes & BACKGROUND_RED)
|
309
|
+
uv_tty_default_bg_color |= 1;
|
310
|
+
|
311
|
+
if (uv_tty_default_text_attributes & BACKGROUND_GREEN)
|
312
|
+
uv_tty_default_bg_color |= 2;
|
313
|
+
|
314
|
+
if (uv_tty_default_text_attributes & BACKGROUND_BLUE)
|
315
|
+
uv_tty_default_bg_color |= 4;
|
316
|
+
|
317
|
+
if (uv_tty_default_text_attributes & FOREGROUND_INTENSITY)
|
318
|
+
uv_tty_default_fg_bright = 1;
|
319
|
+
|
320
|
+
if (uv_tty_default_text_attributes & BACKGROUND_INTENSITY)
|
321
|
+
uv_tty_default_bg_bright = 1;
|
322
|
+
|
323
|
+
if (uv_tty_default_text_attributes & COMMON_LVB_REVERSE_VIDEO)
|
324
|
+
uv_tty_default_inverse = 1;
|
325
|
+
|
326
|
+
style_captured = 1;
|
327
|
+
}
|
328
|
+
|
329
|
+
|
330
|
+
int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
|
331
|
+
DWORD flags;
|
332
|
+
unsigned char was_reading;
|
333
|
+
uv_alloc_cb alloc_cb;
|
334
|
+
uv_read_cb read_cb;
|
335
|
+
int err;
|
336
|
+
|
337
|
+
if (!(tty->flags & UV_HANDLE_TTY_READABLE)) {
|
338
|
+
return UV_EINVAL;
|
339
|
+
}
|
340
|
+
|
341
|
+
if (!!mode == !!(tty->flags & UV_HANDLE_TTY_RAW)) {
|
342
|
+
return 0;
|
343
|
+
}
|
344
|
+
|
345
|
+
switch (mode) {
|
346
|
+
case UV_TTY_MODE_NORMAL:
|
347
|
+
flags = ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT;
|
348
|
+
break;
|
349
|
+
case UV_TTY_MODE_RAW:
|
350
|
+
flags = ENABLE_WINDOW_INPUT;
|
351
|
+
break;
|
352
|
+
case UV_TTY_MODE_IO:
|
353
|
+
return UV_ENOTSUP;
|
354
|
+
default:
|
355
|
+
return UV_EINVAL;
|
356
|
+
}
|
357
|
+
|
358
|
+
/* If currently reading, stop, and restart reading. */
|
359
|
+
if (tty->flags & UV_HANDLE_READING) {
|
360
|
+
was_reading = 1;
|
361
|
+
alloc_cb = tty->alloc_cb;
|
362
|
+
read_cb = tty->read_cb;
|
363
|
+
err = uv_tty_read_stop(tty);
|
364
|
+
if (err) {
|
365
|
+
return uv_translate_sys_error(err);
|
366
|
+
}
|
367
|
+
} else {
|
368
|
+
was_reading = 0;
|
369
|
+
alloc_cb = NULL;
|
370
|
+
read_cb = NULL;
|
371
|
+
}
|
372
|
+
|
373
|
+
uv_sem_wait(&uv_tty_output_lock);
|
374
|
+
if (!SetConsoleMode(tty->handle, flags)) {
|
375
|
+
err = uv_translate_sys_error(GetLastError());
|
376
|
+
uv_sem_post(&uv_tty_output_lock);
|
377
|
+
return err;
|
378
|
+
}
|
379
|
+
uv_sem_post(&uv_tty_output_lock);
|
380
|
+
|
381
|
+
/* Update flag. */
|
382
|
+
tty->flags &= ~UV_HANDLE_TTY_RAW;
|
383
|
+
tty->flags |= mode ? UV_HANDLE_TTY_RAW : 0;
|
384
|
+
|
385
|
+
/* If we just stopped reading, restart. */
|
386
|
+
if (was_reading) {
|
387
|
+
err = uv_tty_read_start(tty, alloc_cb, read_cb);
|
388
|
+
if (err) {
|
389
|
+
return uv_translate_sys_error(err);
|
390
|
+
}
|
391
|
+
}
|
392
|
+
|
393
|
+
return 0;
|
394
|
+
}
|
395
|
+
|
396
|
+
|
397
|
+
int uv_tty_get_winsize(uv_tty_t* tty, int* width, int* height) {
|
398
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
399
|
+
|
400
|
+
if (!GetConsoleScreenBufferInfo(tty->handle, &info)) {
|
401
|
+
return uv_translate_sys_error(GetLastError());
|
402
|
+
}
|
403
|
+
|
404
|
+
uv_sem_wait(&uv_tty_output_lock);
|
405
|
+
uv_tty_update_virtual_window(&info);
|
406
|
+
uv_sem_post(&uv_tty_output_lock);
|
407
|
+
|
408
|
+
*width = uv_tty_virtual_width;
|
409
|
+
*height = uv_tty_virtual_height;
|
410
|
+
|
411
|
+
return 0;
|
412
|
+
}
|
413
|
+
|
414
|
+
|
415
|
+
static void CALLBACK uv_tty_post_raw_read(void* data, BOOLEAN didTimeout) {
|
416
|
+
uv_loop_t* loop;
|
417
|
+
uv_tty_t* handle;
|
418
|
+
uv_req_t* req;
|
419
|
+
|
420
|
+
assert(data);
|
421
|
+
assert(!didTimeout);
|
422
|
+
|
423
|
+
req = (uv_req_t*) data;
|
424
|
+
handle = (uv_tty_t*) req->data;
|
425
|
+
loop = handle->loop;
|
426
|
+
|
427
|
+
UnregisterWait(handle->tty.rd.read_raw_wait);
|
428
|
+
handle->tty.rd.read_raw_wait = NULL;
|
429
|
+
|
430
|
+
SET_REQ_SUCCESS(req);
|
431
|
+
POST_COMPLETION_FOR_REQ(loop, req);
|
432
|
+
}
|
433
|
+
|
434
|
+
|
435
|
+
static void uv_tty_queue_read_raw(uv_loop_t* loop, uv_tty_t* handle) {
|
436
|
+
uv_read_t* req;
|
437
|
+
BOOL r;
|
438
|
+
|
439
|
+
assert(handle->flags & UV_HANDLE_READING);
|
440
|
+
assert(!(handle->flags & UV_HANDLE_READ_PENDING));
|
441
|
+
|
442
|
+
assert(handle->handle && handle->handle != INVALID_HANDLE_VALUE);
|
443
|
+
|
444
|
+
handle->tty.rd.read_line_buffer = uv_null_buf_;
|
445
|
+
|
446
|
+
req = &handle->read_req;
|
447
|
+
memset(&req->u.io.overlapped, 0, sizeof(req->u.io.overlapped));
|
448
|
+
|
449
|
+
r = RegisterWaitForSingleObject(&handle->tty.rd.read_raw_wait,
|
450
|
+
handle->handle,
|
451
|
+
uv_tty_post_raw_read,
|
452
|
+
(void*) req,
|
453
|
+
INFINITE,
|
454
|
+
WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE);
|
455
|
+
if (!r) {
|
456
|
+
handle->tty.rd.read_raw_wait = NULL;
|
457
|
+
SET_REQ_ERROR(req, GetLastError());
|
458
|
+
uv_insert_pending_req(loop, (uv_req_t*)req);
|
459
|
+
}
|
460
|
+
|
461
|
+
handle->flags |= UV_HANDLE_READ_PENDING;
|
462
|
+
handle->reqs_pending++;
|
463
|
+
}
|
464
|
+
|
465
|
+
|
466
|
+
static DWORD CALLBACK uv_tty_line_read_thread(void* data) {
|
467
|
+
uv_loop_t* loop;
|
468
|
+
uv_tty_t* handle;
|
469
|
+
uv_req_t* req;
|
470
|
+
DWORD bytes, read_bytes;
|
471
|
+
WCHAR utf16[MAX_INPUT_BUFFER_LENGTH / 3];
|
472
|
+
DWORD chars, read_chars;
|
473
|
+
LONG status;
|
474
|
+
COORD pos;
|
475
|
+
BOOL read_console_success;
|
476
|
+
|
477
|
+
assert(data);
|
478
|
+
|
479
|
+
req = (uv_req_t*) data;
|
480
|
+
handle = (uv_tty_t*) req->data;
|
481
|
+
loop = handle->loop;
|
482
|
+
|
483
|
+
assert(handle->tty.rd.read_line_buffer.base != NULL);
|
484
|
+
assert(handle->tty.rd.read_line_buffer.len > 0);
|
485
|
+
|
486
|
+
/* ReadConsole can't handle big buffers. */
|
487
|
+
if (handle->tty.rd.read_line_buffer.len < MAX_INPUT_BUFFER_LENGTH) {
|
488
|
+
bytes = handle->tty.rd.read_line_buffer.len;
|
489
|
+
} else {
|
490
|
+
bytes = MAX_INPUT_BUFFER_LENGTH;
|
491
|
+
}
|
492
|
+
|
493
|
+
/* At last, unicode! One utf-16 codeunit never takes more than 3 utf-8
|
494
|
+
* codeunits to encode. */
|
495
|
+
chars = bytes / 3;
|
496
|
+
|
497
|
+
status = InterlockedExchange(&uv__read_console_status, IN_PROGRESS);
|
498
|
+
if (status == TRAP_REQUESTED) {
|
499
|
+
SET_REQ_SUCCESS(req);
|
500
|
+
req->u.io.overlapped.InternalHigh = 0;
|
501
|
+
POST_COMPLETION_FOR_REQ(loop, req);
|
502
|
+
return 0;
|
503
|
+
}
|
504
|
+
|
505
|
+
read_console_success = ReadConsoleW(handle->handle,
|
506
|
+
(void*) utf16,
|
507
|
+
chars,
|
508
|
+
&read_chars,
|
509
|
+
NULL);
|
510
|
+
|
511
|
+
if (read_console_success) {
|
512
|
+
read_bytes = WideCharToMultiByte(CP_UTF8,
|
513
|
+
0,
|
514
|
+
utf16,
|
515
|
+
read_chars,
|
516
|
+
handle->tty.rd.read_line_buffer.base,
|
517
|
+
bytes,
|
518
|
+
NULL,
|
519
|
+
NULL);
|
520
|
+
SET_REQ_SUCCESS(req);
|
521
|
+
req->u.io.overlapped.InternalHigh = read_bytes;
|
522
|
+
} else {
|
523
|
+
SET_REQ_ERROR(req, GetLastError());
|
524
|
+
}
|
525
|
+
|
526
|
+
status = InterlockedExchange(&uv__read_console_status, COMPLETED);
|
527
|
+
|
528
|
+
if (status == TRAP_REQUESTED) {
|
529
|
+
/* If we canceled the read by sending a VK_RETURN event, restore the
|
530
|
+
screen state to undo the visual effect of the VK_RETURN */
|
531
|
+
if (read_console_success && InterlockedOr(&uv__restore_screen_state, 0)) {
|
532
|
+
HANDLE active_screen_buffer;
|
533
|
+
active_screen_buffer = CreateFileA("conout$",
|
534
|
+
GENERIC_READ | GENERIC_WRITE,
|
535
|
+
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
536
|
+
NULL,
|
537
|
+
OPEN_EXISTING,
|
538
|
+
FILE_ATTRIBUTE_NORMAL,
|
539
|
+
NULL);
|
540
|
+
if (active_screen_buffer != INVALID_HANDLE_VALUE) {
|
541
|
+
pos = uv__saved_screen_state.dwCursorPosition;
|
542
|
+
|
543
|
+
/* If the cursor was at the bottom line of the screen buffer, the
|
544
|
+
VK_RETURN would have caused the buffer contents to scroll up by one
|
545
|
+
line. The right position to reset the cursor to is therefore one line
|
546
|
+
higher */
|
547
|
+
if (pos.Y == uv__saved_screen_state.dwSize.Y - 1)
|
548
|
+
pos.Y--;
|
549
|
+
|
550
|
+
SetConsoleCursorPosition(active_screen_buffer, pos);
|
551
|
+
CloseHandle(active_screen_buffer);
|
552
|
+
}
|
553
|
+
}
|
554
|
+
uv_sem_post(&uv_tty_output_lock);
|
555
|
+
}
|
556
|
+
POST_COMPLETION_FOR_REQ(loop, req);
|
557
|
+
return 0;
|
558
|
+
}
|
559
|
+
|
560
|
+
|
561
|
+
static void uv_tty_queue_read_line(uv_loop_t* loop, uv_tty_t* handle) {
|
562
|
+
uv_read_t* req;
|
563
|
+
BOOL r;
|
564
|
+
|
565
|
+
assert(handle->flags & UV_HANDLE_READING);
|
566
|
+
assert(!(handle->flags & UV_HANDLE_READ_PENDING));
|
567
|
+
assert(handle->handle && handle->handle != INVALID_HANDLE_VALUE);
|
568
|
+
|
569
|
+
req = &handle->read_req;
|
570
|
+
memset(&req->u.io.overlapped, 0, sizeof(req->u.io.overlapped));
|
571
|
+
|
572
|
+
handle->tty.rd.read_line_buffer = uv_buf_init(NULL, 0);
|
573
|
+
handle->alloc_cb((uv_handle_t*) handle, 8192, &handle->tty.rd.read_line_buffer);
|
574
|
+
if (handle->tty.rd.read_line_buffer.base == NULL ||
|
575
|
+
handle->tty.rd.read_line_buffer.len == 0) {
|
576
|
+
handle->read_cb((uv_stream_t*) handle,
|
577
|
+
UV_ENOBUFS,
|
578
|
+
&handle->tty.rd.read_line_buffer);
|
579
|
+
return;
|
580
|
+
}
|
581
|
+
assert(handle->tty.rd.read_line_buffer.base != NULL);
|
582
|
+
|
583
|
+
/* Reset flags No locking is required since there cannot be a line read
|
584
|
+
in progress. We are also relying on the memory barrier provided by
|
585
|
+
QueueUserWorkItem*/
|
586
|
+
uv__restore_screen_state = FALSE;
|
587
|
+
uv__read_console_status = NOT_STARTED;
|
588
|
+
r = QueueUserWorkItem(uv_tty_line_read_thread,
|
589
|
+
(void*) req,
|
590
|
+
WT_EXECUTELONGFUNCTION);
|
591
|
+
if (!r) {
|
592
|
+
SET_REQ_ERROR(req, GetLastError());
|
593
|
+
uv_insert_pending_req(loop, (uv_req_t*)req);
|
594
|
+
}
|
595
|
+
|
596
|
+
handle->flags |= UV_HANDLE_READ_PENDING;
|
597
|
+
handle->reqs_pending++;
|
598
|
+
}
|
599
|
+
|
600
|
+
|
601
|
+
static void uv_tty_queue_read(uv_loop_t* loop, uv_tty_t* handle) {
|
602
|
+
if (handle->flags & UV_HANDLE_TTY_RAW) {
|
603
|
+
uv_tty_queue_read_raw(loop, handle);
|
604
|
+
} else {
|
605
|
+
uv_tty_queue_read_line(loop, handle);
|
606
|
+
}
|
607
|
+
}
|
608
|
+
|
609
|
+
|
610
|
+
static const char* get_vt100_fn_key(DWORD code, char shift, char ctrl,
|
611
|
+
size_t* len) {
|
612
|
+
#define VK_CASE(vk, normal_str, shift_str, ctrl_str, shift_ctrl_str) \
|
613
|
+
case (vk): \
|
614
|
+
if (shift && ctrl) { \
|
615
|
+
*len = sizeof shift_ctrl_str; \
|
616
|
+
return "\033" shift_ctrl_str; \
|
617
|
+
} else if (shift) { \
|
618
|
+
*len = sizeof shift_str ; \
|
619
|
+
return "\033" shift_str; \
|
620
|
+
} else if (ctrl) { \
|
621
|
+
*len = sizeof ctrl_str; \
|
622
|
+
return "\033" ctrl_str; \
|
623
|
+
} else { \
|
624
|
+
*len = sizeof normal_str; \
|
625
|
+
return "\033" normal_str; \
|
626
|
+
}
|
627
|
+
|
628
|
+
switch (code) {
|
629
|
+
/* These mappings are the same as Cygwin's. Unmodified and alt-modified
|
630
|
+
* keypad keys comply with linux console, modifiers comply with xterm
|
631
|
+
* modifier usage. F1. f12 and shift-f1. f10 comply with linux console, f6.
|
632
|
+
* f12 with and without modifiers comply with rxvt. */
|
633
|
+
VK_CASE(VK_INSERT, "[2~", "[2;2~", "[2;5~", "[2;6~")
|
634
|
+
VK_CASE(VK_END, "[4~", "[4;2~", "[4;5~", "[4;6~")
|
635
|
+
VK_CASE(VK_DOWN, "[B", "[1;2B", "[1;5B", "[1;6B")
|
636
|
+
VK_CASE(VK_NEXT, "[6~", "[6;2~", "[6;5~", "[6;6~")
|
637
|
+
VK_CASE(VK_LEFT, "[D", "[1;2D", "[1;5D", "[1;6D")
|
638
|
+
VK_CASE(VK_CLEAR, "[G", "[1;2G", "[1;5G", "[1;6G")
|
639
|
+
VK_CASE(VK_RIGHT, "[C", "[1;2C", "[1;5C", "[1;6C")
|
640
|
+
VK_CASE(VK_UP, "[A", "[1;2A", "[1;5A", "[1;6A")
|
641
|
+
VK_CASE(VK_HOME, "[1~", "[1;2~", "[1;5~", "[1;6~")
|
642
|
+
VK_CASE(VK_PRIOR, "[5~", "[5;2~", "[5;5~", "[5;6~")
|
643
|
+
VK_CASE(VK_DELETE, "[3~", "[3;2~", "[3;5~", "[3;6~")
|
644
|
+
VK_CASE(VK_NUMPAD0, "[2~", "[2;2~", "[2;5~", "[2;6~")
|
645
|
+
VK_CASE(VK_NUMPAD1, "[4~", "[4;2~", "[4;5~", "[4;6~")
|
646
|
+
VK_CASE(VK_NUMPAD2, "[B", "[1;2B", "[1;5B", "[1;6B")
|
647
|
+
VK_CASE(VK_NUMPAD3, "[6~", "[6;2~", "[6;5~", "[6;6~")
|
648
|
+
VK_CASE(VK_NUMPAD4, "[D", "[1;2D", "[1;5D", "[1;6D")
|
649
|
+
VK_CASE(VK_NUMPAD5, "[G", "[1;2G", "[1;5G", "[1;6G")
|
650
|
+
VK_CASE(VK_NUMPAD6, "[C", "[1;2C", "[1;5C", "[1;6C")
|
651
|
+
VK_CASE(VK_NUMPAD7, "[A", "[1;2A", "[1;5A", "[1;6A")
|
652
|
+
VK_CASE(VK_NUMPAD8, "[1~", "[1;2~", "[1;5~", "[1;6~")
|
653
|
+
VK_CASE(VK_NUMPAD9, "[5~", "[5;2~", "[5;5~", "[5;6~")
|
654
|
+
VK_CASE(VK_DECIMAL, "[3~", "[3;2~", "[3;5~", "[3;6~")
|
655
|
+
VK_CASE(VK_F1, "[[A", "[23~", "[11^", "[23^" )
|
656
|
+
VK_CASE(VK_F2, "[[B", "[24~", "[12^", "[24^" )
|
657
|
+
VK_CASE(VK_F3, "[[C", "[25~", "[13^", "[25^" )
|
658
|
+
VK_CASE(VK_F4, "[[D", "[26~", "[14^", "[26^" )
|
659
|
+
VK_CASE(VK_F5, "[[E", "[28~", "[15^", "[28^" )
|
660
|
+
VK_CASE(VK_F6, "[17~", "[29~", "[17^", "[29^" )
|
661
|
+
VK_CASE(VK_F7, "[18~", "[31~", "[18^", "[31^" )
|
662
|
+
VK_CASE(VK_F8, "[19~", "[32~", "[19^", "[32^" )
|
663
|
+
VK_CASE(VK_F9, "[20~", "[33~", "[20^", "[33^" )
|
664
|
+
VK_CASE(VK_F10, "[21~", "[34~", "[21^", "[34^" )
|
665
|
+
VK_CASE(VK_F11, "[23~", "[23$", "[23^", "[23@" )
|
666
|
+
VK_CASE(VK_F12, "[24~", "[24$", "[24^", "[24@" )
|
667
|
+
|
668
|
+
default:
|
669
|
+
*len = 0;
|
670
|
+
return NULL;
|
671
|
+
}
|
672
|
+
#undef VK_CASE
|
673
|
+
}
|
674
|
+
|
675
|
+
|
676
|
+
void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle,
|
677
|
+
uv_req_t* req) {
|
678
|
+
/* Shortcut for handle->tty.rd.last_input_record.Event.KeyEvent. */
|
679
|
+
#define KEV handle->tty.rd.last_input_record.Event.KeyEvent
|
680
|
+
|
681
|
+
DWORD records_left, records_read;
|
682
|
+
uv_buf_t buf;
|
683
|
+
off_t buf_used;
|
684
|
+
|
685
|
+
assert(handle->type == UV_TTY);
|
686
|
+
assert(handle->flags & UV_HANDLE_TTY_READABLE);
|
687
|
+
handle->flags &= ~UV_HANDLE_READ_PENDING;
|
688
|
+
|
689
|
+
if (!(handle->flags & UV_HANDLE_READING) ||
|
690
|
+
!(handle->flags & UV_HANDLE_TTY_RAW)) {
|
691
|
+
goto out;
|
692
|
+
}
|
693
|
+
|
694
|
+
if (!REQ_SUCCESS(req)) {
|
695
|
+
/* An error occurred while waiting for the event. */
|
696
|
+
if ((handle->flags & UV_HANDLE_READING)) {
|
697
|
+
handle->flags &= ~UV_HANDLE_READING;
|
698
|
+
handle->read_cb((uv_stream_t*)handle,
|
699
|
+
uv_translate_sys_error(GET_REQ_ERROR(req)),
|
700
|
+
&uv_null_buf_);
|
701
|
+
}
|
702
|
+
goto out;
|
703
|
+
}
|
704
|
+
|
705
|
+
/* Fetch the number of events */
|
706
|
+
if (!GetNumberOfConsoleInputEvents(handle->handle, &records_left)) {
|
707
|
+
handle->flags &= ~UV_HANDLE_READING;
|
708
|
+
DECREASE_ACTIVE_COUNT(loop, handle);
|
709
|
+
handle->read_cb((uv_stream_t*)handle,
|
710
|
+
uv_translate_sys_error(GetLastError()),
|
711
|
+
&uv_null_buf_);
|
712
|
+
goto out;
|
713
|
+
}
|
714
|
+
|
715
|
+
/* Windows sends a lot of events that we're not interested in, so buf will be
|
716
|
+
* allocated on demand, when there's actually something to emit. */
|
717
|
+
buf = uv_null_buf_;
|
718
|
+
buf_used = 0;
|
719
|
+
|
720
|
+
while ((records_left > 0 || handle->tty.rd.last_key_len > 0) &&
|
721
|
+
(handle->flags & UV_HANDLE_READING)) {
|
722
|
+
if (handle->tty.rd.last_key_len == 0) {
|
723
|
+
/* Read the next input record */
|
724
|
+
if (!ReadConsoleInputW(handle->handle,
|
725
|
+
&handle->tty.rd.last_input_record,
|
726
|
+
1,
|
727
|
+
&records_read)) {
|
728
|
+
handle->flags &= ~UV_HANDLE_READING;
|
729
|
+
DECREASE_ACTIVE_COUNT(loop, handle);
|
730
|
+
handle->read_cb((uv_stream_t*) handle,
|
731
|
+
uv_translate_sys_error(GetLastError()),
|
732
|
+
&buf);
|
733
|
+
goto out;
|
734
|
+
}
|
735
|
+
records_left--;
|
736
|
+
|
737
|
+
/* We might be not subscribed to EVENT_CONSOLE_LAYOUT or we might be
|
738
|
+
* running under some TTY emulator that does not send those events. */
|
739
|
+
if (handle->tty.rd.last_input_record.EventType == WINDOW_BUFFER_SIZE_EVENT) {
|
740
|
+
uv__tty_console_signal_resize();
|
741
|
+
}
|
742
|
+
|
743
|
+
/* Ignore other events that are not key events. */
|
744
|
+
if (handle->tty.rd.last_input_record.EventType != KEY_EVENT) {
|
745
|
+
continue;
|
746
|
+
}
|
747
|
+
|
748
|
+
/* Ignore keyup events, unless the left alt key was held and a valid
|
749
|
+
* unicode character was emitted. */
|
750
|
+
if (!KEV.bKeyDown &&
|
751
|
+
(KEV.wVirtualKeyCode != VK_MENU ||
|
752
|
+
KEV.uChar.UnicodeChar == 0)) {
|
753
|
+
continue;
|
754
|
+
}
|
755
|
+
|
756
|
+
/* Ignore keypresses to numpad number keys if the left alt is held
|
757
|
+
* because the user is composing a character, or windows simulating this.
|
758
|
+
*/
|
759
|
+
if ((KEV.dwControlKeyState & LEFT_ALT_PRESSED) &&
|
760
|
+
!(KEV.dwControlKeyState & ENHANCED_KEY) &&
|
761
|
+
(KEV.wVirtualKeyCode == VK_INSERT ||
|
762
|
+
KEV.wVirtualKeyCode == VK_END ||
|
763
|
+
KEV.wVirtualKeyCode == VK_DOWN ||
|
764
|
+
KEV.wVirtualKeyCode == VK_NEXT ||
|
765
|
+
KEV.wVirtualKeyCode == VK_LEFT ||
|
766
|
+
KEV.wVirtualKeyCode == VK_CLEAR ||
|
767
|
+
KEV.wVirtualKeyCode == VK_RIGHT ||
|
768
|
+
KEV.wVirtualKeyCode == VK_HOME ||
|
769
|
+
KEV.wVirtualKeyCode == VK_UP ||
|
770
|
+
KEV.wVirtualKeyCode == VK_PRIOR ||
|
771
|
+
KEV.wVirtualKeyCode == VK_NUMPAD0 ||
|
772
|
+
KEV.wVirtualKeyCode == VK_NUMPAD1 ||
|
773
|
+
KEV.wVirtualKeyCode == VK_NUMPAD2 ||
|
774
|
+
KEV.wVirtualKeyCode == VK_NUMPAD3 ||
|
775
|
+
KEV.wVirtualKeyCode == VK_NUMPAD4 ||
|
776
|
+
KEV.wVirtualKeyCode == VK_NUMPAD5 ||
|
777
|
+
KEV.wVirtualKeyCode == VK_NUMPAD6 ||
|
778
|
+
KEV.wVirtualKeyCode == VK_NUMPAD7 ||
|
779
|
+
KEV.wVirtualKeyCode == VK_NUMPAD8 ||
|
780
|
+
KEV.wVirtualKeyCode == VK_NUMPAD9)) {
|
781
|
+
continue;
|
782
|
+
}
|
783
|
+
|
784
|
+
if (KEV.uChar.UnicodeChar != 0) {
|
785
|
+
int prefix_len, char_len;
|
786
|
+
|
787
|
+
/* Character key pressed */
|
788
|
+
if (KEV.uChar.UnicodeChar >= 0xD800 &&
|
789
|
+
KEV.uChar.UnicodeChar < 0xDC00) {
|
790
|
+
/* UTF-16 high surrogate */
|
791
|
+
handle->tty.rd.last_utf16_high_surrogate = KEV.uChar.UnicodeChar;
|
792
|
+
continue;
|
793
|
+
}
|
794
|
+
|
795
|
+
/* Prefix with \u033 if alt was held, but alt was not used as part a
|
796
|
+
* compose sequence. */
|
797
|
+
if ((KEV.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))
|
798
|
+
&& !(KEV.dwControlKeyState & (LEFT_CTRL_PRESSED |
|
799
|
+
RIGHT_CTRL_PRESSED)) && KEV.bKeyDown) {
|
800
|
+
handle->tty.rd.last_key[0] = '\033';
|
801
|
+
prefix_len = 1;
|
802
|
+
} else {
|
803
|
+
prefix_len = 0;
|
804
|
+
}
|
805
|
+
|
806
|
+
if (KEV.uChar.UnicodeChar >= 0xDC00 &&
|
807
|
+
KEV.uChar.UnicodeChar < 0xE000) {
|
808
|
+
/* UTF-16 surrogate pair */
|
809
|
+
WCHAR utf16_buffer[2];
|
810
|
+
utf16_buffer[0] = handle->tty.rd.last_utf16_high_surrogate;
|
811
|
+
utf16_buffer[1] = KEV.uChar.UnicodeChar;
|
812
|
+
char_len = WideCharToMultiByte(CP_UTF8,
|
813
|
+
0,
|
814
|
+
utf16_buffer,
|
815
|
+
2,
|
816
|
+
&handle->tty.rd.last_key[prefix_len],
|
817
|
+
sizeof handle->tty.rd.last_key,
|
818
|
+
NULL,
|
819
|
+
NULL);
|
820
|
+
} else {
|
821
|
+
/* Single UTF-16 character */
|
822
|
+
char_len = WideCharToMultiByte(CP_UTF8,
|
823
|
+
0,
|
824
|
+
&KEV.uChar.UnicodeChar,
|
825
|
+
1,
|
826
|
+
&handle->tty.rd.last_key[prefix_len],
|
827
|
+
sizeof handle->tty.rd.last_key,
|
828
|
+
NULL,
|
829
|
+
NULL);
|
830
|
+
}
|
831
|
+
|
832
|
+
/* Whatever happened, the last character wasn't a high surrogate. */
|
833
|
+
handle->tty.rd.last_utf16_high_surrogate = 0;
|
834
|
+
|
835
|
+
/* If the utf16 character(s) couldn't be converted something must be
|
836
|
+
* wrong. */
|
837
|
+
if (!char_len) {
|
838
|
+
handle->flags &= ~UV_HANDLE_READING;
|
839
|
+
DECREASE_ACTIVE_COUNT(loop, handle);
|
840
|
+
handle->read_cb((uv_stream_t*) handle,
|
841
|
+
uv_translate_sys_error(GetLastError()),
|
842
|
+
&buf);
|
843
|
+
goto out;
|
844
|
+
}
|
845
|
+
|
846
|
+
handle->tty.rd.last_key_len = (unsigned char) (prefix_len + char_len);
|
847
|
+
handle->tty.rd.last_key_offset = 0;
|
848
|
+
continue;
|
849
|
+
|
850
|
+
} else {
|
851
|
+
/* Function key pressed */
|
852
|
+
const char* vt100;
|
853
|
+
size_t prefix_len, vt100_len;
|
854
|
+
|
855
|
+
vt100 = get_vt100_fn_key(KEV.wVirtualKeyCode,
|
856
|
+
!!(KEV.dwControlKeyState & SHIFT_PRESSED),
|
857
|
+
!!(KEV.dwControlKeyState & (
|
858
|
+
LEFT_CTRL_PRESSED |
|
859
|
+
RIGHT_CTRL_PRESSED)),
|
860
|
+
&vt100_len);
|
861
|
+
|
862
|
+
/* If we were unable to map to a vt100 sequence, just ignore. */
|
863
|
+
if (!vt100) {
|
864
|
+
continue;
|
865
|
+
}
|
866
|
+
|
867
|
+
/* Prefix with \x033 when the alt key was held. */
|
868
|
+
if (KEV.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) {
|
869
|
+
handle->tty.rd.last_key[0] = '\033';
|
870
|
+
prefix_len = 1;
|
871
|
+
} else {
|
872
|
+
prefix_len = 0;
|
873
|
+
}
|
874
|
+
|
875
|
+
/* Copy the vt100 sequence to the handle buffer. */
|
876
|
+
assert(prefix_len + vt100_len < sizeof handle->tty.rd.last_key);
|
877
|
+
memcpy(&handle->tty.rd.last_key[prefix_len], vt100, vt100_len);
|
878
|
+
|
879
|
+
handle->tty.rd.last_key_len = (unsigned char) (prefix_len + vt100_len);
|
880
|
+
handle->tty.rd.last_key_offset = 0;
|
881
|
+
continue;
|
882
|
+
}
|
883
|
+
} else {
|
884
|
+
/* Copy any bytes left from the last keypress to the user buffer. */
|
885
|
+
if (handle->tty.rd.last_key_offset < handle->tty.rd.last_key_len) {
|
886
|
+
/* Allocate a buffer if needed */
|
887
|
+
if (buf_used == 0) {
|
888
|
+
buf = uv_buf_init(NULL, 0);
|
889
|
+
handle->alloc_cb((uv_handle_t*) handle, 1024, &buf);
|
890
|
+
if (buf.base == NULL || buf.len == 0) {
|
891
|
+
handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, &buf);
|
892
|
+
goto out;
|
893
|
+
}
|
894
|
+
assert(buf.base != NULL);
|
895
|
+
}
|
896
|
+
|
897
|
+
buf.base[buf_used++] = handle->tty.rd.last_key[handle->tty.rd.last_key_offset++];
|
898
|
+
|
899
|
+
/* If the buffer is full, emit it */
|
900
|
+
if ((size_t) buf_used == buf.len) {
|
901
|
+
handle->read_cb((uv_stream_t*) handle, buf_used, &buf);
|
902
|
+
buf = uv_null_buf_;
|
903
|
+
buf_used = 0;
|
904
|
+
}
|
905
|
+
|
906
|
+
continue;
|
907
|
+
}
|
908
|
+
|
909
|
+
/* Apply dwRepeat from the last input record. */
|
910
|
+
if (--KEV.wRepeatCount > 0) {
|
911
|
+
handle->tty.rd.last_key_offset = 0;
|
912
|
+
continue;
|
913
|
+
}
|
914
|
+
|
915
|
+
handle->tty.rd.last_key_len = 0;
|
916
|
+
continue;
|
917
|
+
}
|
918
|
+
}
|
919
|
+
|
920
|
+
/* Send the buffer back to the user */
|
921
|
+
if (buf_used > 0) {
|
922
|
+
handle->read_cb((uv_stream_t*) handle, buf_used, &buf);
|
923
|
+
}
|
924
|
+
|
925
|
+
out:
|
926
|
+
/* Wait for more input events. */
|
927
|
+
if ((handle->flags & UV_HANDLE_READING) &&
|
928
|
+
!(handle->flags & UV_HANDLE_READ_PENDING)) {
|
929
|
+
uv_tty_queue_read(loop, handle);
|
930
|
+
}
|
931
|
+
|
932
|
+
DECREASE_PENDING_REQ_COUNT(handle);
|
933
|
+
|
934
|
+
#undef KEV
|
935
|
+
}
|
936
|
+
|
937
|
+
|
938
|
+
|
939
|
+
void uv_process_tty_read_line_req(uv_loop_t* loop, uv_tty_t* handle,
|
940
|
+
uv_req_t* req) {
|
941
|
+
uv_buf_t buf;
|
942
|
+
|
943
|
+
assert(handle->type == UV_TTY);
|
944
|
+
assert(handle->flags & UV_HANDLE_TTY_READABLE);
|
945
|
+
|
946
|
+
buf = handle->tty.rd.read_line_buffer;
|
947
|
+
|
948
|
+
handle->flags &= ~UV_HANDLE_READ_PENDING;
|
949
|
+
handle->tty.rd.read_line_buffer = uv_null_buf_;
|
950
|
+
|
951
|
+
if (!REQ_SUCCESS(req)) {
|
952
|
+
/* Read was not successful */
|
953
|
+
if (handle->flags & UV_HANDLE_READING) {
|
954
|
+
/* Real error */
|
955
|
+
handle->flags &= ~UV_HANDLE_READING;
|
956
|
+
DECREASE_ACTIVE_COUNT(loop, handle);
|
957
|
+
handle->read_cb((uv_stream_t*) handle,
|
958
|
+
uv_translate_sys_error(GET_REQ_ERROR(req)),
|
959
|
+
&buf);
|
960
|
+
}
|
961
|
+
} else {
|
962
|
+
if (!(handle->flags & UV_HANDLE_CANCELLATION_PENDING) &&
|
963
|
+
req->u.io.overlapped.InternalHigh != 0) {
|
964
|
+
/* Read successful. TODO: read unicode, convert to utf-8 */
|
965
|
+
DWORD bytes = req->u.io.overlapped.InternalHigh;
|
966
|
+
handle->read_cb((uv_stream_t*) handle, bytes, &buf);
|
967
|
+
}
|
968
|
+
handle->flags &= ~UV_HANDLE_CANCELLATION_PENDING;
|
969
|
+
}
|
970
|
+
|
971
|
+
/* Wait for more input events. */
|
972
|
+
if ((handle->flags & UV_HANDLE_READING) &&
|
973
|
+
!(handle->flags & UV_HANDLE_READ_PENDING)) {
|
974
|
+
uv_tty_queue_read(loop, handle);
|
975
|
+
}
|
976
|
+
|
977
|
+
DECREASE_PENDING_REQ_COUNT(handle);
|
978
|
+
}
|
979
|
+
|
980
|
+
|
981
|
+
void uv_process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle,
|
982
|
+
uv_req_t* req) {
|
983
|
+
assert(handle->type == UV_TTY);
|
984
|
+
assert(handle->flags & UV_HANDLE_TTY_READABLE);
|
985
|
+
|
986
|
+
/* If the read_line_buffer member is zero, it must have been an raw read.
|
987
|
+
* Otherwise it was a line-buffered read. FIXME: This is quite obscure. Use a
|
988
|
+
* flag or something. */
|
989
|
+
if (handle->tty.rd.read_line_buffer.len == 0) {
|
990
|
+
uv_process_tty_read_raw_req(loop, handle, req);
|
991
|
+
} else {
|
992
|
+
uv_process_tty_read_line_req(loop, handle, req);
|
993
|
+
}
|
994
|
+
}
|
995
|
+
|
996
|
+
|
997
|
+
int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
|
998
|
+
uv_read_cb read_cb) {
|
999
|
+
uv_loop_t* loop = handle->loop;
|
1000
|
+
|
1001
|
+
if (!(handle->flags & UV_HANDLE_TTY_READABLE)) {
|
1002
|
+
return ERROR_INVALID_PARAMETER;
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
handle->flags |= UV_HANDLE_READING;
|
1006
|
+
INCREASE_ACTIVE_COUNT(loop, handle);
|
1007
|
+
handle->read_cb = read_cb;
|
1008
|
+
handle->alloc_cb = alloc_cb;
|
1009
|
+
|
1010
|
+
/* If reading was stopped and then started again, there could still be a read
|
1011
|
+
* request pending. */
|
1012
|
+
if (handle->flags & UV_HANDLE_READ_PENDING) {
|
1013
|
+
return 0;
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
/* Maybe the user stopped reading half-way while processing key events.
|
1017
|
+
* Short-circuit if this could be the case. */
|
1018
|
+
if (handle->tty.rd.last_key_len > 0) {
|
1019
|
+
SET_REQ_SUCCESS(&handle->read_req);
|
1020
|
+
uv_insert_pending_req(handle->loop, (uv_req_t*) &handle->read_req);
|
1021
|
+
/* Make sure no attempt is made to insert it again until it's handled. */
|
1022
|
+
handle->flags |= UV_HANDLE_READ_PENDING;
|
1023
|
+
handle->reqs_pending++;
|
1024
|
+
return 0;
|
1025
|
+
}
|
1026
|
+
|
1027
|
+
uv_tty_queue_read(loop, handle);
|
1028
|
+
|
1029
|
+
return 0;
|
1030
|
+
}
|
1031
|
+
|
1032
|
+
|
1033
|
+
int uv_tty_read_stop(uv_tty_t* handle) {
|
1034
|
+
INPUT_RECORD record;
|
1035
|
+
DWORD written, err;
|
1036
|
+
|
1037
|
+
handle->flags &= ~UV_HANDLE_READING;
|
1038
|
+
DECREASE_ACTIVE_COUNT(handle->loop, handle);
|
1039
|
+
|
1040
|
+
if (!(handle->flags & UV_HANDLE_READ_PENDING))
|
1041
|
+
return 0;
|
1042
|
+
|
1043
|
+
if (handle->flags & UV_HANDLE_TTY_RAW) {
|
1044
|
+
/* Cancel raw read. Write some bullshit event to force the console wait to
|
1045
|
+
* return. */
|
1046
|
+
memset(&record, 0, sizeof record);
|
1047
|
+
record.EventType = FOCUS_EVENT;
|
1048
|
+
if (!WriteConsoleInputW(handle->handle, &record, 1, &written)) {
|
1049
|
+
return GetLastError();
|
1050
|
+
}
|
1051
|
+
} else if (!(handle->flags & UV_HANDLE_CANCELLATION_PENDING)) {
|
1052
|
+
/* Cancel line-buffered read if not already pending */
|
1053
|
+
err = uv__cancel_read_console(handle);
|
1054
|
+
if (err)
|
1055
|
+
return err;
|
1056
|
+
|
1057
|
+
handle->flags |= UV_HANDLE_CANCELLATION_PENDING;
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
return 0;
|
1061
|
+
}
|
1062
|
+
|
1063
|
+
static int uv__cancel_read_console(uv_tty_t* handle) {
|
1064
|
+
HANDLE active_screen_buffer = INVALID_HANDLE_VALUE;
|
1065
|
+
INPUT_RECORD record;
|
1066
|
+
DWORD written;
|
1067
|
+
DWORD err = 0;
|
1068
|
+
LONG status;
|
1069
|
+
|
1070
|
+
assert(!(handle->flags & UV_HANDLE_CANCELLATION_PENDING));
|
1071
|
+
|
1072
|
+
/* Hold the output lock during the cancellation, to ensure that further
|
1073
|
+
writes don't interfere with the screen state. It will be the ReadConsole
|
1074
|
+
thread's responsibility to release the lock. */
|
1075
|
+
uv_sem_wait(&uv_tty_output_lock);
|
1076
|
+
status = InterlockedExchange(&uv__read_console_status, TRAP_REQUESTED);
|
1077
|
+
if (status != IN_PROGRESS) {
|
1078
|
+
/* Either we have managed to set a trap for the other thread before
|
1079
|
+
ReadConsole is called, or ReadConsole has returned because the user
|
1080
|
+
has pressed ENTER. In either case, there is nothing else to do. */
|
1081
|
+
uv_sem_post(&uv_tty_output_lock);
|
1082
|
+
return 0;
|
1083
|
+
}
|
1084
|
+
|
1085
|
+
/* Save screen state before sending the VK_RETURN event */
|
1086
|
+
active_screen_buffer = CreateFileA("conout$",
|
1087
|
+
GENERIC_READ | GENERIC_WRITE,
|
1088
|
+
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
1089
|
+
NULL,
|
1090
|
+
OPEN_EXISTING,
|
1091
|
+
FILE_ATTRIBUTE_NORMAL,
|
1092
|
+
NULL);
|
1093
|
+
|
1094
|
+
if (active_screen_buffer != INVALID_HANDLE_VALUE &&
|
1095
|
+
GetConsoleScreenBufferInfo(active_screen_buffer,
|
1096
|
+
&uv__saved_screen_state)) {
|
1097
|
+
InterlockedOr(&uv__restore_screen_state, 1);
|
1098
|
+
}
|
1099
|
+
|
1100
|
+
/* Write enter key event to force the console wait to return. */
|
1101
|
+
record.EventType = KEY_EVENT;
|
1102
|
+
record.Event.KeyEvent.bKeyDown = TRUE;
|
1103
|
+
record.Event.KeyEvent.wRepeatCount = 1;
|
1104
|
+
record.Event.KeyEvent.wVirtualKeyCode = VK_RETURN;
|
1105
|
+
record.Event.KeyEvent.wVirtualScanCode =
|
1106
|
+
MapVirtualKeyW(VK_RETURN, MAPVK_VK_TO_VSC);
|
1107
|
+
record.Event.KeyEvent.uChar.UnicodeChar = L'\r';
|
1108
|
+
record.Event.KeyEvent.dwControlKeyState = 0;
|
1109
|
+
if (!WriteConsoleInputW(handle->handle, &record, 1, &written))
|
1110
|
+
err = GetLastError();
|
1111
|
+
|
1112
|
+
if (active_screen_buffer != INVALID_HANDLE_VALUE)
|
1113
|
+
CloseHandle(active_screen_buffer);
|
1114
|
+
|
1115
|
+
return err;
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
|
1119
|
+
static void uv_tty_update_virtual_window(CONSOLE_SCREEN_BUFFER_INFO* info) {
|
1120
|
+
uv_tty_virtual_width = info->dwSize.X;
|
1121
|
+
uv_tty_virtual_height = info->srWindow.Bottom - info->srWindow.Top + 1;
|
1122
|
+
|
1123
|
+
/* Recompute virtual window offset row. */
|
1124
|
+
if (uv_tty_virtual_offset == -1) {
|
1125
|
+
uv_tty_virtual_offset = info->dwCursorPosition.Y;
|
1126
|
+
} else if (uv_tty_virtual_offset < info->dwCursorPosition.Y -
|
1127
|
+
uv_tty_virtual_height + 1) {
|
1128
|
+
/* If suddenly find the cursor outside of the virtual window, it must have
|
1129
|
+
* somehow scrolled. Update the virtual window offset. */
|
1130
|
+
uv_tty_virtual_offset = info->dwCursorPosition.Y -
|
1131
|
+
uv_tty_virtual_height + 1;
|
1132
|
+
}
|
1133
|
+
if (uv_tty_virtual_offset + uv_tty_virtual_height > info->dwSize.Y) {
|
1134
|
+
uv_tty_virtual_offset = info->dwSize.Y - uv_tty_virtual_height;
|
1135
|
+
}
|
1136
|
+
if (uv_tty_virtual_offset < 0) {
|
1137
|
+
uv_tty_virtual_offset = 0;
|
1138
|
+
}
|
1139
|
+
}
|
1140
|
+
|
1141
|
+
|
1142
|
+
static COORD uv_tty_make_real_coord(uv_tty_t* handle,
|
1143
|
+
CONSOLE_SCREEN_BUFFER_INFO* info, int x, unsigned char x_relative, int y,
|
1144
|
+
unsigned char y_relative) {
|
1145
|
+
COORD result;
|
1146
|
+
|
1147
|
+
uv_tty_update_virtual_window(info);
|
1148
|
+
|
1149
|
+
/* Adjust y position */
|
1150
|
+
if (y_relative) {
|
1151
|
+
y = info->dwCursorPosition.Y + y;
|
1152
|
+
} else {
|
1153
|
+
y = uv_tty_virtual_offset + y;
|
1154
|
+
}
|
1155
|
+
/* Clip y to virtual client rectangle */
|
1156
|
+
if (y < uv_tty_virtual_offset) {
|
1157
|
+
y = uv_tty_virtual_offset;
|
1158
|
+
} else if (y >= uv_tty_virtual_offset + uv_tty_virtual_height) {
|
1159
|
+
y = uv_tty_virtual_offset + uv_tty_virtual_height - 1;
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
/* Adjust x */
|
1163
|
+
if (x_relative) {
|
1164
|
+
x = info->dwCursorPosition.X + x;
|
1165
|
+
}
|
1166
|
+
/* Clip x */
|
1167
|
+
if (x < 0) {
|
1168
|
+
x = 0;
|
1169
|
+
} else if (x >= uv_tty_virtual_width) {
|
1170
|
+
x = uv_tty_virtual_width - 1;
|
1171
|
+
}
|
1172
|
+
|
1173
|
+
result.X = (unsigned short) x;
|
1174
|
+
result.Y = (unsigned short) y;
|
1175
|
+
return result;
|
1176
|
+
}
|
1177
|
+
|
1178
|
+
|
1179
|
+
static int uv_tty_emit_text(uv_tty_t* handle, WCHAR buffer[], DWORD length,
|
1180
|
+
DWORD* error) {
|
1181
|
+
DWORD written;
|
1182
|
+
|
1183
|
+
if (*error != ERROR_SUCCESS) {
|
1184
|
+
return -1;
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
if (!WriteConsoleW(handle->handle,
|
1188
|
+
(void*) buffer,
|
1189
|
+
length,
|
1190
|
+
&written,
|
1191
|
+
NULL)) {
|
1192
|
+
*error = GetLastError();
|
1193
|
+
return -1;
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
return 0;
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
|
1200
|
+
static int uv_tty_move_caret(uv_tty_t* handle, int x, unsigned char x_relative,
|
1201
|
+
int y, unsigned char y_relative, DWORD* error) {
|
1202
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
1203
|
+
COORD pos;
|
1204
|
+
|
1205
|
+
if (*error != ERROR_SUCCESS) {
|
1206
|
+
return -1;
|
1207
|
+
}
|
1208
|
+
|
1209
|
+
retry:
|
1210
|
+
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
|
1211
|
+
*error = GetLastError();
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
pos = uv_tty_make_real_coord(handle, &info, x, x_relative, y, y_relative);
|
1215
|
+
|
1216
|
+
if (!SetConsoleCursorPosition(handle->handle, pos)) {
|
1217
|
+
if (GetLastError() == ERROR_INVALID_PARAMETER) {
|
1218
|
+
/* The console may be resized - retry */
|
1219
|
+
goto retry;
|
1220
|
+
} else {
|
1221
|
+
*error = GetLastError();
|
1222
|
+
return -1;
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
return 0;
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
|
1230
|
+
static int uv_tty_reset(uv_tty_t* handle, DWORD* error) {
|
1231
|
+
const COORD origin = {0, 0};
|
1232
|
+
const WORD char_attrs = uv_tty_default_text_attributes;
|
1233
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
1234
|
+
DWORD count, written;
|
1235
|
+
|
1236
|
+
if (*error != ERROR_SUCCESS) {
|
1237
|
+
return -1;
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
/* Reset original text attributes. */
|
1241
|
+
if (!SetConsoleTextAttribute(handle->handle, char_attrs)) {
|
1242
|
+
*error = GetLastError();
|
1243
|
+
return -1;
|
1244
|
+
}
|
1245
|
+
|
1246
|
+
/* Move the cursor position to (0, 0). */
|
1247
|
+
if (!SetConsoleCursorPosition(handle->handle, origin)) {
|
1248
|
+
*error = GetLastError();
|
1249
|
+
return -1;
|
1250
|
+
}
|
1251
|
+
|
1252
|
+
/* Clear the screen buffer. */
|
1253
|
+
retry:
|
1254
|
+
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
|
1255
|
+
*error = GetLastError();
|
1256
|
+
return -1;
|
1257
|
+
}
|
1258
|
+
|
1259
|
+
count = info.dwSize.X * info.dwSize.Y;
|
1260
|
+
|
1261
|
+
if (!(FillConsoleOutputCharacterW(handle->handle,
|
1262
|
+
L'\x20',
|
1263
|
+
count,
|
1264
|
+
origin,
|
1265
|
+
&written) &&
|
1266
|
+
FillConsoleOutputAttribute(handle->handle,
|
1267
|
+
char_attrs,
|
1268
|
+
written,
|
1269
|
+
origin,
|
1270
|
+
&written))) {
|
1271
|
+
if (GetLastError() == ERROR_INVALID_PARAMETER) {
|
1272
|
+
/* The console may be resized - retry */
|
1273
|
+
goto retry;
|
1274
|
+
} else {
|
1275
|
+
*error = GetLastError();
|
1276
|
+
return -1;
|
1277
|
+
}
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
/* Move the virtual window up to the top. */
|
1281
|
+
uv_tty_virtual_offset = 0;
|
1282
|
+
uv_tty_update_virtual_window(&info);
|
1283
|
+
|
1284
|
+
return 0;
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
|
1288
|
+
static int uv_tty_clear(uv_tty_t* handle, int dir, char entire_screen,
|
1289
|
+
DWORD* error) {
|
1290
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
1291
|
+
COORD start, end;
|
1292
|
+
DWORD count, written;
|
1293
|
+
|
1294
|
+
int x1, x2, y1, y2;
|
1295
|
+
int x1r, x2r, y1r, y2r;
|
1296
|
+
|
1297
|
+
if (*error != ERROR_SUCCESS) {
|
1298
|
+
return -1;
|
1299
|
+
}
|
1300
|
+
|
1301
|
+
if (dir == 0) {
|
1302
|
+
/* Clear from current position */
|
1303
|
+
x1 = 0;
|
1304
|
+
x1r = 1;
|
1305
|
+
} else {
|
1306
|
+
/* Clear from column 0 */
|
1307
|
+
x1 = 0;
|
1308
|
+
x1r = 0;
|
1309
|
+
}
|
1310
|
+
|
1311
|
+
if (dir == 1) {
|
1312
|
+
/* Clear to current position */
|
1313
|
+
x2 = 0;
|
1314
|
+
x2r = 1;
|
1315
|
+
} else {
|
1316
|
+
/* Clear to end of row. We pretend the console is 65536 characters wide,
|
1317
|
+
* uv_tty_make_real_coord will clip it to the actual console width. */
|
1318
|
+
x2 = 0xffff;
|
1319
|
+
x2r = 0;
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
if (!entire_screen) {
|
1323
|
+
/* Stay on our own row */
|
1324
|
+
y1 = y2 = 0;
|
1325
|
+
y1r = y2r = 1;
|
1326
|
+
} else {
|
1327
|
+
/* Apply columns direction to row */
|
1328
|
+
y1 = x1;
|
1329
|
+
y1r = x1r;
|
1330
|
+
y2 = x2;
|
1331
|
+
y2r = x2r;
|
1332
|
+
}
|
1333
|
+
|
1334
|
+
retry:
|
1335
|
+
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
|
1336
|
+
*error = GetLastError();
|
1337
|
+
return -1;
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
start = uv_tty_make_real_coord(handle, &info, x1, x1r, y1, y1r);
|
1341
|
+
end = uv_tty_make_real_coord(handle, &info, x2, x2r, y2, y2r);
|
1342
|
+
count = (end.Y * info.dwSize.X + end.X) -
|
1343
|
+
(start.Y * info.dwSize.X + start.X) + 1;
|
1344
|
+
|
1345
|
+
if (!(FillConsoleOutputCharacterW(handle->handle,
|
1346
|
+
L'\x20',
|
1347
|
+
count,
|
1348
|
+
start,
|
1349
|
+
&written) &&
|
1350
|
+
FillConsoleOutputAttribute(handle->handle,
|
1351
|
+
info.wAttributes,
|
1352
|
+
written,
|
1353
|
+
start,
|
1354
|
+
&written))) {
|
1355
|
+
if (GetLastError() == ERROR_INVALID_PARAMETER) {
|
1356
|
+
/* The console may be resized - retry */
|
1357
|
+
goto retry;
|
1358
|
+
} else {
|
1359
|
+
*error = GetLastError();
|
1360
|
+
return -1;
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
return 0;
|
1365
|
+
}
|
1366
|
+
|
1367
|
+
#define FLIP_FGBG \
|
1368
|
+
do { \
|
1369
|
+
WORD fg = info.wAttributes & 0xF; \
|
1370
|
+
WORD bg = info.wAttributes & 0xF0; \
|
1371
|
+
info.wAttributes &= 0xFF00; \
|
1372
|
+
info.wAttributes |= fg << 4; \
|
1373
|
+
info.wAttributes |= bg >> 4; \
|
1374
|
+
} while (0)
|
1375
|
+
|
1376
|
+
static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) {
|
1377
|
+
unsigned short argc = handle->tty.wr.ansi_csi_argc;
|
1378
|
+
unsigned short* argv = handle->tty.wr.ansi_csi_argv;
|
1379
|
+
int i;
|
1380
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
1381
|
+
|
1382
|
+
char fg_color = -1, bg_color = -1;
|
1383
|
+
char fg_bright = -1, bg_bright = -1;
|
1384
|
+
char inverse = -1;
|
1385
|
+
|
1386
|
+
if (argc == 0) {
|
1387
|
+
/* Reset mode */
|
1388
|
+
fg_color = uv_tty_default_fg_color;
|
1389
|
+
bg_color = uv_tty_default_bg_color;
|
1390
|
+
fg_bright = uv_tty_default_fg_bright;
|
1391
|
+
bg_bright = uv_tty_default_bg_bright;
|
1392
|
+
inverse = uv_tty_default_inverse;
|
1393
|
+
}
|
1394
|
+
|
1395
|
+
for (i = 0; i < argc; i++) {
|
1396
|
+
short arg = argv[i];
|
1397
|
+
|
1398
|
+
if (arg == 0) {
|
1399
|
+
/* Reset mode */
|
1400
|
+
fg_color = uv_tty_default_fg_color;
|
1401
|
+
bg_color = uv_tty_default_bg_color;
|
1402
|
+
fg_bright = uv_tty_default_fg_bright;
|
1403
|
+
bg_bright = uv_tty_default_bg_bright;
|
1404
|
+
inverse = uv_tty_default_inverse;
|
1405
|
+
|
1406
|
+
} else if (arg == 1) {
|
1407
|
+
/* Foreground bright on */
|
1408
|
+
fg_bright = 1;
|
1409
|
+
|
1410
|
+
} else if (arg == 2) {
|
1411
|
+
/* Both bright off */
|
1412
|
+
fg_bright = 0;
|
1413
|
+
bg_bright = 0;
|
1414
|
+
|
1415
|
+
} else if (arg == 5) {
|
1416
|
+
/* Background bright on */
|
1417
|
+
bg_bright = 1;
|
1418
|
+
|
1419
|
+
} else if (arg == 7) {
|
1420
|
+
/* Inverse: on */
|
1421
|
+
inverse = 1;
|
1422
|
+
|
1423
|
+
} else if (arg == 21 || arg == 22) {
|
1424
|
+
/* Foreground bright off */
|
1425
|
+
fg_bright = 0;
|
1426
|
+
|
1427
|
+
} else if (arg == 25) {
|
1428
|
+
/* Background bright off */
|
1429
|
+
bg_bright = 0;
|
1430
|
+
|
1431
|
+
} else if (arg == 27) {
|
1432
|
+
/* Inverse: off */
|
1433
|
+
inverse = 0;
|
1434
|
+
|
1435
|
+
} else if (arg >= 30 && arg <= 37) {
|
1436
|
+
/* Set foreground color */
|
1437
|
+
fg_color = arg - 30;
|
1438
|
+
|
1439
|
+
} else if (arg == 39) {
|
1440
|
+
/* Default text color */
|
1441
|
+
fg_color = uv_tty_default_fg_color;
|
1442
|
+
fg_bright = uv_tty_default_fg_bright;
|
1443
|
+
|
1444
|
+
} else if (arg >= 40 && arg <= 47) {
|
1445
|
+
/* Set background color */
|
1446
|
+
bg_color = arg - 40;
|
1447
|
+
|
1448
|
+
} else if (arg == 49) {
|
1449
|
+
/* Default background color */
|
1450
|
+
bg_color = uv_tty_default_bg_color;
|
1451
|
+
bg_bright = uv_tty_default_bg_bright;
|
1452
|
+
|
1453
|
+
} else if (arg >= 90 && arg <= 97) {
|
1454
|
+
/* Set bold foreground color */
|
1455
|
+
fg_bright = 1;
|
1456
|
+
fg_color = arg - 90;
|
1457
|
+
|
1458
|
+
} else if (arg >= 100 && arg <= 107) {
|
1459
|
+
/* Set bold background color */
|
1460
|
+
bg_bright = 1;
|
1461
|
+
bg_color = arg - 100;
|
1462
|
+
|
1463
|
+
}
|
1464
|
+
}
|
1465
|
+
|
1466
|
+
if (fg_color == -1 && bg_color == -1 && fg_bright == -1 &&
|
1467
|
+
bg_bright == -1 && inverse == -1) {
|
1468
|
+
/* Nothing changed */
|
1469
|
+
return 0;
|
1470
|
+
}
|
1471
|
+
|
1472
|
+
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
|
1473
|
+
*error = GetLastError();
|
1474
|
+
return -1;
|
1475
|
+
}
|
1476
|
+
|
1477
|
+
if ((info.wAttributes & COMMON_LVB_REVERSE_VIDEO) > 0) {
|
1478
|
+
FLIP_FGBG;
|
1479
|
+
}
|
1480
|
+
|
1481
|
+
if (fg_color != -1) {
|
1482
|
+
info.wAttributes &= ~(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
|
1483
|
+
if (fg_color & 1) info.wAttributes |= FOREGROUND_RED;
|
1484
|
+
if (fg_color & 2) info.wAttributes |= FOREGROUND_GREEN;
|
1485
|
+
if (fg_color & 4) info.wAttributes |= FOREGROUND_BLUE;
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
if (fg_bright != -1) {
|
1489
|
+
if (fg_bright) {
|
1490
|
+
info.wAttributes |= FOREGROUND_INTENSITY;
|
1491
|
+
} else {
|
1492
|
+
info.wAttributes &= ~FOREGROUND_INTENSITY;
|
1493
|
+
}
|
1494
|
+
}
|
1495
|
+
|
1496
|
+
if (bg_color != -1) {
|
1497
|
+
info.wAttributes &= ~(BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE);
|
1498
|
+
if (bg_color & 1) info.wAttributes |= BACKGROUND_RED;
|
1499
|
+
if (bg_color & 2) info.wAttributes |= BACKGROUND_GREEN;
|
1500
|
+
if (bg_color & 4) info.wAttributes |= BACKGROUND_BLUE;
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
if (bg_bright != -1) {
|
1504
|
+
if (bg_bright) {
|
1505
|
+
info.wAttributes |= BACKGROUND_INTENSITY;
|
1506
|
+
} else {
|
1507
|
+
info.wAttributes &= ~BACKGROUND_INTENSITY;
|
1508
|
+
}
|
1509
|
+
}
|
1510
|
+
|
1511
|
+
if (inverse != -1) {
|
1512
|
+
if (inverse) {
|
1513
|
+
info.wAttributes |= COMMON_LVB_REVERSE_VIDEO;
|
1514
|
+
} else {
|
1515
|
+
info.wAttributes &= ~COMMON_LVB_REVERSE_VIDEO;
|
1516
|
+
}
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
if ((info.wAttributes & COMMON_LVB_REVERSE_VIDEO) > 0) {
|
1520
|
+
FLIP_FGBG;
|
1521
|
+
}
|
1522
|
+
|
1523
|
+
if (!SetConsoleTextAttribute(handle->handle, info.wAttributes)) {
|
1524
|
+
*error = GetLastError();
|
1525
|
+
return -1;
|
1526
|
+
}
|
1527
|
+
|
1528
|
+
return 0;
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
|
1532
|
+
static int uv_tty_save_state(uv_tty_t* handle, unsigned char save_attributes,
|
1533
|
+
DWORD* error) {
|
1534
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
1535
|
+
|
1536
|
+
if (*error != ERROR_SUCCESS) {
|
1537
|
+
return -1;
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
|
1541
|
+
*error = GetLastError();
|
1542
|
+
return -1;
|
1543
|
+
}
|
1544
|
+
|
1545
|
+
uv_tty_update_virtual_window(&info);
|
1546
|
+
|
1547
|
+
handle->tty.wr.saved_position.X = info.dwCursorPosition.X;
|
1548
|
+
handle->tty.wr.saved_position.Y = info.dwCursorPosition.Y - uv_tty_virtual_offset;
|
1549
|
+
handle->flags |= UV_HANDLE_TTY_SAVED_POSITION;
|
1550
|
+
|
1551
|
+
if (save_attributes) {
|
1552
|
+
handle->tty.wr.saved_attributes = info.wAttributes &
|
1553
|
+
(FOREGROUND_INTENSITY | BACKGROUND_INTENSITY);
|
1554
|
+
handle->flags |= UV_HANDLE_TTY_SAVED_ATTRIBUTES;
|
1555
|
+
}
|
1556
|
+
|
1557
|
+
return 0;
|
1558
|
+
}
|
1559
|
+
|
1560
|
+
|
1561
|
+
static int uv_tty_restore_state(uv_tty_t* handle,
|
1562
|
+
unsigned char restore_attributes, DWORD* error) {
|
1563
|
+
CONSOLE_SCREEN_BUFFER_INFO info;
|
1564
|
+
WORD new_attributes;
|
1565
|
+
|
1566
|
+
if (*error != ERROR_SUCCESS) {
|
1567
|
+
return -1;
|
1568
|
+
}
|
1569
|
+
|
1570
|
+
if (handle->flags & UV_HANDLE_TTY_SAVED_POSITION) {
|
1571
|
+
if (uv_tty_move_caret(handle,
|
1572
|
+
handle->tty.wr.saved_position.X,
|
1573
|
+
0,
|
1574
|
+
handle->tty.wr.saved_position.Y,
|
1575
|
+
0,
|
1576
|
+
error) != 0) {
|
1577
|
+
return -1;
|
1578
|
+
}
|
1579
|
+
}
|
1580
|
+
|
1581
|
+
if (restore_attributes &&
|
1582
|
+
(handle->flags & UV_HANDLE_TTY_SAVED_ATTRIBUTES)) {
|
1583
|
+
if (!GetConsoleScreenBufferInfo(handle->handle, &info)) {
|
1584
|
+
*error = GetLastError();
|
1585
|
+
return -1;
|
1586
|
+
}
|
1587
|
+
|
1588
|
+
new_attributes = info.wAttributes;
|
1589
|
+
new_attributes &= ~(FOREGROUND_INTENSITY | BACKGROUND_INTENSITY);
|
1590
|
+
new_attributes |= handle->tty.wr.saved_attributes;
|
1591
|
+
|
1592
|
+
if (!SetConsoleTextAttribute(handle->handle, new_attributes)) {
|
1593
|
+
*error = GetLastError();
|
1594
|
+
return -1;
|
1595
|
+
}
|
1596
|
+
}
|
1597
|
+
|
1598
|
+
return 0;
|
1599
|
+
}
|
1600
|
+
|
1601
|
+
static int uv_tty_set_cursor_visibility(uv_tty_t* handle,
|
1602
|
+
BOOL visible,
|
1603
|
+
DWORD* error) {
|
1604
|
+
CONSOLE_CURSOR_INFO cursor_info;
|
1605
|
+
|
1606
|
+
if (!GetConsoleCursorInfo(handle->handle, &cursor_info)) {
|
1607
|
+
*error = GetLastError();
|
1608
|
+
return -1;
|
1609
|
+
}
|
1610
|
+
|
1611
|
+
cursor_info.bVisible = visible;
|
1612
|
+
|
1613
|
+
if (!SetConsoleCursorInfo(handle->handle, &cursor_info)) {
|
1614
|
+
*error = GetLastError();
|
1615
|
+
return -1;
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
return 0;
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
static int uv_tty_write_bufs(uv_tty_t* handle,
|
1622
|
+
const uv_buf_t bufs[],
|
1623
|
+
unsigned int nbufs,
|
1624
|
+
DWORD* error) {
|
1625
|
+
/* We can only write 8k characters at a time. Windows can't handle much more
|
1626
|
+
* characters in a single console write anyway. */
|
1627
|
+
WCHAR utf16_buf[MAX_CONSOLE_CHAR];
|
1628
|
+
DWORD utf16_buf_used = 0;
|
1629
|
+
unsigned int i;
|
1630
|
+
|
1631
|
+
#define FLUSH_TEXT() \
|
1632
|
+
do { \
|
1633
|
+
if (utf16_buf_used > 0) { \
|
1634
|
+
uv_tty_emit_text(handle, utf16_buf, utf16_buf_used, error); \
|
1635
|
+
utf16_buf_used = 0; \
|
1636
|
+
} \
|
1637
|
+
} while (0)
|
1638
|
+
|
1639
|
+
#define ENSURE_BUFFER_SPACE(wchars_needed) \
|
1640
|
+
if (wchars_needed > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { \
|
1641
|
+
FLUSH_TEXT(); \
|
1642
|
+
}
|
1643
|
+
|
1644
|
+
/* Cache for fast access */
|
1645
|
+
unsigned char utf8_bytes_left = handle->tty.wr.utf8_bytes_left;
|
1646
|
+
unsigned int utf8_codepoint = handle->tty.wr.utf8_codepoint;
|
1647
|
+
unsigned char previous_eol = handle->tty.wr.previous_eol;
|
1648
|
+
unsigned char ansi_parser_state = handle->tty.wr.ansi_parser_state;
|
1649
|
+
|
1650
|
+
/* Store the error here. If we encounter an error, stop trying to do i/o but
|
1651
|
+
* keep parsing the buffer so we leave the parser in a consistent state. */
|
1652
|
+
*error = ERROR_SUCCESS;
|
1653
|
+
|
1654
|
+
uv_sem_wait(&uv_tty_output_lock);
|
1655
|
+
|
1656
|
+
for (i = 0; i < nbufs; i++) {
|
1657
|
+
uv_buf_t buf = bufs[i];
|
1658
|
+
unsigned int j;
|
1659
|
+
|
1660
|
+
for (j = 0; j < buf.len; j++) {
|
1661
|
+
unsigned char c = buf.base[j];
|
1662
|
+
|
1663
|
+
/* Run the character through the utf8 decoder We happily accept non
|
1664
|
+
* shortest form encodings and invalid code points - there's no real harm
|
1665
|
+
* that can be done. */
|
1666
|
+
if (utf8_bytes_left == 0) {
|
1667
|
+
/* Read utf-8 start byte */
|
1668
|
+
DWORD first_zero_bit;
|
1669
|
+
unsigned char not_c = ~c;
|
1670
|
+
#ifdef _MSC_VER /* msvc */
|
1671
|
+
if (_BitScanReverse(&first_zero_bit, not_c)) {
|
1672
|
+
#else /* assume gcc */
|
1673
|
+
if (c != 0) {
|
1674
|
+
first_zero_bit = (sizeof(int) * 8) - 1 - __builtin_clz(not_c);
|
1675
|
+
#endif
|
1676
|
+
if (first_zero_bit == 7) {
|
1677
|
+
/* Ascii - pass right through */
|
1678
|
+
utf8_codepoint = (unsigned int) c;
|
1679
|
+
|
1680
|
+
} else if (first_zero_bit <= 5) {
|
1681
|
+
/* Multibyte sequence */
|
1682
|
+
utf8_codepoint = (0xff >> (8 - first_zero_bit)) & c;
|
1683
|
+
utf8_bytes_left = (char) (6 - first_zero_bit);
|
1684
|
+
|
1685
|
+
} else {
|
1686
|
+
/* Invalid continuation */
|
1687
|
+
utf8_codepoint = UNICODE_REPLACEMENT_CHARACTER;
|
1688
|
+
}
|
1689
|
+
|
1690
|
+
} else {
|
1691
|
+
/* 0xff -- invalid */
|
1692
|
+
utf8_codepoint = UNICODE_REPLACEMENT_CHARACTER;
|
1693
|
+
}
|
1694
|
+
|
1695
|
+
} else if ((c & 0xc0) == 0x80) {
|
1696
|
+
/* Valid continuation of utf-8 multibyte sequence */
|
1697
|
+
utf8_bytes_left--;
|
1698
|
+
utf8_codepoint <<= 6;
|
1699
|
+
utf8_codepoint |= ((unsigned int) c & 0x3f);
|
1700
|
+
|
1701
|
+
} else {
|
1702
|
+
/* Start byte where continuation was expected. */
|
1703
|
+
utf8_bytes_left = 0;
|
1704
|
+
utf8_codepoint = UNICODE_REPLACEMENT_CHARACTER;
|
1705
|
+
/* Patch buf offset so this character will be parsed again as a start
|
1706
|
+
* byte. */
|
1707
|
+
j--;
|
1708
|
+
}
|
1709
|
+
|
1710
|
+
/* Maybe we need to parse more bytes to find a character. */
|
1711
|
+
if (utf8_bytes_left != 0) {
|
1712
|
+
continue;
|
1713
|
+
}
|
1714
|
+
|
1715
|
+
/* Parse vt100/ansi escape codes */
|
1716
|
+
if (uv__vterm_state == UV_TTY_SUPPORTED) {
|
1717
|
+
/* Pass through escape codes if conhost supports them. */
|
1718
|
+
} else if (ansi_parser_state == ANSI_NORMAL) {
|
1719
|
+
switch (utf8_codepoint) {
|
1720
|
+
case '\033':
|
1721
|
+
ansi_parser_state = ANSI_ESCAPE_SEEN;
|
1722
|
+
continue;
|
1723
|
+
|
1724
|
+
case 0233:
|
1725
|
+
ansi_parser_state = ANSI_CSI;
|
1726
|
+
handle->tty.wr.ansi_csi_argc = 0;
|
1727
|
+
continue;
|
1728
|
+
}
|
1729
|
+
|
1730
|
+
} else if (ansi_parser_state == ANSI_ESCAPE_SEEN) {
|
1731
|
+
switch (utf8_codepoint) {
|
1732
|
+
case '[':
|
1733
|
+
ansi_parser_state = ANSI_CSI;
|
1734
|
+
handle->tty.wr.ansi_csi_argc = 0;
|
1735
|
+
continue;
|
1736
|
+
|
1737
|
+
case '^':
|
1738
|
+
case '_':
|
1739
|
+
case 'P':
|
1740
|
+
case ']':
|
1741
|
+
/* Not supported, but we'll have to parse until we see a stop code,
|
1742
|
+
* e. g. ESC \ or BEL. */
|
1743
|
+
ansi_parser_state = ANSI_ST_CONTROL;
|
1744
|
+
continue;
|
1745
|
+
|
1746
|
+
case '\033':
|
1747
|
+
/* Ignore double escape. */
|
1748
|
+
continue;
|
1749
|
+
|
1750
|
+
case 'c':
|
1751
|
+
/* Full console reset. */
|
1752
|
+
FLUSH_TEXT();
|
1753
|
+
uv_tty_reset(handle, error);
|
1754
|
+
ansi_parser_state = ANSI_NORMAL;
|
1755
|
+
continue;
|
1756
|
+
|
1757
|
+
case '7':
|
1758
|
+
/* Save the cursor position and text attributes. */
|
1759
|
+
FLUSH_TEXT();
|
1760
|
+
uv_tty_save_state(handle, 1, error);
|
1761
|
+
ansi_parser_state = ANSI_NORMAL;
|
1762
|
+
continue;
|
1763
|
+
|
1764
|
+
case '8':
|
1765
|
+
/* Restore the cursor position and text attributes */
|
1766
|
+
FLUSH_TEXT();
|
1767
|
+
uv_tty_restore_state(handle, 1, error);
|
1768
|
+
ansi_parser_state = ANSI_NORMAL;
|
1769
|
+
continue;
|
1770
|
+
|
1771
|
+
default:
|
1772
|
+
if (utf8_codepoint >= '@' && utf8_codepoint <= '_') {
|
1773
|
+
/* Single-char control. */
|
1774
|
+
ansi_parser_state = ANSI_NORMAL;
|
1775
|
+
continue;
|
1776
|
+
} else {
|
1777
|
+
/* Invalid - proceed as normal, */
|
1778
|
+
ansi_parser_state = ANSI_NORMAL;
|
1779
|
+
}
|
1780
|
+
}
|
1781
|
+
|
1782
|
+
} else if (ansi_parser_state & ANSI_CSI) {
|
1783
|
+
if (!(ansi_parser_state & ANSI_IGNORE)) {
|
1784
|
+
if (utf8_codepoint >= '0' && utf8_codepoint <= '9') {
|
1785
|
+
/* Parsing a numerical argument */
|
1786
|
+
|
1787
|
+
if (!(ansi_parser_state & ANSI_IN_ARG)) {
|
1788
|
+
/* We were not currently parsing a number */
|
1789
|
+
|
1790
|
+
/* Check for too many arguments */
|
1791
|
+
if (handle->tty.wr.ansi_csi_argc >= ARRAY_SIZE(handle->tty.wr.ansi_csi_argv)) {
|
1792
|
+
ansi_parser_state |= ANSI_IGNORE;
|
1793
|
+
continue;
|
1794
|
+
}
|
1795
|
+
|
1796
|
+
ansi_parser_state |= ANSI_IN_ARG;
|
1797
|
+
handle->tty.wr.ansi_csi_argc++;
|
1798
|
+
handle->tty.wr.ansi_csi_argv[handle->tty.wr.ansi_csi_argc - 1] =
|
1799
|
+
(unsigned short) utf8_codepoint - '0';
|
1800
|
+
continue;
|
1801
|
+
} else {
|
1802
|
+
/* We were already parsing a number. Parse next digit. */
|
1803
|
+
uint32_t value = 10 *
|
1804
|
+
handle->tty.wr.ansi_csi_argv[handle->tty.wr.ansi_csi_argc - 1];
|
1805
|
+
|
1806
|
+
/* Check for overflow. */
|
1807
|
+
if (value > UINT16_MAX) {
|
1808
|
+
ansi_parser_state |= ANSI_IGNORE;
|
1809
|
+
continue;
|
1810
|
+
}
|
1811
|
+
|
1812
|
+
handle->tty.wr.ansi_csi_argv[handle->tty.wr.ansi_csi_argc - 1] =
|
1813
|
+
(unsigned short) value + (utf8_codepoint - '0');
|
1814
|
+
continue;
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
} else if (utf8_codepoint == ';') {
|
1818
|
+
/* Denotes the end of an argument. */
|
1819
|
+
if (ansi_parser_state & ANSI_IN_ARG) {
|
1820
|
+
ansi_parser_state &= ~ANSI_IN_ARG;
|
1821
|
+
continue;
|
1822
|
+
|
1823
|
+
} else {
|
1824
|
+
/* If ANSI_IN_ARG is not set, add another argument and default it
|
1825
|
+
* to 0. */
|
1826
|
+
|
1827
|
+
/* Check for too many arguments */
|
1828
|
+
if (handle->tty.wr.ansi_csi_argc >= ARRAY_SIZE(handle->tty.wr.ansi_csi_argv)) {
|
1829
|
+
ansi_parser_state |= ANSI_IGNORE;
|
1830
|
+
continue;
|
1831
|
+
}
|
1832
|
+
|
1833
|
+
handle->tty.wr.ansi_csi_argc++;
|
1834
|
+
handle->tty.wr.ansi_csi_argv[handle->tty.wr.ansi_csi_argc - 1] = 0;
|
1835
|
+
continue;
|
1836
|
+
}
|
1837
|
+
|
1838
|
+
} else if (utf8_codepoint == '?' && !(ansi_parser_state & ANSI_IN_ARG) &&
|
1839
|
+
handle->tty.wr.ansi_csi_argc == 0) {
|
1840
|
+
/* Ignores '?' if it is the first character after CSI[. This is an
|
1841
|
+
* extension character from the VT100 codeset that is supported and
|
1842
|
+
* used by most ANSI terminals today. */
|
1843
|
+
continue;
|
1844
|
+
|
1845
|
+
} else if (utf8_codepoint >= '@' && utf8_codepoint <= '~' &&
|
1846
|
+
(handle->tty.wr.ansi_csi_argc > 0 || utf8_codepoint != '[')) {
|
1847
|
+
int x, y, d;
|
1848
|
+
|
1849
|
+
/* Command byte */
|
1850
|
+
switch (utf8_codepoint) {
|
1851
|
+
case 'A':
|
1852
|
+
/* cursor up */
|
1853
|
+
FLUSH_TEXT();
|
1854
|
+
y = -(handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 1);
|
1855
|
+
uv_tty_move_caret(handle, 0, 1, y, 1, error);
|
1856
|
+
break;
|
1857
|
+
|
1858
|
+
case 'B':
|
1859
|
+
/* cursor down */
|
1860
|
+
FLUSH_TEXT();
|
1861
|
+
y = handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 1;
|
1862
|
+
uv_tty_move_caret(handle, 0, 1, y, 1, error);
|
1863
|
+
break;
|
1864
|
+
|
1865
|
+
case 'C':
|
1866
|
+
/* cursor forward */
|
1867
|
+
FLUSH_TEXT();
|
1868
|
+
x = handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 1;
|
1869
|
+
uv_tty_move_caret(handle, x, 1, 0, 1, error);
|
1870
|
+
break;
|
1871
|
+
|
1872
|
+
case 'D':
|
1873
|
+
/* cursor back */
|
1874
|
+
FLUSH_TEXT();
|
1875
|
+
x = -(handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 1);
|
1876
|
+
uv_tty_move_caret(handle, x, 1, 0, 1, error);
|
1877
|
+
break;
|
1878
|
+
|
1879
|
+
case 'E':
|
1880
|
+
/* cursor next line */
|
1881
|
+
FLUSH_TEXT();
|
1882
|
+
y = handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 1;
|
1883
|
+
uv_tty_move_caret(handle, 0, 0, y, 1, error);
|
1884
|
+
break;
|
1885
|
+
|
1886
|
+
case 'F':
|
1887
|
+
/* cursor previous line */
|
1888
|
+
FLUSH_TEXT();
|
1889
|
+
y = -(handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 1);
|
1890
|
+
uv_tty_move_caret(handle, 0, 0, y, 1, error);
|
1891
|
+
break;
|
1892
|
+
|
1893
|
+
case 'G':
|
1894
|
+
/* cursor horizontal move absolute */
|
1895
|
+
FLUSH_TEXT();
|
1896
|
+
x = (handle->tty.wr.ansi_csi_argc >= 1 && handle->tty.wr.ansi_csi_argv[0])
|
1897
|
+
? handle->tty.wr.ansi_csi_argv[0] - 1 : 0;
|
1898
|
+
uv_tty_move_caret(handle, x, 0, 0, 1, error);
|
1899
|
+
break;
|
1900
|
+
|
1901
|
+
case 'H':
|
1902
|
+
case 'f':
|
1903
|
+
/* cursor move absolute */
|
1904
|
+
FLUSH_TEXT();
|
1905
|
+
y = (handle->tty.wr.ansi_csi_argc >= 1 && handle->tty.wr.ansi_csi_argv[0])
|
1906
|
+
? handle->tty.wr.ansi_csi_argv[0] - 1 : 0;
|
1907
|
+
x = (handle->tty.wr.ansi_csi_argc >= 2 && handle->tty.wr.ansi_csi_argv[1])
|
1908
|
+
? handle->tty.wr.ansi_csi_argv[1] - 1 : 0;
|
1909
|
+
uv_tty_move_caret(handle, x, 0, y, 0, error);
|
1910
|
+
break;
|
1911
|
+
|
1912
|
+
case 'J':
|
1913
|
+
/* Erase screen */
|
1914
|
+
FLUSH_TEXT();
|
1915
|
+
d = handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 0;
|
1916
|
+
if (d >= 0 && d <= 2) {
|
1917
|
+
uv_tty_clear(handle, d, 1, error);
|
1918
|
+
}
|
1919
|
+
break;
|
1920
|
+
|
1921
|
+
case 'K':
|
1922
|
+
/* Erase line */
|
1923
|
+
FLUSH_TEXT();
|
1924
|
+
d = handle->tty.wr.ansi_csi_argc ? handle->tty.wr.ansi_csi_argv[0] : 0;
|
1925
|
+
if (d >= 0 && d <= 2) {
|
1926
|
+
uv_tty_clear(handle, d, 0, error);
|
1927
|
+
}
|
1928
|
+
break;
|
1929
|
+
|
1930
|
+
case 'm':
|
1931
|
+
/* Set style */
|
1932
|
+
FLUSH_TEXT();
|
1933
|
+
uv_tty_set_style(handle, error);
|
1934
|
+
break;
|
1935
|
+
|
1936
|
+
case 's':
|
1937
|
+
/* Save the cursor position. */
|
1938
|
+
FLUSH_TEXT();
|
1939
|
+
uv_tty_save_state(handle, 0, error);
|
1940
|
+
break;
|
1941
|
+
|
1942
|
+
case 'u':
|
1943
|
+
/* Restore the cursor position */
|
1944
|
+
FLUSH_TEXT();
|
1945
|
+
uv_tty_restore_state(handle, 0, error);
|
1946
|
+
break;
|
1947
|
+
|
1948
|
+
case 'l':
|
1949
|
+
/* Hide the cursor */
|
1950
|
+
if (handle->tty.wr.ansi_csi_argc == 1 &&
|
1951
|
+
handle->tty.wr.ansi_csi_argv[0] == 25) {
|
1952
|
+
FLUSH_TEXT();
|
1953
|
+
uv_tty_set_cursor_visibility(handle, 0, error);
|
1954
|
+
}
|
1955
|
+
break;
|
1956
|
+
|
1957
|
+
case 'h':
|
1958
|
+
/* Show the cursor */
|
1959
|
+
if (handle->tty.wr.ansi_csi_argc == 1 &&
|
1960
|
+
handle->tty.wr.ansi_csi_argv[0] == 25) {
|
1961
|
+
FLUSH_TEXT();
|
1962
|
+
uv_tty_set_cursor_visibility(handle, 1, error);
|
1963
|
+
}
|
1964
|
+
break;
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
/* Sequence ended - go back to normal state. */
|
1968
|
+
ansi_parser_state = ANSI_NORMAL;
|
1969
|
+
continue;
|
1970
|
+
|
1971
|
+
} else {
|
1972
|
+
/* We don't support commands that use private mode characters or
|
1973
|
+
* intermediaries. Ignore the rest of the sequence. */
|
1974
|
+
ansi_parser_state |= ANSI_IGNORE;
|
1975
|
+
continue;
|
1976
|
+
}
|
1977
|
+
} else {
|
1978
|
+
/* We're ignoring this command. Stop only on command character. */
|
1979
|
+
if (utf8_codepoint >= '@' && utf8_codepoint <= '~') {
|
1980
|
+
ansi_parser_state = ANSI_NORMAL;
|
1981
|
+
}
|
1982
|
+
continue;
|
1983
|
+
}
|
1984
|
+
|
1985
|
+
} else if (ansi_parser_state & ANSI_ST_CONTROL) {
|
1986
|
+
/* Unsupported control code.
|
1987
|
+
* Ignore everything until we see `BEL` or `ESC \`. */
|
1988
|
+
if (ansi_parser_state & ANSI_IN_STRING) {
|
1989
|
+
if (!(ansi_parser_state & ANSI_BACKSLASH_SEEN)) {
|
1990
|
+
if (utf8_codepoint == '"') {
|
1991
|
+
ansi_parser_state &= ~ANSI_IN_STRING;
|
1992
|
+
} else if (utf8_codepoint == '\\') {
|
1993
|
+
ansi_parser_state |= ANSI_BACKSLASH_SEEN;
|
1994
|
+
}
|
1995
|
+
} else {
|
1996
|
+
ansi_parser_state &= ~ANSI_BACKSLASH_SEEN;
|
1997
|
+
}
|
1998
|
+
} else {
|
1999
|
+
if (utf8_codepoint == '\007' || (utf8_codepoint == '\\' &&
|
2000
|
+
(ansi_parser_state & ANSI_ESCAPE_SEEN))) {
|
2001
|
+
/* End of sequence */
|
2002
|
+
ansi_parser_state = ANSI_NORMAL;
|
2003
|
+
} else if (utf8_codepoint == '\033') {
|
2004
|
+
/* Escape character */
|
2005
|
+
ansi_parser_state |= ANSI_ESCAPE_SEEN;
|
2006
|
+
} else if (utf8_codepoint == '"') {
|
2007
|
+
/* String starting */
|
2008
|
+
ansi_parser_state |= ANSI_IN_STRING;
|
2009
|
+
ansi_parser_state &= ~ANSI_ESCAPE_SEEN;
|
2010
|
+
ansi_parser_state &= ~ANSI_BACKSLASH_SEEN;
|
2011
|
+
} else {
|
2012
|
+
ansi_parser_state &= ~ANSI_ESCAPE_SEEN;
|
2013
|
+
}
|
2014
|
+
}
|
2015
|
+
continue;
|
2016
|
+
} else {
|
2017
|
+
/* Inconsistent state */
|
2018
|
+
abort();
|
2019
|
+
}
|
2020
|
+
|
2021
|
+
/* We wouldn't mind emitting utf-16 surrogate pairs. Too bad, the windows
|
2022
|
+
* console doesn't really support UTF-16, so just emit the replacement
|
2023
|
+
* character. */
|
2024
|
+
if (utf8_codepoint > 0xffff) {
|
2025
|
+
utf8_codepoint = UNICODE_REPLACEMENT_CHARACTER;
|
2026
|
+
}
|
2027
|
+
|
2028
|
+
if (utf8_codepoint == 0x0a || utf8_codepoint == 0x0d) {
|
2029
|
+
/* EOL conversion - emit \r\n when we see \n. */
|
2030
|
+
|
2031
|
+
if (utf8_codepoint == 0x0a && previous_eol != 0x0d) {
|
2032
|
+
/* \n was not preceded by \r; print \r\n. */
|
2033
|
+
ENSURE_BUFFER_SPACE(2);
|
2034
|
+
utf16_buf[utf16_buf_used++] = L'\r';
|
2035
|
+
utf16_buf[utf16_buf_used++] = L'\n';
|
2036
|
+
} else if (utf8_codepoint == 0x0d && previous_eol == 0x0a) {
|
2037
|
+
/* \n was followed by \r; do not print the \r, since the source was
|
2038
|
+
* either \r\n\r (so the second \r is redundant) or was \n\r (so the
|
2039
|
+
* \n was processed by the last case and an \r automatically
|
2040
|
+
* inserted). */
|
2041
|
+
} else {
|
2042
|
+
/* \r without \n; print \r as-is. */
|
2043
|
+
ENSURE_BUFFER_SPACE(1);
|
2044
|
+
utf16_buf[utf16_buf_used++] = (WCHAR) utf8_codepoint;
|
2045
|
+
}
|
2046
|
+
|
2047
|
+
previous_eol = (char) utf8_codepoint;
|
2048
|
+
|
2049
|
+
} else if (utf8_codepoint <= 0xffff) {
|
2050
|
+
/* Encode character into utf-16 buffer. */
|
2051
|
+
ENSURE_BUFFER_SPACE(1);
|
2052
|
+
utf16_buf[utf16_buf_used++] = (WCHAR) utf8_codepoint;
|
2053
|
+
previous_eol = 0;
|
2054
|
+
}
|
2055
|
+
}
|
2056
|
+
}
|
2057
|
+
|
2058
|
+
/* Flush remaining characters */
|
2059
|
+
FLUSH_TEXT();
|
2060
|
+
|
2061
|
+
/* Copy cached values back to struct. */
|
2062
|
+
handle->tty.wr.utf8_bytes_left = utf8_bytes_left;
|
2063
|
+
handle->tty.wr.utf8_codepoint = utf8_codepoint;
|
2064
|
+
handle->tty.wr.previous_eol = previous_eol;
|
2065
|
+
handle->tty.wr.ansi_parser_state = ansi_parser_state;
|
2066
|
+
|
2067
|
+
uv_sem_post(&uv_tty_output_lock);
|
2068
|
+
|
2069
|
+
if (*error == STATUS_SUCCESS) {
|
2070
|
+
return 0;
|
2071
|
+
} else {
|
2072
|
+
return -1;
|
2073
|
+
}
|
2074
|
+
|
2075
|
+
#undef FLUSH_TEXT
|
2076
|
+
}
|
2077
|
+
|
2078
|
+
|
2079
|
+
int uv_tty_write(uv_loop_t* loop,
|
2080
|
+
uv_write_t* req,
|
2081
|
+
uv_tty_t* handle,
|
2082
|
+
const uv_buf_t bufs[],
|
2083
|
+
unsigned int nbufs,
|
2084
|
+
uv_write_cb cb) {
|
2085
|
+
DWORD error;
|
2086
|
+
|
2087
|
+
UV_REQ_INIT(req, UV_WRITE);
|
2088
|
+
req->handle = (uv_stream_t*) handle;
|
2089
|
+
req->cb = cb;
|
2090
|
+
|
2091
|
+
handle->reqs_pending++;
|
2092
|
+
handle->stream.conn.write_reqs_pending++;
|
2093
|
+
REGISTER_HANDLE_REQ(loop, handle, req);
|
2094
|
+
|
2095
|
+
req->u.io.queued_bytes = 0;
|
2096
|
+
|
2097
|
+
if (!uv_tty_write_bufs(handle, bufs, nbufs, &error)) {
|
2098
|
+
SET_REQ_SUCCESS(req);
|
2099
|
+
} else {
|
2100
|
+
SET_REQ_ERROR(req, error);
|
2101
|
+
}
|
2102
|
+
|
2103
|
+
uv_insert_pending_req(loop, (uv_req_t*) req);
|
2104
|
+
|
2105
|
+
return 0;
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
|
2109
|
+
int uv__tty_try_write(uv_tty_t* handle,
|
2110
|
+
const uv_buf_t bufs[],
|
2111
|
+
unsigned int nbufs) {
|
2112
|
+
DWORD error;
|
2113
|
+
|
2114
|
+
if (handle->stream.conn.write_reqs_pending > 0)
|
2115
|
+
return UV_EAGAIN;
|
2116
|
+
|
2117
|
+
if (uv_tty_write_bufs(handle, bufs, nbufs, &error))
|
2118
|
+
return uv_translate_sys_error(error);
|
2119
|
+
|
2120
|
+
return uv__count_bufs(bufs, nbufs);
|
2121
|
+
}
|
2122
|
+
|
2123
|
+
|
2124
|
+
void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle,
|
2125
|
+
uv_write_t* req) {
|
2126
|
+
int err;
|
2127
|
+
|
2128
|
+
handle->write_queue_size -= req->u.io.queued_bytes;
|
2129
|
+
UNREGISTER_HANDLE_REQ(loop, handle, req);
|
2130
|
+
|
2131
|
+
if (req->cb) {
|
2132
|
+
err = GET_REQ_ERROR(req);
|
2133
|
+
req->cb(req, uv_translate_sys_error(err));
|
2134
|
+
}
|
2135
|
+
|
2136
|
+
handle->stream.conn.write_reqs_pending--;
|
2137
|
+
if (handle->stream.conn.shutdown_req != NULL &&
|
2138
|
+
handle->stream.conn.write_reqs_pending == 0) {
|
2139
|
+
uv_want_endgame(loop, (uv_handle_t*)handle);
|
2140
|
+
}
|
2141
|
+
|
2142
|
+
DECREASE_PENDING_REQ_COUNT(handle);
|
2143
|
+
}
|
2144
|
+
|
2145
|
+
|
2146
|
+
void uv_tty_close(uv_tty_t* handle) {
|
2147
|
+
assert(handle->u.fd == -1 || handle->u.fd > 2);
|
2148
|
+
if (handle->flags & UV_HANDLE_READING)
|
2149
|
+
uv_tty_read_stop(handle);
|
2150
|
+
|
2151
|
+
if (handle->u.fd == -1)
|
2152
|
+
CloseHandle(handle->handle);
|
2153
|
+
else
|
2154
|
+
close(handle->u.fd);
|
2155
|
+
|
2156
|
+
handle->u.fd = -1;
|
2157
|
+
handle->handle = INVALID_HANDLE_VALUE;
|
2158
|
+
handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
|
2159
|
+
uv__handle_closing(handle);
|
2160
|
+
|
2161
|
+
if (handle->reqs_pending == 0) {
|
2162
|
+
uv_want_endgame(handle->loop, (uv_handle_t*) handle);
|
2163
|
+
}
|
2164
|
+
}
|
2165
|
+
|
2166
|
+
|
2167
|
+
void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle) {
|
2168
|
+
if (!(handle->flags & UV_HANDLE_TTY_READABLE) &&
|
2169
|
+
handle->stream.conn.shutdown_req != NULL &&
|
2170
|
+
handle->stream.conn.write_reqs_pending == 0) {
|
2171
|
+
UNREGISTER_HANDLE_REQ(loop, handle, handle->stream.conn.shutdown_req);
|
2172
|
+
|
2173
|
+
/* TTY shutdown is really just a no-op */
|
2174
|
+
if (handle->stream.conn.shutdown_req->cb) {
|
2175
|
+
if (handle->flags & UV_HANDLE_CLOSING) {
|
2176
|
+
handle->stream.conn.shutdown_req->cb(handle->stream.conn.shutdown_req, UV_ECANCELED);
|
2177
|
+
} else {
|
2178
|
+
handle->stream.conn.shutdown_req->cb(handle->stream.conn.shutdown_req, 0);
|
2179
|
+
}
|
2180
|
+
}
|
2181
|
+
|
2182
|
+
handle->stream.conn.shutdown_req = NULL;
|
2183
|
+
|
2184
|
+
DECREASE_PENDING_REQ_COUNT(handle);
|
2185
|
+
return;
|
2186
|
+
}
|
2187
|
+
|
2188
|
+
if (handle->flags & UV_HANDLE_CLOSING &&
|
2189
|
+
handle->reqs_pending == 0) {
|
2190
|
+
/* The wait handle used for raw reading should be unregistered when the
|
2191
|
+
* wait callback runs. */
|
2192
|
+
assert(!(handle->flags & UV_HANDLE_TTY_READABLE) ||
|
2193
|
+
handle->tty.rd.read_raw_wait == NULL);
|
2194
|
+
|
2195
|
+
assert(!(handle->flags & UV_HANDLE_CLOSED));
|
2196
|
+
uv__handle_close(handle);
|
2197
|
+
}
|
2198
|
+
}
|
2199
|
+
|
2200
|
+
|
2201
|
+
/*
|
2202
|
+
* uv_process_tty_accept_req() is a stub to keep DELEGATE_STREAM_REQ working
|
2203
|
+
* TODO: find a way to remove it
|
2204
|
+
*/
|
2205
|
+
void uv_process_tty_accept_req(uv_loop_t* loop, uv_tty_t* handle,
|
2206
|
+
uv_req_t* raw_req) {
|
2207
|
+
abort();
|
2208
|
+
}
|
2209
|
+
|
2210
|
+
|
2211
|
+
/*
|
2212
|
+
* uv_process_tty_connect_req() is a stub to keep DELEGATE_STREAM_REQ working
|
2213
|
+
* TODO: find a way to remove it
|
2214
|
+
*/
|
2215
|
+
void uv_process_tty_connect_req(uv_loop_t* loop, uv_tty_t* handle,
|
2216
|
+
uv_connect_t* req) {
|
2217
|
+
abort();
|
2218
|
+
}
|
2219
|
+
|
2220
|
+
|
2221
|
+
int uv_tty_reset_mode(void) {
|
2222
|
+
/* Not necessary to do anything. */
|
2223
|
+
return 0;
|
2224
|
+
}
|
2225
|
+
|
2226
|
+
/* Determine whether or not this version of windows supports
|
2227
|
+
* proper ANSI color codes. Should be supported as of windows
|
2228
|
+
* 10 version 1511, build number 10.0.10586.
|
2229
|
+
*/
|
2230
|
+
static void uv__determine_vterm_state(HANDLE handle) {
|
2231
|
+
DWORD dwMode = 0;
|
2232
|
+
|
2233
|
+
uv__need_check_vterm_state = FALSE;
|
2234
|
+
if (!GetConsoleMode(handle, &dwMode)) {
|
2235
|
+
return;
|
2236
|
+
}
|
2237
|
+
|
2238
|
+
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
2239
|
+
if (!SetConsoleMode(handle, dwMode)) {
|
2240
|
+
return;
|
2241
|
+
}
|
2242
|
+
|
2243
|
+
uv__vterm_state = UV_TTY_SUPPORTED;
|
2244
|
+
}
|
2245
|
+
|
2246
|
+
static DWORD WINAPI uv__tty_console_resize_message_loop_thread(void* param) {
|
2247
|
+
NTSTATUS status;
|
2248
|
+
ULONG_PTR conhost_pid;
|
2249
|
+
MSG msg;
|
2250
|
+
|
2251
|
+
if (pSetWinEventHook == NULL || pNtQueryInformationProcess == NULL)
|
2252
|
+
return 0;
|
2253
|
+
|
2254
|
+
status = pNtQueryInformationProcess(GetCurrentProcess(),
|
2255
|
+
ProcessConsoleHostProcess,
|
2256
|
+
&conhost_pid,
|
2257
|
+
sizeof(conhost_pid),
|
2258
|
+
NULL);
|
2259
|
+
|
2260
|
+
if (!NT_SUCCESS(status)) {
|
2261
|
+
/* We couldn't retrieve our console host process, probably because this
|
2262
|
+
* is a 32-bit process running on 64-bit Windows. Fall back to receiving
|
2263
|
+
* console events from the input stream only. */
|
2264
|
+
return 0;
|
2265
|
+
}
|
2266
|
+
|
2267
|
+
/* Ensure the PID is a multiple of 4, which is required by SetWinEventHook */
|
2268
|
+
conhost_pid &= ~(ULONG_PTR)0x3;
|
2269
|
+
|
2270
|
+
uv__tty_console_resized = CreateEvent(NULL, TRUE, FALSE, NULL);
|
2271
|
+
if (uv__tty_console_resized == NULL)
|
2272
|
+
return 0;
|
2273
|
+
if (QueueUserWorkItem(uv__tty_console_resize_watcher_thread,
|
2274
|
+
NULL,
|
2275
|
+
WT_EXECUTELONGFUNCTION) == 0)
|
2276
|
+
return 0;
|
2277
|
+
|
2278
|
+
if (!pSetWinEventHook(EVENT_CONSOLE_LAYOUT,
|
2279
|
+
EVENT_CONSOLE_LAYOUT,
|
2280
|
+
NULL,
|
2281
|
+
uv__tty_console_resize_event,
|
2282
|
+
(DWORD)conhost_pid,
|
2283
|
+
0,
|
2284
|
+
WINEVENT_OUTOFCONTEXT))
|
2285
|
+
return 0;
|
2286
|
+
|
2287
|
+
while (GetMessage(&msg, NULL, 0, 0)) {
|
2288
|
+
TranslateMessage(&msg);
|
2289
|
+
DispatchMessage(&msg);
|
2290
|
+
}
|
2291
|
+
return 0;
|
2292
|
+
}
|
2293
|
+
|
2294
|
+
static void CALLBACK uv__tty_console_resize_event(HWINEVENTHOOK hWinEventHook,
|
2295
|
+
DWORD event,
|
2296
|
+
HWND hwnd,
|
2297
|
+
LONG idObject,
|
2298
|
+
LONG idChild,
|
2299
|
+
DWORD dwEventThread,
|
2300
|
+
DWORD dwmsEventTime) {
|
2301
|
+
SetEvent(uv__tty_console_resized);
|
2302
|
+
}
|
2303
|
+
|
2304
|
+
static DWORD WINAPI uv__tty_console_resize_watcher_thread(void* param) {
|
2305
|
+
for (;;) {
|
2306
|
+
/* Make sure to not overwhelm the system with resize events */
|
2307
|
+
Sleep(33);
|
2308
|
+
WaitForSingleObject(uv__tty_console_resized, INFINITE);
|
2309
|
+
uv__tty_console_signal_resize();
|
2310
|
+
ResetEvent(uv__tty_console_resized);
|
2311
|
+
}
|
2312
|
+
}
|
2313
|
+
|
2314
|
+
static void uv__tty_console_signal_resize(void) {
|
2315
|
+
CONSOLE_SCREEN_BUFFER_INFO sb_info;
|
2316
|
+
int width, height;
|
2317
|
+
|
2318
|
+
if (!GetConsoleScreenBufferInfo(uv__tty_console_handle, &sb_info))
|
2319
|
+
return;
|
2320
|
+
|
2321
|
+
width = sb_info.dwSize.X;
|
2322
|
+
height = sb_info.srWindow.Bottom - sb_info.srWindow.Top + 1;
|
2323
|
+
|
2324
|
+
uv_mutex_lock(&uv__tty_console_resize_mutex);
|
2325
|
+
assert(uv__tty_console_width != -1 && uv__tty_console_height != -1);
|
2326
|
+
if (width != uv__tty_console_width || height != uv__tty_console_height) {
|
2327
|
+
uv__tty_console_width = width;
|
2328
|
+
uv__tty_console_height = height;
|
2329
|
+
uv_mutex_unlock(&uv__tty_console_resize_mutex);
|
2330
|
+
uv__signal_dispatch(SIGWINCH);
|
2331
|
+
} else {
|
2332
|
+
uv_mutex_unlock(&uv__tty_console_resize_mutex);
|
2333
|
+
}
|
2334
|
+
}
|
2335
|
+
|
2336
|
+
void uv_tty_set_vterm_state(uv_tty_vtermstate_t state) {
|
2337
|
+
uv_sem_wait(&uv_tty_output_lock);
|
2338
|
+
uv__need_check_vterm_state = FALSE;
|
2339
|
+
uv__vterm_state = state;
|
2340
|
+
uv_sem_post(&uv_tty_output_lock);
|
2341
|
+
}
|
2342
|
+
|
2343
|
+
int uv_tty_get_vterm_state(uv_tty_vtermstate_t* state) {
|
2344
|
+
uv_sem_wait(&uv_tty_output_lock);
|
2345
|
+
*state = uv__vterm_state;
|
2346
|
+
uv_sem_post(&uv_tty_output_lock);
|
2347
|
+
return 0;
|
2348
|
+
}
|